diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3dffd284a..906e11095 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -16,6 +16,8 @@ _Leave empty if none_ ## Checklist -- [ ] Ran `cargo fmt`, `cargo clippy`, `cargo build --release` and `cargo test` and fixed any generated errors! +- [ ] Ran `cargo fmt`, `cargo clippy --all-targets`, `cargo build --release` and `cargo test` and fixed any generated errors! - [ ] Removed unnecessary commented out code - [ ] Used specific traces (if you trace actions please specify the cause i.e. the player) + +Note: if you locally don't get any errors, but GitHub Actions fails (especially at `clippy`) you might want to check your rust toolchain version. You can then feel free to fix these warnings/errors in your PR. \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index feda308e9..0091579ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: build +name: Check & Test & Lints & Build on: push: @@ -7,67 +7,133 @@ on: branches: [ main ] jobs: + fmt: + name: Cargo fmt + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - uses: Swatinem/rust-cache@v1 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Cargo clippy + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: clippy + + - uses: Swatinem/rust-cache@v1 + + - name: Annotate commit with clippy warnings + uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-targets --all-features -- -D warnings + + audit: + name: Cargo audit + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - uses: Swatinem/rust-cache@v1 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: clippy + + - name: Security audit + uses: actions-rs/audit-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + test: + name: Cargo test + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - uses: Swatinem/rust-cache@v1 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + build: - name: "Build and Test" + name: Cargo build & test + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ ubuntu-18.04, windows-2019, macos-10.15 ] - runs-on: ${{ matrix.os }} - + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + use-cross: true + - os: macos-latest + target: x86_64-apple-darwin + use-cross: false + - os: macos-latest + target: aarch64-apple-darwin + use-cross: false + - os: windows-latest + target: x86_64-pc-windows-msvc + cross: false steps: - - uses: actions/checkout@v2 - - # Caching - - # Work around https://github.com/actions/cache/issues/403 by using GNU tar - # instead of BSD tar. - - name: Install GNU tar - if: matrix.os == 'macos-10.15' - run: | - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - - - name: Cache cargo registry - uses: actions/cache@v2 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-registry2- - - name: Cache cargo index - uses: actions/cache@v2 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index2-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-index2- - - name: Cache cargo build - uses: actions/cache@v2 - with: - path: target - key: ${{ runner.os }}-cargo-build-target2-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-build-target2- - - - name: Install rustfmt - run: rustup component add rustfmt - - - name: Run tests - run: cargo test - env: - RUSTFLAGS: "-C opt-level=0" - - - name: Install Clippy - run: rustup component add clippy - - - name: Run Clippy - run: cargo clippy --all-targets -- -D warnings - env: - RUSTFLAGS: "-C opt-level=0" - - - name: Check formatting - run: cargo fmt -- --check - - uses: actions/upload-artifact@v2 - with: - name: Build - path: target/release/feather_server* + - name: Checkout sources + uses: actions/checkout@v2 + + - uses: Swatinem/rust-cache@v1 + with: + sharedKey: ${{ matrix.target }} + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: ${{ matrix.target }} + override: true + + - name: Run cargo build + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.use-cross }} + command: build + args: --target=${{ matrix.target }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b8522709..06cb11414 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,129 +1,59 @@ -name: release +name: Release on: push: - tags: - - '*' - + branches: + - release jobs: - build-release: - name: Build on 3 platforms + build: + name: Build + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ ubuntu-18.04, windows-2019, macos-10.15 ] include: - - os: ubuntu-18.04 - os-name: linux - executable-name: feather-server - - os: windows-2019 - os-name: windows - executable-name: feather-server.exe - - os: macos-10.15 - os-name: macOS - executable-name: feather-server - - runs-on: ${{ matrix.os }} - + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + use-cross: true + - os: ubuntu-latest + target: x86_64-unknown-freebsd + use-cross: true + - os: ubuntu-latest + target: x86_64-pc-windows-gnu + use-cross: true + - os: ubuntu-latest + target: i686-pc-windows-gnu + use-cross: true + - os: macos-latest + target: x86_64-apple-darwin + use-cross: false + - os: macos-latest + target: aarch64-apple-darwin + use-cross: false + - os: windows-latest + target: x86_64-pc-windows-msvc + cross: false + - os: windows-latest + target: i686-pc-windows-msvc + use-cross: false steps: - - uses: actions/checkout@v2 - - # Caching - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build - uses: actions/cache@v1 - with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - - name: Build (release mode) - run: cargo build --release - - - name: Get tag name - uses: olegtarasov/get-tag@v2 - id: tagName - - - name: Compress executable - uses: papeloto/action-zip@v1 - with: - files: target/release/${{ matrix.executable-name }} - dest: target/release/feather-${{ steps.tagName.outputs.tag }}-${{ matrix.os-name }}.zip - - - name: Upload release artifact - uses: actions/upload-artifact@v2-preview - with: - name: ${{ matrix.os-name }} - path: target/release/feather-${{ steps.tagName.outputs.tag }}-${{ matrix.os-name }}.zip - - - publish: - name: Publish artifacts to GitHub Releases - runs-on: ubuntu-latest - needs: [build-release] - - steps: - - name: Get tag name - uses: olegtarasov/get-tag@v2 - id: tagName - - - name: Create release - uses: actions/create-release@v1 - id: create_release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.tagName.outputs.tag }} - release_name: Release ${{ steps.tagName.outputs.tag }} - draft: true - - - name: Download Linux build - uses: actions/download-artifact@v1 - with: - name: linux - - - name: Download Windows build - uses: actions/download-artifact@v1 - with: - name: windows - - - name: Download macOS build - uses: actions/download-artifact@v1 - with: - name: macOS + - name: Checkout sources + uses: actions/checkout@v2 - - name: Upload Linux package - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: Swatinem/rust-cache@v1 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: linux/feather-${{ steps.tagName.outputs.tag }}-linux.zip - asset_name: feather-${{ steps.tagName.outputs.tag }}-linux.zip - asset_content_type: application/zip + sharedKey: ${{ matrix.target }} - - name: Upload Windows package - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: windows/feather-${{ steps.tagName.outputs.tag }}-windows.zip - asset_name: feather-${{ steps.tagName.outputs.tag }}-windows.zip - asset_content_type: application/zip + profile: minimal + toolchain: stable + target: ${{ matrix.target }} + override: true - - name: Upload macOS package - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run cargo build + uses: actions-rs/cargo@v1 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: macOS/feather-${{ steps.tagName.outputs.tag }}-macOS.zip - asset_name: feather-${{ steps.tagName.outputs.tag }}-macOS.zip - asset_content_type: application/zip + use-cross: ${{ matrix.use-cross }} + command: build + args: --release --target ${{ matrix.target }} diff --git a/.gitignore b/.gitignore index 79c1a3956..d0a8c67d2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ world/ /config.toml +plugins/ # Python cache files (libcraft) **/__pycache__/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 23d0ce670..2e415952b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ If you want to work on the codebase, please keep the following in mind: ## Notes to your code -For notes to your code check the Checklist from [`pull_request_template.md`](docs/pull_request_template.md) +For notes to your code check the Checklist from [`pull_request_template.md`](.github/pull_request_template.md) diff --git a/Cargo.lock b/Cargo.lock index 912340e56..0b4381092 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,11 +4,11 @@ version = 3 [[package]] name = "addr2line" -version = "0.14.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ - "gimli 0.23.0", + "gimli 0.26.1", ] [[package]] @@ -19,33 +19,13 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd2bc6d3f370b5666245ff421e231cba4353df936e26986d2918e61a8fd6aef6" -dependencies = [ - "aes-soft", - "aesni", - "block-cipher", -] - -[[package]] -name = "aes-soft" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63dd91889c49327ad7ef3b500fd1109dbd3c509a03db0d4a9ce413b79f575cb6" -dependencies = [ - "block-cipher", - "byteorder", - "opaque-debug", -] - -[[package]] -name = "aesni" -version = "0.8.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6fe808308bb07d393e2ea47780043ec47683fcf19cf5efc8ca51c50cc8c68a" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ - "block-cipher", + "cfg-if 1.0.0", + "cipher", + "cpufeatures", "opaque-debug", ] @@ -60,29 +40,29 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.2" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f200cbb1e856866d9eade941cf3aa0c5d7dd36f74311c4273b494f4ef036957" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.4", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.38" +version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" +checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" [[package]] name = "approx" @@ -104,9 +84,9 @@ dependencies = [ [[package]] name = "argh" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91792f088f87cdc7a2cfb1d617fa5ea18d7f1dc22ef0e1b5f82f3157cdc522be" +checksum = "dbb41d85d92dfab96cb95ab023c265c5e4261bb956c0fb49ca06d90c570f1958" dependencies = [ "argh_derive", "argh_shared", @@ -114,12 +94,12 @@ dependencies = [ [[package]] name = "argh_derive" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4eb0c0c120ad477412dc95a4ce31e38f2113e46bd13511253f79196ca68b067" +checksum = "be69f70ef5497dd6ab331a50bd95c6ac6b8f7f17a7967838332743fbd58dc3b5" dependencies = [ "argh_shared", - "heck", + "heck 0.3.3", "proc-macro2", "quote", "syn", @@ -127,59 +107,25 @@ dependencies = [ [[package]] name = "argh_shared" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781f336cc9826dbaddb9754cb5db61e64cab4f69668bd19dcc4a0394a86f4cb1" +checksum = "e6f8c380fa28aa1b36107cd97f0196474bb7241bb95a453c5c01a15ac74b2eac" [[package]] name = "arrayvec" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" -dependencies = [ - "serde", -] - -[[package]] -name = "async-executor" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb877970c7b440ead138f6321a3b5395d6061183af779340b65e20c0fede9146" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", - "vec-arena", -] [[package]] -name = "async-io" -version = "1.3.1" +name = "arrayvec" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" dependencies = [ - "concurrent-queue", - "fastrand", - "futures-lite", - "libc", - "log", - "nb-connect", - "once_cell", - "parking", - "polling", - "vec-arena", - "waker-fn", - "winapi", + "serde", ] -[[package]] -name = "async-task" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" - [[package]] name = "atty" version = "0.2.14" @@ -205,45 +151,57 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.56" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" +checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" dependencies = [ "addr2line", + "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.23.0", + "object", "rustc-demangle", ] +[[package]] +name = "base-x" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" + [[package]] name = "base64" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64ct" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874f8444adcb4952a8bc51305c8be95c8ec8237bb0d2e78d2e039f771f8828a0" + [[package]] name = "bincode" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d175dfa69e619905c4c3cdb7c3c203fa3bdd5d51184e3afdb2742c0280493772" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "byteorder", "serde", ] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35a2e31dce162f8f238c3c35a6600f1df4cb30f8929a6c464b0a8118d17c2502" +checksum = "470fbd40e959c961f16841fbf96edbbdcff766ead89a1ae2b53d22852be20998" dependencies = [ "funty", "radium", @@ -267,15 +225,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-cipher" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f337a3e6da609650eb74e02bc9fac7b735049f7623ab12f2e4c719316fcc7e80" -dependencies = [ - "generic-array", -] - [[package]] name = "block-place" version = "0.1.0" @@ -285,9 +234,30 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.6.1" +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 = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" +checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "bytecount" @@ -297,9 +267,9 @@ checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e" [[package]] name = "bytemuck" -version = "1.5.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed57e2090563b83ba8f83366628ce535a7584c9afa4c9fc0612a03925c6df58" +checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" dependencies = [ "bytemuck_derive", ] @@ -317,9 +287,9 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -329,15 +299,15 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "bytes" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "bzip2" -version = "0.3.3" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42b7c3cbf0fa9c1b82308d57191728ca0256cb821220f4e2fd410a72ade26e3b" +checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" dependencies = [ "bzip2-sys", "libc", @@ -345,26 +315,20 @@ dependencies = [ [[package]] name = "bzip2-sys" -version = "0.1.10+1.0.8" +version = "0.1.11+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fa3d1ac1ca21c5c4e36a97f3c3eb25084576f6fc47bf0139c1123434216c6c" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" dependencies = [ "cc", "libc", "pkg-config", ] -[[package]] -name = "cache-padded" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" - [[package]] name = "cargo-platform" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0226944a63d1bf35a3b5f948dd7c59e263db83695c9e8bffc4037de02e30f1d7" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" dependencies = [ "serde", ] @@ -376,7 +340,7 @@ dependencies = [ "anyhow", "argh", "cargo_metadata", - "heck", + "heck 0.3.3", "quill-plugin-format", ] @@ -395,9 +359,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.67" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" [[package]] name = "cesu8" @@ -407,11 +371,11 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfb8" -version = "0.5.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe91dea0d0c5ad0c16988e2aa5a784cff3c398d21f6938eb24e810963e89a9e" +checksum = "c3a4b6c43bf284e617a659ce5dc149676680530a3a4a9bb6b278d1a9ed5b229d" dependencies = [ - "stream-cipher", + "cipher", ] [[package]] @@ -426,19 +390,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "time", - "winapi", -] - [[package]] name = "chunked_transfer" version = "1.4.0" @@ -446,23 +397,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] -name = "cmake" -version = "0.1.45" +name = "cipher" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "cc", + "generic-array", ] [[package]] -name = "colored" -version = "1.9.3" +name = "clap" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59" +checksum = "7a30c3bf9ff12dfe5dae53f0a96e0febcd18420d1c0e7fad77796d9d5c4b5375" dependencies = [ "atty", + "bitflags", + "clap_derive", + "indexmap", "lazy_static", - "winapi", + "os_str_bytes", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "517358c28fcef6607bf6f76108e02afad7e82297d132a6b846dcc1fc3efcd153" +dependencies = [ + "heck 0.4.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cmake" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +dependencies = [ + "cc", ] [[package]] @@ -477,13 +456,10 @@ dependencies = [ ] [[package]] -name = "concurrent-queue" -version = "1.2.2" +name = "const-oid" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" -dependencies = [ - "cache-padded", -] +checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" [[package]] name = "const-random" @@ -501,51 +477,64 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "615f6e27d000a2bffbc7f2f6a8669179378fa27ee4d0a509e985dfc0a7defb40" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.4", "lazy_static", "proc-macro-hack", "tiny-keccak", ] [[package]] -name = "cpuid-bool" -version = "0.1.2" +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 = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" +checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +dependencies = [ + "libc", +] [[package]] name = "cranelift-bforest" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9221545c0507dc08a62b2d8b5ffe8e17ac580b0a74d1813b496b8d70b070fbd0" +checksum = "7e6bea67967505247f54fa2c85cf4f6e0e31c4e5692c9b70e4ae58e339067333" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9936ea608b6cd176f107037f6adbb4deac933466fc7231154f96598b2d3ab1" +checksum = "48194035d2752bdd5bdae429e3ab88676e95f52a2b1355a5d4e809f9e39b1d74" dependencies = [ - "byteorder", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.22.0", + "gimli 0.25.0", "log", "regalloc", "smallvec", - "target-lexicon", - "thiserror", + "target-lexicon 0.12.2", ] [[package]] name = "cranelift-codegen-meta" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef2b2768568306540f4c8db3acce9105534d34c4a1e440529c1e702d7f8c8d7" +checksum = "976efb22fcab4f2cd6bd4e9913764616a54d895c1a23530128d04e03633c555f" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -553,45 +542,42 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6759012d6d19c4caec95793f052613e9d4113e925e7f14154defbac0f1d4c938" +checksum = "9dabb5fe66e04d4652e434195b45ae65b5c8172d520247b8f66d8df42b2b45dc" [[package]] name = "cranelift-entity" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86badbce14e15f52a45b666b38abe47b204969dd7f8fb7488cb55dd46b361fa6" -dependencies = [ - "serde", -] +checksum = "3329733e4d4b8e91c809efcaa4faee80bf66f20164e3dd16d707346bd3494799" [[package]] name = "cranelift-frontend" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b608bb7656c554d0a4cf8f50c7a10b857e80306f6ff829ad6d468a7e2323c8d8" +checksum = "279afcc0d3e651b773f94837c3d581177b348c8d69e928104b2e9fccb226f921" dependencies = [ "cranelift-codegen", "log", "smallvec", - "target-lexicon", + "target-lexicon 0.12.2", ] [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "crossbeam-channel" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -599,9 +585,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", @@ -610,9 +596,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" +checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -623,11 +609,10 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" +checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" dependencies = [ - "autocfg 1.0.1", "cfg-if 1.0.0", "lazy_static", ] @@ -639,20 +624,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "ctor" -version = "0.1.19" +name = "crypto-bigint" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f45d9ad417bcef4817d614a501ab55cdd96a6fdb24f49aab89a54acfd66b19" +checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03" dependencies = [ - "quote", - "syn", + "generic-array", + "rand_core 0.6.3", + "subtle", ] [[package]] name = "darling" -version = "0.12.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06d4a9551359071d1890820e3571252b91229e0712e7c36b08940e603c5a8fc" +checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" dependencies = [ "darling_core", "darling_macro", @@ -660,9 +646,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.12.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b443e5fb0ddd56e0c9bfa47dc060c5306ee500cb731f2b91432dd65589a77684" +checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" dependencies = [ "fnv", "ident_case", @@ -674,15 +660,38 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.12.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0220073ce504f12a70efc4e7cdaea9e9b1b324872e7ad96a208056d7a638b81" +checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" dependencies = [ "darling_core", "quote", "syn", ] +[[package]] +name = "der" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4" +dependencies = [ + "const-oid", + "crypto-bigint", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn", +] + [[package]] name = "digest" version = "0.9.0" @@ -692,6 +701,12 @@ dependencies = [ "generic-array", ] +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + [[package]] name = "either" version = "1.6.1" @@ -700,18 +715,18 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "enumset" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd795df6708a599abf1ee10eacc72efd052b7a5f70fdf0715e4d5151a6db9c3" +checksum = "6216d2c19a6fb5f29d1ada1dc7bc4367a8cbf0fa4af5cf12e07b5bbdde6b5b2c" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19c52f9ec503c8a68dc04daf71a04b07e690c32ab1a8b68e33897f255269d47" +checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" dependencies = [ "darling", "proc-macro2", @@ -719,15 +734,6 @@ dependencies = [ "syn", ] -[[package]] -name = "erased-serde" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0465971a8cc1fa2455c8465aaa377131e1f1cf4983280f474a13e68793aa770c" -dependencies = [ - "serde", -] - [[package]] name = "fallible-iterator" version = "0.2.0" @@ -736,9 +742,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.4.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" dependencies = [ "instant", ] @@ -749,15 +755,16 @@ version = "0.1.0" dependencies = [ "ahash 0.4.7", "anyhow", - "arrayvec", + "arrayvec 0.7.2", "bitflags", "bitvec", + "bytemuck", "byteorder", "feather-blocks", - "feather-generated", "hematite-nbt", "libcraft-blocks", "libcraft-core", + "libcraft-inventory", "libcraft-items", "libcraft-particles", "libcraft-text", @@ -766,7 +773,8 @@ dependencies = [ "num-derive", "num-traits", "parking_lot", - "rand 0.8.3", + "quill-common", + "rand 0.8.4", "rand_pcg", "serde", "serde_json", @@ -784,7 +792,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", - "feather-generated", + "libcraft-blocks", "num-traits", "once_cell", "serde", @@ -798,7 +806,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", - "heck", + "heck 0.3.3", "indexmap", "maplit", "once_cell", @@ -813,19 +821,23 @@ dependencies = [ name = "feather-common" version = "0.1.0" dependencies = [ - "ahash 0.7.2", + "ahash 0.7.6", "anyhow", "feather-base", "feather-blocks", "feather-ecs", - "feather-generated", "feather-utils", + "feather-worldgen", "flume", - "itertools 0.10.0", + "itertools", "libcraft-core", + "libcraft-inventory", + "libcraft-items", "log", "parking_lot", "quill-common", + "rand 0.8.4", + "rayon", "smartstring", "uuid", ] @@ -841,7 +853,7 @@ dependencies = [ "serde_json", "smartstring", "thiserror", - "ureq 1.5.4", + "ureq", "zip", ] @@ -849,7 +861,7 @@ dependencies = [ name = "feather-ecs" version = "0.1.0" dependencies = [ - "ahash 0.7.2", + "ahash 0.7.6", "anyhow", "feather-utils", "hecs", @@ -857,22 +869,11 @@ dependencies = [ "thiserror", ] -[[package]] -name = "feather-generated" -version = "0.1.0" -dependencies = [ - "num-derive", - "num-traits", - "parking_lot", - "thiserror", - "vek", -] - [[package]] name = "feather-plugin-host" version = "0.1.0" dependencies = [ - "ahash 0.7.2", + "ahash 0.7.6", "anyhow", "bincode", "bumpalo", @@ -881,12 +882,13 @@ dependencies = [ "feather-common", "feather-ecs", "feather-plugin-host-macros", - "libloading 0.7.0", + "libloading", "log", - "paste 1.0.4", + "paste 1.0.6", "quill-common", "quill-plugin-format", "serde", + "serde_json", "tempfile", "vec-arena", "wasmer", @@ -915,11 +917,13 @@ dependencies = [ "cfb8", "feather-base", "feather-blocks", - "feather-generated", "flate2", "hematite-nbt", + "libcraft-core", + "libcraft-items", "num-traits", "parking_lot", + "quill-common", "serde", "thiserror", "uuid", @@ -929,11 +933,11 @@ dependencies = [ name = "feather-server" version = "0.1.0" dependencies = [ - "ahash 0.7.2", + "ahash 0.7.6", "anyhow", "base64", - "chrono", - "colored 2.0.0", + "base64ct", + "colored", "crossbeam-utils", "feather-base", "feather-common", @@ -941,38 +945,39 @@ dependencies = [ "feather-plugin-host", "feather-protocol", "feather-utils", + "feather-worldgen", "fern", "flate2", "flume", "futures-lite", "hematite-nbt", "libcraft-core", + "libcraft-items", "log", "md-5", - "num-bigint 0.3.1", + "num-bigint", + "num-traits", "once_cell", "parking_lot", "quill-common", - "rand 0.7.3", + "rand 0.8.4", "ring", "rsa", "rsa-der", "serde", "serde_json", "sha-1", + "slab", + "time 0.3.6", "tokio", "toml", - "ureq 2.0.2", + "ureq", "uuid", - "vec-arena", ] [[package]] name = "feather-utils" version = "0.1.0" -dependencies = [ - "simple_logger", -] [[package]] name = "feather-worldgen" @@ -988,7 +993,7 @@ dependencies = [ "rand_xorshift", "simdnoise", "smallvec", - "strum 0.19.5", + "strum", ] [[package]] @@ -1002,9 +1007,9 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" +checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1014,9 +1019,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" +checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" dependencies = [ "cfg-if 1.0.0", "crc32fast", @@ -1027,15 +1032,15 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.2" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a685ab99b8f60a271b44d5dd1a76e55124a8c9fa0407b7a8e9cd172d5b588" +checksum = "5d04dafd11240188e146b6f6476a898004cace3be31d4ec5e08e216bf4947ac0" dependencies = [ "futures-core", "futures-sink", "nanorand", "pin-project", - "spinning_top", + "spin 0.9.2", ] [[package]] @@ -1062,21 +1067,21 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "futures-core" -version = "0.3.13" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" +checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" [[package]] name = "futures-io" -version = "0.3.13" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" +checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" [[package]] name = "futures-lite" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ "fastrand", "futures-core", @@ -1089,9 +1094,9 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.13" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" +checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" [[package]] name = "generational-arena" @@ -1100,14 +1105,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e1d3b771574f62d0548cee0ad9057857e9fc25d7a3335f140c84f6acd0bf601" dependencies = [ "cfg-if 0.1.10", - "serde", ] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" dependencies = [ "typenum", "version_check", @@ -1126,33 +1130,22 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", "js-sys", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.10.0+wasi-snapshot-preview1", "wasm-bindgen", ] -[[package]] -name = "ghost" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5bcf1bbeab73aa4cf2fde60a846858dc036163c7c33bec309f8d17de785479" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "gimli" -version = "0.22.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" dependencies = [ "fallible-iterator", "indexmap", @@ -1161,51 +1154,55 @@ dependencies = [ [[package]] name = "gimli" -version = "0.23.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] -name = "goblin" -version = "0.2.3" +name = "hashbrown" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20fd25aa456527ce4f544271ae4fea65d2eda4a6561ea56f39fb3ee4f7e3884" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" dependencies = [ - "log", - "plain", - "scroll", + "ahash 0.4.7", ] [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.4.7", + "ahash 0.7.6", ] [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +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", + "hashbrown 0.9.1", ] [[package]] name = "hematite-nbt" -version = "0.5.1" -source = "git+https://github.com/PistonDevelopers/hematite_nbt#dccdb7601021d8addf732b6b9a8af547d8a7d654" +version = "0.5.2" +source = "git+https://github.com/PistonDevelopers/hematite_nbt#ce60b817f31b20125644c12fbf13f981809d5324" dependencies = [ "byteorder", "cesu8", @@ -1215,9 +1212,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] @@ -1230,9 +1227,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", @@ -1241,20 +1238,20 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ "autocfg 1.0.1", - "hashbrown", + "hashbrown 0.11.2", "serde", ] [[package]] name = "inkwell" -version = "0.1.0-beta.2" +version = "0.1.0-beta.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fe0be1e47c0c0f3da4397693e08f5d78329ae095c25d529e12ade78420fb41" +checksum = "2223d0eba0ae6d40a3e4680c6a3209143471e1f38b41746ea309aa36dde9f90b" dependencies = [ "either", "inkwell_internals", @@ -1267,9 +1264,9 @@ dependencies = [ [[package]] name = "inkwell_internals" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e1f71330ccec54ee62533ae88574c4169b67fb4b95cbb1196a1322582abd11" +checksum = "3c7090af3d300424caa81976b8c97bca41cd70e861272c072e188ae082fb49f9" dependencies = [ "proc-macro2", "quote", @@ -1278,64 +1275,33 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.9" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "inventory" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0f7efb804ec95e33db9ad49e4252f049e37e8b0a4652e3cd61f7999f2eff7f" -dependencies = [ - "ctor", - "ghost", - "inventory-impl", -] - -[[package]] -name = "inventory-impl" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75c094e94816723ab936484666968f5b58060492e880f3c8d00489a1e244fa51" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "itertools" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" -dependencies = [ - "either", -] - [[package]] name = "itertools" -version = "0.10.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "0.4.7" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "js-sys" -version = "0.3.48" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78" +checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" dependencies = [ "wasm-bindgen", ] @@ -1346,22 +1312,22 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] name = "leb128" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "lexical-core" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21f866863575d0e1d654fbeeabdc927292fdf862873dc3c96c6f753357e13374" +checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ - "arrayvec", + "arrayvec 0.5.2", "bitflags", "cfg-if 1.0.0", "ryu", @@ -1370,15 +1336,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.87" +version = "0.2.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265d751d31d6780a3f956bb5b8022feba2d94eeee5a84ba64f4212eedca42213" +checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9" [[package]] name = "libcraft-blocks" version = "0.1.0" dependencies = [ - "ahash 0.7.2", + "ahash 0.7.6", "bincode", "bytemuck", "flate2", @@ -1400,7 +1366,7 @@ dependencies = [ "num-derive", "num-traits", "serde", - "strum 0.20.0", + "strum", "strum_macros", "vek", ] @@ -1417,6 +1383,14 @@ dependencies = [ "serde_json", ] +[[package]] +name = "libcraft-inventory" +version = "0.1.0" +dependencies = [ + "libcraft-items", + "parking_lot", +] + [[package]] name = "libcraft-items" version = "0.1.0" @@ -1462,19 +1436,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - -[[package]] -name = "libloading" -version = "0.7.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ "cfg-if 1.0.0", "winapi", @@ -1488,9 +1452,9 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libz-sys" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" dependencies = [ "cc", "cmake", @@ -1501,9 +1465,9 @@ dependencies = [ [[package]] name = "llvm-sys" -version = "110.0.1" +version = "120.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ede189444b8c78907e5d36da5dabcf153170fcff9c1dba48afc4b33c7e19f0" +checksum = "4897352ffc39e1b2b3f7078b632222939044b76d3a99d36666c1c47203c104cc" dependencies = [ "cc", "lazy_static", @@ -1514,9 +1478,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.2" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" dependencies = [ "scopeguard", ] @@ -1530,6 +1494,27 @@ 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", +] + +[[package]] +name = "loupe-derive" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "mach" version = "0.3.2" @@ -1547,9 +1532,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "md-5" @@ -1564,43 +1549,28 @@ dependencies = [ [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" -version = "0.2.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" +checksum = "fe3179b85e1fd8b14447cbebadb75e45a1002f541b925f0bfec366d56a81c56d" dependencies = [ "libc", ] [[package]] name = "memoffset" -version = "0.6.1" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ "autocfg 1.0.1", ] -[[package]] -name = "minecraft-proxy" -version = "0.1.0" -dependencies = [ - "anyhow", - "argh", - "async-executor", - "async-io", - "either", - "feather-protocol", - "futures-lite", - "log", - "simple_logger", -] - [[package]] name = "miniz_oxide" version = "0.4.4" @@ -1613,9 +1583,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.9" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5dede4e2065b3842b8b0af444119f3aa331cc7cc2dd20388bfb0f5d5a38823a" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -1626,37 +1596,26 @@ dependencies = [ [[package]] name = "miow" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "socket2", "winapi", ] [[package]] name = "more-asserts" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" [[package]] name = "nanorand" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1378b66f7c93a1c0f8464a19bf47df8795083842e5090f4b7305973d5a22d0" -dependencies = [ - "getrandom 0.2.2", -] - -[[package]] -name = "nb-connect" -version = "1.0.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670361df1bc2399ee1ff50406a0d422587dd3bb0da596e1978fe8e05dabddf4f" +checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" dependencies = [ - "libc", - "socket2", + "getrandom 0.2.4", ] [[package]] @@ -1692,20 +1651,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg 1.0.1", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.3.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a41747ae4633fce5adffb4d2e81ffc5e89593cb19917f8fb2cc5ff76507bf" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ "autocfg 1.0.1", "num-integer", @@ -1714,9 +1662,9 @@ dependencies = [ [[package]] name = "num-bigint-dig" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d51546d704f52ef14b3c962b5776e53d5b862e5790e40a350d366c209bd7f7a" +checksum = "4547ee5541c18742396ae2c895d0717d0f886d8823b8399cdaf7b07d63ad0480" dependencies = [ "autocfg 0.1.7", "byteorder", @@ -1725,8 +1673,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "rand 0.7.3", - "serde", + "rand 0.8.4", "smallvec", "zeroize", ] @@ -1770,33 +1717,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ "autocfg 1.0.1", + "libm", ] [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", ] [[package]] -name = "object" -version = "0.22.0" +name = "num_threads" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "71a1eb3a36534514077c1e079ada2fb170ef30c47d203aa6916138cf882ecd52" dependencies = [ - "crc32fast", - "indexmap", + "libc", ] [[package]] name = "object" -version = "0.23.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +dependencies = [ + "crc32fast", + "indexmap", + "memchr", +] [[package]] name = "observe-creativemode-flight-event" @@ -1807,9 +1759,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.7.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "opaque-debug" @@ -1829,6 +1781,15 @@ dependencies = [ "syn", ] +[[package]] +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" version = "2.0.0" @@ -1837,9 +1798,9 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "parking_lot" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", @@ -1848,9 +1809,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ "cfg-if 1.0.0", "instant", @@ -1879,9 +1840,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d65c4d95931acda4498f675e332fcbdc9a06705cd07086c510e9b6009cd1c1" +checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" [[package]] name = "paste-impl" @@ -1893,14 +1854,12 @@ dependencies = [ ] [[package]] -name = "pem" -version = "0.8.3" +name = "pem-rfc7468" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" +checksum = "8f22eb0e3c593294a99e9ff4b24cf6b752d43f193aa4415fe5077c159996d497" dependencies = [ - "base64", - "once_cell", - "regex", + "base64ct", ] [[package]] @@ -1920,18 +1879,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.5" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.5" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ "proc-macro2", "quote", @@ -1940,53 +1899,66 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cf491442e4b033ed1c722cb9f0df5fcfcf4de682466c46469c36bc47dc5548a" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] -name = "pkg-config" -version = "0.3.19" +name = "pkcs1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "116bee8279d783c0cf370efa1a94632f2108e5ef0bb32df31f051647810a4e2c" +dependencies = [ + "der", + "pem-rfc7468", + "zeroize", +] [[package]] -name = "plain" -version = "0.2.3" +name = "pkcs8" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - -[[package]] -name = "plugin-message" -version = "0.1.0" +checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447" dependencies = [ - "quill", + "der", + "pem-rfc7468", + "pkcs1", + "spki", + "zeroize", ] [[package]] -name = "podio" -version = "0.1.7" +name = "pkg-config" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18befed8bc2b61abc79a457295e7e838417326da1586050b919414073977f19" +checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" [[package]] -name = "polling" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4" +name = "plugin-macro" +version = "0.1.0" dependencies = [ - "cfg-if 0.1.10", - "libc", - "log", - "wepoll-sys", - "winapi", + "quote", + "syn", +] + +[[package]] +name = "plugin-message" +version = "0.1.0" +dependencies = [ + "quill", ] [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "pretty-hex" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "bc5c99d529f0d30937f6f4b8a86d988047327bb88d04d2c4afc356de74722131" [[package]] name = "proc-macro-error" @@ -2020,20 +1992,45 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] [[package]] -name = "qstring" -version = "0.7.2" +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 = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "percent-encoding", + "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]] @@ -2041,7 +2038,16 @@ name = "query-entities" version = "0.1.0" dependencies = [ "quill", - "rand 0.8.3", + "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]] @@ -2050,12 +2056,15 @@ 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", ] @@ -2066,6 +2075,7 @@ version = "0.1.0" dependencies = [ "bincode", "bytemuck", + "derive_more", "libcraft-core", "libcraft-particles", "libcraft-text", @@ -2085,7 +2095,7 @@ dependencies = [ "serde_json", "serde_with", "tar", - "target-lexicon", + "target-lexicon 0.11.2", ] [[package]] @@ -2107,9 +2117,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2", ] @@ -2135,14 +2145,14 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ "libc", - "rand_chacha 0.3.0", - "rand_core 0.6.2", - "rand_hc 0.3.0", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", ] [[package]] @@ -2157,12 +2167,12 @@ dependencies = [ [[package]] name = "rand_chacha" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -2176,11 +2186,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.4", ] [[package]] @@ -2194,20 +2204,20 @@ dependencies = [ [[package]] name = "rand_hc" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" dependencies = [ - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] name = "rand_pcg" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de198537002b913568a3847e53535ace266f93526caf5c360ec41d72c5787f0" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" dependencies = [ - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -2221,9 +2231,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ "autocfg 1.0.1", "crossbeam-deque", @@ -2233,9 +2243,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -2246,9 +2256,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.5" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags", ] @@ -2266,27 +2276,26 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ "aho-corasick", "memchr", "regex-syntax", - "thread_local", ] [[package]] name = "regex-syntax" -version = "0.6.22" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "region" -version = "2.2.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" +checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" dependencies = [ "bitflags", "libc", @@ -2303,6 +2312,15 @@ 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" @@ -2312,17 +2330,42 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", + "spin 0.5.2", "untrusted", "web-sys", "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.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3648b669b10afeab18972c105e284a7b953a669b0be3514c27f9b17acab2f9cd" +checksum = "e05c2603e2823634ab331437001b411b9ed11660fbc4066f3908c84a9439260d" dependencies = [ "byteorder", "digest", @@ -2331,29 +2374,27 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "pem", - "rand 0.7.3", - "sha2", - "simple_asn1", + "pkcs1", + "pkcs8", + "rand 0.8.4", "subtle", - "thiserror", "zeroize", ] [[package]] name = "rsa-der" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1170c86c683547fa781a0e39e6e281ebaedd4515be8a806022984f427ea3d44d" +checksum = "a19473b2de3164677ff38e4309c42448ba8d0fe5ad5fa722e7d278f991859aa6" dependencies = [ "simple_asn1", ] [[package]] name = "rustc-demangle" -version = "0.1.18" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc-hash" @@ -2370,13 +2411,21 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.4", +] + [[package]] name = "rustls" -version = "0.19.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" +checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" dependencies = [ - "base64", "log", "ring", "sct", @@ -2384,47 +2433,39 @@ dependencies = [ ] [[package]] -name = "ryu" -version = "1.0.5" +name = "rustversion" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" [[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scroll" -version = "0.10.2" +name = "ryu" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" -dependencies = [ - "scroll_derive", -] +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] -name = "scroll_derive" -version = "0.10.5" +name = "scopeguard" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ "ring", "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" @@ -2444,6 +2485,12 @@ dependencies = [ "serde", ] +[[package]] +name = "semver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" + [[package]] name = "semver-parser" version = "0.7.0" @@ -2461,9 +2508,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.123" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" +checksum = "96b3c34c1690edf8174f5b289a336ab03f568a4460d8c6df75f2f3a692b3bc6a" dependencies = [ "serde_derive", ] @@ -2479,9 +2526,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.123" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" +checksum = "784ed1fbfa13fe191077537b0d70ec8ad1e903cfe04831da608aa36457cb653d" dependencies = [ "proc-macro2", "quote", @@ -2490,9 +2537,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "651bca88044a8a5166bd0fd984a7ca558301079cf08365ca6287b2bb608cca3e" dependencies = [ "itoa", "ryu", @@ -2501,28 +2548,29 @@ dependencies = [ [[package]] name = "serde_test" -version = "1.0.123" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38145a8510bdf71d9a8cceeb57664049538446e77f24648328bdbcf22dc7e169" +checksum = "2616dbe01183e562d89c3614f03818b0ae90c218ad149034d957436fb5cba3f4" dependencies = [ "serde", ] [[package]] name = "serde_with" -version = "1.6.4" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b44be9227e214a0420707c9ca74c2d4991d9955bae9415a8f93f05cebf561be5" +checksum = "ad6056b4cb69b6e43e3a0f055def223380baecc99da683884f205bf347f7c4b3" dependencies = [ + "rustversion", "serde", "serde_with_macros", ] [[package]] name = "serde_with_macros" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48b35457e9d855d3dc05ef32a73e0df1e2c0fd72c38796a4ee909160c8eeec2" +checksum = "12e47be9471c72889ebafb5e14d5ff930d89ae7a67bbdb5f8abb564f845a927e" dependencies = [ "darling", "proc-macro2", @@ -2532,35 +2580,37 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.4" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer", "cfg-if 1.0.0", - "cpuid-bool", + "cpufeatures", "digest", "opaque-debug", ] [[package]] -name = "sha2" -version = "0.9.3" +name = "sha1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" dependencies = [ - "block-buffer", - "cfg-if 1.0.0", - "cpuid-bool", - "digest", - "opaque-debug", + "sha1_smol", ] +[[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.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] @@ -2588,60 +2638,43 @@ name = "simple-plugin" version = "0.1.0" dependencies = [ "quill", - "rand 0.8.3", + "rand 0.8.4", ] [[package]] name = "simple_asn1" -version = "0.4.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692ca13de57ce0613a363c8c2f1de925adebc81b04c923ac60c5488bb44abe4b" +checksum = "4a762b1c38b9b990c694b9c2f8abe3372ce6a9ceaae6bca39cfc46e054f45745" dependencies = [ - "chrono", - "num-bigint 0.2.6", + "num-bigint", "num-traits", + "thiserror", + "time 0.3.6", ] [[package]] -name = "simple_logger" -version = "1.11.0" +name = "slab" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd57f17c093ead1d4a1499dc9acaafdd71240908d64775465543b8d9a9f1d198" -dependencies = [ - "atty", - "chrono", - "colored 1.9.3", - "log", - "winapi", -] +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "smartstring" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ada87540bf8ef4cf8a1789deb175626829bb59b1fefd816cf7f7f55efcdbae9" +checksum = "31aa6a31c0c2b21327ce875f7e8952322acfcfd0c27569a6e18a647281352c9b" dependencies = [ "serde", "static_assertions", ] -[[package]] -name = "socket2" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "winapi", -] - [[package]] name = "spin" version = "0.5.2" @@ -2649,20 +2682,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "spinning_top" -version = "0.2.2" +name = "spin" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e529d73e80d64b5f2631f9035113347c578a1c9c7774b83a2b880788459ab36" +checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5" dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32" +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" @@ -2670,40 +2721,73 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] -name = "stream-cipher" -version = "0.7.1" +name = "stdweb" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c80e15f898d8d8f25db24c253ea615cc14acf418ff307822995814e7d42cfa89" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" dependencies = [ - "block-cipher", - "generic-array", + "discard", + "rustc_version 0.2.3", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", ] [[package]] -name = "strsim" -version = "0.10.0" +name = "stdweb-derive" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn", +] [[package]] -name = "strum" -version = "0.19.5" +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 = "b89a286a7e3b5720b9a477b23253bc50debac207c8d21505f8e70b36792f11b5" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" +checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2" [[package]] name = "strum_macros" -version = "0.20.1" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" +checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" dependencies = [ - "heck", + "heck 0.3.3", "proc-macro2", "quote", "syn", @@ -2711,15 +2795,15 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.60" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", @@ -2728,9 +2812,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", @@ -2746,9 +2830,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0bcfbd6a598361fda270d82469fff3d65089dc33e175c9a131f7b4cd395f228" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" dependencies = [ "filetime", "libc", @@ -2761,34 +2845,55 @@ 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.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if 1.0.0", + "fastrand", "libc", - "rand 0.8.3", "redox_syscall", "remove_dir_all", "winapi", ] +[[package]] +name = "termcolor" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" + [[package]] name = "thiserror" -version = "1.0.24" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -2796,22 +2901,60 @@ dependencies = [ ] [[package]] -name = "thread_local" -version = "1.1.3" +name = "time" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" dependencies = [ - "once_cell", + "const_fn", + "libc", + "standback", + "stdweb", + "time-macros 0.1.1", + "version_check", + "winapi", ] [[package]] name = "time" -version = "0.1.43" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "c8d54b9298e05179c335de2b9645d061255bcd5155f843b3e328d2cfe0a5b413" dependencies = [ + "itoa", "libc", - "winapi", + "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", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "standback", + "syn", ] [[package]] @@ -2825,9 +2968,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] @@ -2847,12 +2990,11 @@ dependencies = [ [[package]] name = "tokio" -version = "1.2.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8190d04c665ea9e6b6a0dc45523ade572c088d2e6566244c1122671dbf4ae3a" +checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838" dependencies = [ - "autocfg 1.0.1", - "bytes 1.0.1", + "bytes 1.1.0", "libc", "memchr", "mio", @@ -2867,9 +3009,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.1.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2", "quote", @@ -2887,11 +3029,12 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.25" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if 1.0.0", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2899,9 +3042,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.13" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a9bd1db7706f2373a190b0d067146caa39350c486f3d455b0e33b431f94c07" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -2910,42 +3053,18 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ "lazy_static", ] [[package]] name = "typenum" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" - -[[package]] -name = "typetag" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422619e1a7299befb977a1f6d8932c499f6151dbcafae715193570860cae8f07" -dependencies = [ - "erased-serde", - "inventory", - "lazy_static", - "serde", - "typetag-impl", -] - -[[package]] -name = "typetag-impl" -version = "0.1.7" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504f9626fe6cc1c376227864781996668e15c1ff251d222f63ef17f310bf1fec" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" @@ -2955,33 +3074,30 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "untrusted" @@ -2991,29 +3107,13 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "294b85ef5dbc3670a72e82a89971608a1fcc4ed5c7c5a2895230d31a95f0569b" -dependencies = [ - "base64", - "chunked_transfer", - "log", - "once_cell", - "qstring", - "rustls", - "url", - "webpki", - "webpki-roots", -] - -[[package]] -name = "ureq" -version = "2.0.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585dcbf3483242f77b502864478ede62431baf3442b99367d3456ec20c1707b" +checksum = "9399fa2f927a3d327187cbd201480cee55bee6ac5d3c77dd27f0c6814cff16d5" dependencies = [ "base64", "chunked_transfer", + "flate2", "log", "once_cell", "rustls", @@ -3026,9 +3126,9 @@ dependencies = [ [[package]] name = "url" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna", @@ -3042,21 +3142,21 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.4", "serde", ] [[package]] name = "vcpkg" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vec-arena" -version = "1.0.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d" +checksum = "dae23c56872cdb2d1b1ddb90112da26615654fa4d4e3ee84e2d3b3e9c9853145" [[package]] name = "vek" @@ -3067,16 +3167,16 @@ dependencies = [ "approx 0.4.0", "num-integer", "num-traits", - "rustc_version", + "rustc_version 0.2.3", "serde", "static_assertions", ] [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" @@ -3092,15 +3192,15 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.71" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7" +checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3108,9 +3208,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.71" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8" +checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" dependencies = [ "bumpalo", "lazy_static", @@ -3123,9 +3223,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.71" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b" +checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3133,9 +3233,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.71" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e" +checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2", "quote", @@ -3146,28 +3246,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.71" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1" +checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" [[package]] name = "wasmer" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70cfae554988d904d64ca17ab0e7cd652ee5c8a0807094819c1ea93eb9d6866" +checksum = "23f0188c23fc1b7de9bd7f8b834d0b1cd5edbe66e287452e8ce36d24418114f7" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "indexmap", + "js-sys", + "loupe", "more-asserts", - "target-lexicon", + "target-lexicon 0.12.2", "thiserror", + "wasm-bindgen", "wasmer-compiler", "wasmer-compiler-cranelift", "wasmer-compiler-llvm", "wasmer-derive", "wasmer-engine", - "wasmer-engine-jit", - "wasmer-engine-native", + "wasmer-engine-dylib", + "wasmer-engine-universal", "wasmer-types", "wasmer-vm", "winapi", @@ -3175,15 +3278,17 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7732a9cab472bd921d5a0c422f45b3d03f62fa2c40a89e0770cef6d47e383e" +checksum = "88c51cc589772c5f90bd329244c2416976d6cb2ee00d59429aaa8f421d9fe447" dependencies = [ "enumset", + "loupe", + "rkyv", "serde", "serde_bytes", "smallvec", - "target-lexicon", + "target-lexicon 0.12.2", "thiserror", "wasmer-types", "wasmer-vm", @@ -3192,17 +3297,19 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb9395f094e1d81534f4c5e330ed4cdb424e8df870d29ad585620284f5fddb" +checksum = "09691e3e323b4e1128d2127f60f9cd988b66ce49afc8184b071c2b5ab16793f2" dependencies = [ "cranelift-codegen", + "cranelift-entity", "cranelift-frontend", - "gimli 0.22.0", + "gimli 0.25.0", + "loupe", "more-asserts", "rayon", - "serde", "smallvec", + "target-lexicon 0.12.2", "tracing", "wasmer-compiler", "wasmer-types", @@ -3211,23 +3318,24 @@ dependencies = [ [[package]] name = "wasmer-compiler-llvm" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d72c30e73aba7c5d56b5445858ae7ce6334d2e970ddc504a86eb5199e852bc4" +checksum = "0de51c7fcf88c86c1ba050dfe1dd8fe3613ad1072a58b07a8c50148145cee249" dependencies = [ "byteorder", "cc", - "goblin", "inkwell", - "itertools 0.9.0", + "itertools", "lazy_static", "libc", + "loupe", + "object", "rayon", "regex", - "rustc_version", - "semver 0.11.0", + "rustc_version 0.4.0", + "semver 1.0.4", "smallvec", - "target-lexicon", + "target-lexicon 0.12.2", "wasmer-compiler", "wasmer-types", "wasmer-vm", @@ -3235,9 +3343,9 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b86dcd2c3efdb8390728a2b56f762db07789aaa5aa872a9dc776ba3a7912ed" +checksum = "93f5cb7b09640e09f1215da95d6fb7477d2db572f064b803ff705f39ff079cc5" dependencies = [ "proc-macro-error", "proc-macro2", @@ -3247,19 +3355,20 @@ dependencies = [ [[package]] name = "wasmer-engine" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efe4667d6bd888f26ae8062a63a9379fa697415b4b4e380f33832e8418fd71b5" +checksum = "ab20311c354fe2c12bc766417e0a1a45f399c1cd8ff262127d1dc86d0588971a" dependencies = [ "backtrace", - "bincode", + "enumset", "lazy_static", + "loupe", "memmap2", "more-asserts", "rustc-demangle", "serde", "serde_bytes", - "target-lexicon", + "target-lexicon 0.12.2", "thiserror", "wasmer-compiler", "wasmer-types", @@ -3267,51 +3376,54 @@ dependencies = [ ] [[package]] -name = "wasmer-engine-jit" -version = "1.0.2" +name = "wasmer-engine-dylib" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26770be802888011b4a3072f2a282fc2faa68aa48c71b3db6252a3937a85f3da" +checksum = "8dd5b7a74731e1dcccaf10a8ff5f72216c82f12972ce17cc81c6caa1afff75ea" dependencies = [ - "bincode", - "cfg-if 0.1.10", - "region", + "cfg-if 1.0.0", + "enumset", + "leb128", + "libloading", + "loupe", + "rkyv", "serde", - "serde_bytes", + "tempfile", + "tracing", "wasmer-compiler", "wasmer-engine", + "wasmer-object", "wasmer-types", "wasmer-vm", - "winapi", + "which", ] [[package]] -name = "wasmer-engine-native" -version = "1.0.2" +name = "wasmer-engine-universal" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb4083a6c69f2cd4b000b82a80717f37c6cc2e536aee3a8ffe9af3edc276a8b" +checksum = "dfeae8d5b825ad7abcf9a34e66eb11e1507b21020efe7bbf9897e3dd8d7869e2" dependencies = [ - "bincode", - "cfg-if 0.1.10", + "cfg-if 1.0.0", + "enumset", "leb128", - "libloading 0.6.7", - "serde", - "tempfile", - "tracing", + "loupe", + "region", + "rkyv", "wasmer-compiler", "wasmer-engine", - "wasmer-object", "wasmer-types", "wasmer-vm", - "which", + "winapi", ] [[package]] name = "wasmer-object" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf8e0c12b82ff81ebecd30d7e118be5fec871d6de885a90eeb105df0a769a7b" +checksum = "c3d4714e4f3bdc3b2157c24284417d19cd99de036da31d00ec5664712dcb72f7" dependencies = [ - "object 0.22.0", + "object", "thiserror", "wasmer-compiler", "wasmer-types", @@ -3319,29 +3431,44 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f4ac28c2951cd792c18332f03da523ed06b170f5cf6bb5b1bdd7e36c2a8218" +checksum = "434e1c0177da0a74ecca90b2aa7d5e86198260f07e8ba83be89feb5f0a4aeead" dependencies = [ - "cranelift-entity", + "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 = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7635ba0b6d2fd325f588d69a950ad9fa04dddbf6ad08b6b2a183146319bf6ae" +checksum = "cc8f964ebba70d9f81340228b98a164782591f00239fc7f01e1b67afcf0e0156" dependencies = [ "backtrace", "cc", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "indexmap", "libc", + "loupe", "memoffset", "more-asserts", "region", + "rkyv", "serde", "thiserror", "wasmer-types", @@ -3350,35 +3477,45 @@ dependencies = [ [[package]] name = "wasmer-wasi" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf3ec2503b6b12034cf066deb923805952f821223b881acb746df83e284c03e" +checksum = "0c2b1d981ad312dac6e74a41a35b9bca41a6d1157c3e6a575fb1041e4b516610" dependencies = [ - "bincode", - "byteorder", + "cfg-if 1.0.0", "generational-arena", - "getrandom 0.2.2", + "getrandom 0.2.4", "libc", - "serde", "thiserror", - "time", "tracing", - "typetag", + "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.65.0" +version = "0.78.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc2fe6350834b4e528ba0901e7aa405d78b89dc1fa3145359eb4de0e323fcf" +checksum = "52144d4c78e5cf8b055ceab8e5fa22814ce4315d6002ad32cfd914f37c12fd65" [[package]] name = "web-sys" -version = "0.3.48" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b" +checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" dependencies = [ "js-sys", "wasm-bindgen", @@ -3386,9 +3523,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.4" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ "ring", "untrusted", @@ -3396,30 +3533,22 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.0" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" +checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449" dependencies = [ "webpki", ] -[[package]] -name = "wepoll-sys" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" -dependencies = [ - "cc", -] - [[package]] name = "which" -version = "4.0.2" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" dependencies = [ + "either", + "lazy_static", "libc", - "thiserror", ] [[package]] @@ -3438,6 +3567,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -3461,18 +3599,18 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.2.0" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36" +checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.0.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" +checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" dependencies = [ "proc-macro2", "quote", @@ -3482,13 +3620,13 @@ dependencies = [ [[package]] name = "zip" -version = "0.5.6" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58287c28d78507f5f91f2a4cf1e8310e2c76fd4c6932f93ac60fd1ceb402db7d" +checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" dependencies = [ + "byteorder", "bzip2", "crc32fast", "flate2", - "podio", - "time", + "thiserror", ] diff --git a/Cargo.toml b/Cargo.toml index 90a37c1cb..d133b40c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,12 +8,14 @@ members = [ "libcraft/macros", "libcraft/particles", "libcraft/text", + "libcraft/inventory", # Quill "quill/sys-macros", "quill/sys", "quill/common", "quill/api", + "quill/api/plugin-macro", "quill/plugin-format", "quill/cargo-quill", @@ -29,7 +31,6 @@ members = [ # Feather (common and server) "feather/utils", - "feather/generated", "feather/blocks", "feather/blocks/generator", "feather/base", @@ -43,7 +44,7 @@ members = [ "feather/server", # Other - "tools/proxy", + "proxy", ] # No longer need to use release for "development": diff --git a/README.md b/README.md index d6aa149ce..93f6f99ff 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,7 @@ A Minecraft server implementation written in Rust. -### Status - -The project is in an **early stage**. Many, many features are unimplemented. We welcome help from anyone willing to contribute! +__Note__: This project is currently inactive. Consider contributing to [`valence`](https://github.com/valence-rs/valence) instead. ### Supported Minecraft versions @@ -27,8 +25,8 @@ In the long term, Feather could be used on larger, more survival-like servers, w ### Ecosystem The Feather ecosystem consists of several repositories: -* [`libcraft`](https://github.com/feather-rs/libcraft), a set of Rust crates providing Minecraft functionality. -* [`quill`](https://github.com/feather-rs/quill), our work-in-progress plugin API. Quill plugins are written in Rust and compiled to WebAssembly. Feather runs them in a sandboxed WebAssembly VM. +* [`libcraft`](https://github.com/feather-rs/feather/tree/main/libcraft), a set of Rust crates providing Minecraft functionality. +* [`quill`](https://github.com/feather-rs/feather/tree/main/quill), our work-in-progress plugin API. Quill plugins are written in Rust and compiled to WebAssembly. Feather runs them in a sandboxed WebAssembly VM. * `feather`, the server software built on top of `libcraft` and `quill`. ### Performance diff --git a/feather/base/Cargo.toml b/feather/base/Cargo.toml index 79dc2c31e..a0bdcf549 100644 --- a/feather/base/Cargo.toml +++ b/feather/base/Cargo.toml @@ -7,23 +7,26 @@ edition = "2018" [dependencies] ahash = "0.4" anyhow = "1" -arrayvec = { version = "0.5", features = [ "serde" ] } +arrayvec = { version = "0.7", features = [ "serde" ] } bitflags = "1" bitvec = "0.21" blocks = { path = "../blocks", package = "feather-blocks" } byteorder = "1" -generated = { path = "../generated", package = "feather-generated" } 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-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" @@ -31,11 +34,9 @@ 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" - -[features] -proxy = [] diff --git a/feather/base/src/anvil/entity.rs b/feather/base/src/anvil/entity.rs index 72dc2acf1..d5239d6ca 100644 --- a/feather/base/src/anvil/entity.rs +++ b/feather/base/src/anvil/entity.rs @@ -1,5 +1,5 @@ use arrayvec::ArrayVec; -use generated::{Item, ItemStack}; +use libcraft_items::{Item, ItemStack, ItemStackBuilder}; use serde::ser::Error; use serde::{Deserialize, Serialize, Serializer}; use thiserror::Error; @@ -86,11 +86,11 @@ impl EntityData { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct BaseEntityData { #[serde(rename = "Pos")] - pub position: ArrayVec<[f64; 3]>, + pub position: ArrayVec, #[serde(rename = "Rotation")] - pub rotation: ArrayVec<[f32; 2]>, + pub rotation: ArrayVec, #[serde(rename = "Motion")] - pub velocity: ArrayVec<[f64; 3]>, + pub velocity: ArrayVec, } #[derive(Error, Debug, PartialEq, Eq)] @@ -219,8 +219,8 @@ where Some(nbt) }; Self { - count: stack.count as i8, - item: stack.item.name().to_owned(), + count: stack.count() as i8, + item: stack.item().name().to_owned(), nbt, } } @@ -235,12 +235,22 @@ pub struct ItemNbt { } impl ItemNbt { - /// Create an `ItemStack` of the specified item and amount, setting any nbt present. + /// Create an `ItemStack` of the specified item and amount, setting any NBT present. + /// + /// # Panics + /// Panics if `count` is zero. pub fn item_stack(nbt: &Option, item: Item, count: u8) -> ItemStack { - ItemStack { - count: count as u32, - item, - damage: nbt.as_ref().map(|n| n.damage).flatten().map(|x| x as u32), + match nbt { + Some(ItemNbt { + damage: Some(damage), + }) => ItemStackBuilder::with_item(item) + .count(count as u32) + .damage(*damage) + .into(), + + Some(ItemNbt { damage: None }) | None => { + ItemStackBuilder::with_item(item).count(count as u32).into() + } } } } @@ -252,7 +262,7 @@ where fn from(s: S) -> Self { let stack = s.borrow(); Self { - damage: stack.damage.map(|d| d as i32), + damage: stack.damage_taken().map(|d| d as i32), } } } diff --git a/feather/base/src/anvil/level.rs b/feather/base/src/anvil/level.rs index 3ac522fd2..b312e5de3 100644 --- a/feather/base/src/anvil/level.rs +++ b/feather/base/src/anvil/level.rs @@ -1,6 +1,7 @@ //! Implements level.dat file loading. -use generated::{Biome, Item}; +use libcraft_core::Biome; +use libcraft_items::Item; use serde::{Deserialize, Serialize}; use std::io::{Cursor, Read, Write}; use std::{collections::HashMap, fs::File}; @@ -163,7 +164,7 @@ impl LevelData { match self.generator_name.to_lowercase().as_str() { "default" => LevelGeneratorType::Default, "flat" => LevelGeneratorType::Flat, - "largeBiomes" => LevelGeneratorType::LargeBiomes, + "largebiomes" => LevelGeneratorType::LargeBiomes, "amplified" => LevelGeneratorType::Amplified, "buffet" => LevelGeneratorType::Buffet, "debug_all_block_states" => LevelGeneratorType::Debug, @@ -193,7 +194,7 @@ mod tests { assert!(!level.hardcore); assert!(level.initialized); assert_eq!(level.last_played, 1_560_968_104_655); - assert_eq!(level.raining, false); + assert!(!level.raining); assert_eq!(level.rain_time, 61872); assert_eq!(level.spawn_x, 0); assert_eq!(level.spawn_y, 70); diff --git a/feather/base/src/anvil/player.dat b/feather/base/src/anvil/player.dat index 5e37f39e3..11709a34c 100644 Binary files a/feather/base/src/anvil/player.dat and b/feather/base/src/anvil/player.dat differ diff --git a/feather/base/src/anvil/player.rs b/feather/base/src/anvil/player.rs index 65323fa83..c6389e82d 100644 --- a/feather/base/src/anvil/player.rs +++ b/feather/base/src/anvil/player.rs @@ -1,20 +1,26 @@ -use generated::{Item, ItemStack}; -use nbt::Value; -use serde::{Deserialize, Serialize}; +use libcraft_items::{Item, ItemStack}; 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 crate::inventory::*; use super::entity::{AnimalData, ItemNbt}; /// Represents the contents of a player data file. -#[derive(Default, Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PlayerData { // Inherit base entity data #[serde(flatten)] @@ -22,10 +28,31 @@ pub struct PlayerData { #[serde(rename = "playerGameType")] pub gamemode: i32, + #[serde(rename = "previousPlayerGameType")] + pub previous_gamemode: i32, #[serde(rename = "Inventory")] pub inventory: Vec, #[serde(rename = "SelectedItemSlot")] pub held_item: i32, + pub abilities: PlayerAbilities, +} + +/// Represents player's abilities (flying, invulnerability, speed, etc.) +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct PlayerAbilities { + #[serde(rename = "walkSpeed")] + pub walk_speed: WalkSpeed, + #[serde(rename = "flySpeed")] + pub fly_speed: CreativeFlyingSpeed, + #[serde(rename = "mayfly")] + pub may_fly: CanCreativeFly, + #[serde(rename = "flying")] + pub is_flying: CreativeFlying, + #[serde(rename = "mayBuild")] + pub may_build: CanBuild, + #[serde(rename = "instabuild")] + pub instabreak: Instabreak, + pub invulnerable: Invulnerable, } /// Represents a single inventory slot (including position index). @@ -43,19 +70,18 @@ pub struct InventorySlot { } impl InventorySlot { - /// Converts an `ItemStack` and network protocol index into an `InventorySlot`. - pub fn from_network_index(network: usize, stack: ItemStack) -> Option { - let slot = if SLOT_HOTBAR_OFFSET <= network && network < SLOT_HOTBAR_OFFSET + HOTBAR_SIZE { + /// Converts an [`ItemStack`] and network protocol index into an [`InventorySlot`]. + #[allow(clippy::manual_range_contains)] + pub fn from_network_index(index: usize, stack: &ItemStack) -> Option { + let slot = if SLOT_HOTBAR_OFFSET <= index && index < SLOT_HOTBAR_OFFSET + HOTBAR_SIZE { // Hotbar - (network - SLOT_HOTBAR_OFFSET) as i8 - } else if network == SLOT_OFFHAND { + (index - SLOT_HOTBAR_OFFSET) as i8 + } else if index == SLOT_OFFHAND { -106 - } else if SLOT_ARMOR_MIN <= network && network <= SLOT_ARMOR_MAX { - ((SLOT_ARMOR_MAX - network) + 100) as i8 - } else if SLOT_INVENTORY_OFFSET <= network - && network < SLOT_INVENTORY_OFFSET + INVENTORY_SIZE - { - network as i8 + } else if SLOT_ARMOR_MIN <= index && index <= SLOT_ARMOR_MAX { + ((SLOT_ARMOR_MAX - index) + 100) as i8 + } else if SLOT_INVENTORY_OFFSET <= index && index < SLOT_INVENTORY_OFFSET + INVENTORY_SIZE { + index as i8 } else { return None; }; @@ -63,8 +89,8 @@ impl InventorySlot { Some(Self::from_inventory_index(slot, stack)) } - /// Converts an `ItemStack` and inventory position index into an `InventorySlot`. - pub fn from_inventory_index(slot: i8, stack: ItemStack) -> Self { + /// Converts an [`ItemStack`] and inventory position index into an [`InventorySlot`]. + pub fn from_inventory_index(slot: i8, stack: &ItemStack) -> Self { let nbt = stack.clone().into(); let nbt = if nbt == Default::default() { None @@ -72,9 +98,9 @@ impl InventorySlot { Some(nbt) }; Self { - count: stack.count as i8, + count: stack.count() as i8, slot, - item: stack.item.name().to_owned(), + item: stack.item().name().to_owned(), nbt, } } @@ -159,14 +185,17 @@ fn file_path(world_dir: &Path, uuid: Uuid) -> PathBuf { #[cfg(test)] mod tests { - use super::*; + use std::collections::HashMap; + use std::io::Cursor; + + use num_traits::ToPrimitive; + use crate::{ inventory::{SLOT_ARMOR_CHEST, SLOT_ARMOR_FEET, SLOT_ARMOR_HEAD, SLOT_ARMOR_LEGS}, Gamemode, }; - use num_traits::ToPrimitive; - use std::collections::HashMap; - use std::io::Cursor; + + use super::*; #[test] fn test_deserialize_player() { @@ -174,6 +203,10 @@ mod tests { let player: PlayerData = nbt::from_gzip_reader(&mut cursor).unwrap(); assert_eq!(player.gamemode, Gamemode::Creative.to_i32().unwrap()); + assert_eq!( + player.previous_gamemode, + Gamemode::Spectator.to_i32().unwrap() + ); assert_eq!(player.inventory[0].item, "minecraft:diamond_shovel"); assert_eq!(player.inventory[0].nbt, Some(ItemNbt { damage: Some(3) })); } @@ -188,8 +221,8 @@ mod tests { }; let item_stack: ItemStack = slot.into(); - assert_eq!(item_stack.item, Item::Feather); - assert_eq!(item_stack.count, 1); + assert_eq!(item_stack.item(), Item::Feather); + assert_eq!(item_stack.count(), 1); } #[test] @@ -202,9 +235,9 @@ mod tests { }; let item_stack: ItemStack = slot.into(); - assert_eq!(item_stack.item, Item::DiamondAxe); - assert_eq!(item_stack.count, 1); - assert_eq!(item_stack.damage, Some(42)); + assert_eq!(item_stack.item(), Item::DiamondAxe); + assert_eq!(item_stack.count(), 1); + assert_eq!(item_stack.damage_taken(), Some(42)); } #[test] @@ -217,7 +250,7 @@ mod tests { }; let item_stack: ItemStack = slot.into(); - assert_eq!(item_stack.item, Item::Air); + assert_eq!(item_stack.item(), Item::Air); } #[test] @@ -251,7 +284,10 @@ mod tests { }; assert_eq!(slot.convert_index().unwrap(), expected); assert_eq!( - InventorySlot::from_network_index(expected, ItemStack::new(Item::Stone, 1)), + InventorySlot::from_network_index( + expected, + &ItemStack::new(Item::Stone, 1).unwrap() + ), Some(slot), ); } diff --git a/feather/base/src/anvil/region.rs b/feather/base/src/anvil/region.rs index cbc50bca4..c1901b53c 100644 --- a/feather/base/src/anvil/region.rs +++ b/feather/base/src/anvil/region.rs @@ -10,7 +10,7 @@ use super::{block_entity::BlockEntityData, entity::EntityData}; use bitvec::{bitvec, vec::BitVec}; use blocks::BlockId; use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; -use generated::Biome; +use libcraft_core::Biome; use serde::{Deserialize, Serialize}; use std::borrow::Cow; use std::collections::BTreeMap; @@ -243,6 +243,14 @@ impl RegionHandle { Ok((chunk, level.entities.clone(), level.block_entities.clone())) } + /// Checks if the specified chunk position is generated in this region. + /// # Panics + /// Panics if the specified chunk position is not within this + /// region file. + pub fn check_chunk_existence(&self, pos: ChunkPosition) -> bool { + self.header.location_for_chunk(pos).exists() + } + /// Saves the given chunk to this region file. The header will be updated /// accordingly and saved as well. /// @@ -412,7 +420,7 @@ fn chunk_to_chunk_root( .map(|(y, mut section)| { let palette = convert_palette(&mut section); LevelSection { - y: y as i8, + y: (y as i8) - 1, states: section .blocks() .data() diff --git a/feather/base/src/block.rs b/feather/base/src/block.rs new file mode 100644 index 000000000..be84a2049 --- /dev/null +++ b/feather/base/src/block.rs @@ -0,0 +1,163 @@ +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 index fc6b483c9..8568ea366 100644 --- a/feather/base/src/chunk.rs +++ b/feather/base/src/chunk.rs @@ -1,13 +1,13 @@ use std::usize; use ::blocks::BlockId; -use generated::Biome; +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 = 14; +pub const GLOBAL_BITS_PER_BLOCK: u8 = 15; /// The minimum bits per block allowed when /// using a section palette. @@ -126,6 +126,7 @@ impl Chunk { /// 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)?; @@ -253,13 +254,13 @@ impl Chunk { } /// Gets the chunk section at index `y`. - pub fn section(&self, y: usize) -> Option<&ChunkSection> { - self.sections.get(y)?.as_ref() + 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: usize) -> Option<&mut ChunkSection> { - self.sections.get_mut(y)?.as_mut() + 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`. @@ -374,6 +375,7 @@ impl ChunkSection { #[cfg(test)] mod tests { use super::*; + use crate::HIGHEST_ID; #[test] fn chunk_new() { @@ -417,7 +419,7 @@ mod tests { chunk.set_block_at(0, 0, 0, BlockId::andesite()); assert_eq!(chunk.block_at(0, 0, 0).unwrap(), BlockId::andesite()); - assert!(chunk.section(1).is_some()); + assert!(chunk.section(0).is_some()); } #[test] @@ -470,7 +472,7 @@ mod tests { assert_eq!(chunk.block_at(x, (section * 16) + y, z), Some(block)); if counter != 0 { assert!( - chunk.section(section + 1).is_some(), + chunk.section(section as isize).is_some(), "Section {} failed", section ); @@ -483,14 +485,17 @@ mod tests { // Go through again to be sure for section in 0..16 { - assert!(chunk.section(section + 1).is_some()); + 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 * 16) + y, z), Some(block)); - assert!(chunk.section(section + 1).is_some()); + assert_eq!( + chunk.block_at(x, (section as usize * 16) + y, z), + Some(block) + ); + assert!(chunk.section(section).is_some()); counter += 1; } } @@ -604,4 +609,10 @@ mod tests { } } } + + #[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 index 44828b566..f1f1536d5 100644 --- a/feather/base/src/chunk/biome_store.rs +++ b/feather/base/src/chunk/biome_store.rs @@ -1,4 +1,4 @@ -use generated::Biome; +use libcraft_core::Biome; use crate::{CHUNK_HEIGHT, CHUNK_WIDTH}; @@ -14,7 +14,7 @@ pub const BIOMES_PER_CHUNK: usize = (CHUNK_WIDTH / BIOME_SAMPLE_RATE) /// biome grid sampled in 4x4x4 blocks. We /// do the same, though right now Feather /// only uses 2D biomes. -#[derive(Debug, Clone)] +#[derive(Debug, Copy, Clone)] pub struct BiomeStore { biomes: [Biome; BIOMES_PER_CHUNK], } @@ -59,6 +59,10 @@ impl BiomeStore { 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 diff --git a/feather/base/src/chunk/blocks.rs b/feather/base/src/chunk/blocks.rs index 3cad2db02..3fefe1258 100644 --- a/feather/base/src/chunk/blocks.rs +++ b/feather/base/src/chunk/blocks.rs @@ -51,7 +51,6 @@ impl BlockStore { &self.blocks } - #[cfg(feature = "proxy")] pub fn data_mut(&mut self) -> &mut PackedArray { &mut self.blocks } @@ -60,7 +59,6 @@ impl BlockStore { self.palette.as_ref() } - #[cfg(feature = "proxy")] pub fn palette_mut(&mut self) -> Option<&mut Palette> { self.palette.as_mut() } @@ -83,7 +81,6 @@ impl BlockStore { self.air_block_count } - #[cfg(feature = "proxy")] pub fn set_air_blocks(&mut self, new_value: u32) { self.air_block_count = new_value; } diff --git a/feather/base/src/chunk/heightmap.rs b/feather/base/src/chunk/heightmap.rs index 83c3cedda..14c954233 100644 --- a/feather/base/src/chunk/heightmap.rs +++ b/feather/base/src/chunk/heightmap.rs @@ -142,7 +142,6 @@ where self.heights.set(index, height as u64); } - #[cfg(feature = "proxy")] pub fn set_height_index(&mut self, index: usize, height: i64) { self.heights.as_u64_mut_vec()[index] = height as u64; } diff --git a/feather/base/src/chunk/light.rs b/feather/base/src/chunk/light.rs index ded6beb87..433b01a4e 100644 --- a/feather/base/src/chunk/light.rs +++ b/feather/base/src/chunk/light.rs @@ -16,14 +16,13 @@ impl Default for LightStore { } impl LightStore { - /// Creates a `LightStore` with all light set to 15. + /// 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), }; - fill_with_default_light(&mut this.block_light); - fill_with_default_light(&mut this.sky_light); + this.sky_light.fill(15); this } @@ -73,9 +72,3 @@ impl LightStore { &self.sky_light } } - -fn fill_with_default_light(arr: &mut PackedArray) { - for i in 0..arr.len() { - arr.set(i, 15); - } -} diff --git a/feather/base/src/chunk/packed_array.rs b/feather/base/src/chunk/packed_array.rs index 313882821..f1d3eae8c 100644 --- a/feather/base/src/chunk/packed_array.rs +++ b/feather/base/src/chunk/packed_array.rs @@ -166,7 +166,6 @@ impl PackedArray { self.bits_per_value } - #[cfg(feature = "proxy")] pub fn set_bits_per_value(&mut self, new_value: usize) { self.bits_per_value = new_value; } @@ -176,7 +175,6 @@ impl PackedArray { &self.bits } - #[cfg(feature = "proxy")] pub fn as_u64_mut_vec(&mut self) -> &mut Vec { &mut self.bits } diff --git a/feather/base/src/chunk/palette.rs b/feather/base/src/chunk/palette.rs index 1b027a395..97a05008d 100644 --- a/feather/base/src/chunk/palette.rs +++ b/feather/base/src/chunk/palette.rs @@ -17,7 +17,7 @@ impl Default for Palette { } } -#[allow(clippy::clippy::len_without_is_empty)] // palette is never empty +#[allow(clippy::len_without_is_empty)] // palette is never empty impl Palette { /// Creates an empty palette. pub fn new() -> Self { diff --git a/feather/base/src/chunk_lock.rs b/feather/base/src/chunk_lock.rs new file mode 100644 index 000000000..033281d09 --- /dev/null +++ b/feather/base/src/chunk_lock.rs @@ -0,0 +1,134 @@ +use std::sync::{ + atomic::{AtomicBool, Ordering}, + Arc, +}; + +use crate::Chunk; +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)] +pub struct ChunkLock { + loaded: AtomicBool, + lock: RwLock, +} +impl ChunkLock { + pub fn new(chunk: Chunk, loaded: bool) -> Self { + Self { + loaded: AtomicBool::new(loaded), + 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) { + // FIXME: Decide what to do when unloading an unloaded chunk + } + if self.lock.try_read().is_none() { + // Locking fails when someone else already owns a write lock + bail!("Cannot unload chunk because it is locked as writable!") + } + 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. + /// 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. + pub fn read(&self) -> RwLockReadGuard { + self.lock.read() + } + /// Locks this chunk with exclusive write acccess. 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() { + self.lock.try_write() + } else { + 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> { + if self.is_loaded() { + Some(self.lock.write()) + } else { + None + } + } + + pub fn is_locked(&self) -> bool { + self.lock.is_locked() + } +} + +#[cfg(test)] +mod tests { + 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) + } + #[test] + fn normal_function() { + let lock = empty_lock(0, 0, true); + for _ in 0..100 { + // It should be possible to lock in any way + if rand::random::() { + let _guard = lock.try_read().unwrap(); + } else { + let _guard = lock.try_write().unwrap(); + } + } + } + #[test] + fn cannot_write_unloaded() { + let lock = empty_lock(0, 0, false); + assert!(lock.try_write().is_none()) + } + #[test] + fn can_read_unloaded() { + let lock = empty_lock(0, 0, false); + assert!(lock.try_read().is_some()) + } + #[test] + fn multithreaded() { + let lock = Arc::new(empty_lock(0, 0, true)); + let mut handles: Vec> = vec![]; + for _ in 0..20 { + let l = lock.clone(); + handles.push(spawn(move || { + while let Some(guard) = l.write() { + sleep(Duration::from_millis(10)); + drop(guard) + } + })) + } + sleep(Duration::from_millis(1000)); + lock.set_unloaded().unwrap_or(()); // Discard error + for h in handles { + h.join().unwrap() // Wait for all threads to stop + } + } +} diff --git a/feather/base/src/lib.rs b/feather/base/src/lib.rs index fe2337332..730d4c51a 100644 --- a/feather/base/src/lib.rs +++ b/feather/base/src/lib.rs @@ -10,15 +10,23 @@ 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 generated::{Area, Biome, EntityKind, Inventory, Item, ItemStack}; +pub use chunk_lock::*; + pub use libcraft_blocks::{BlockKind, BlockState}; -pub use libcraft_core::{position, vec3, BlockPosition, ChunkPosition, Gamemode, Position, Vec3d}; +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)] diff --git a/feather/base/src/metadata.rs b/feather/base/src/metadata.rs index 248ddb3d7..92b62b852 100644 --- a/feather/base/src/metadata.rs +++ b/feather/base/src/metadata.rs @@ -2,9 +2,9 @@ //! metadata format. See //! for the specification. -use crate::{BlockPosition, Direction}; +use crate::{Direction, ValidBlockPosition}; use bitflags::bitflags; -use generated::ItemStack; +use libcraft_items::InventorySlot; use std::collections::BTreeMap; use uuid::Uuid; @@ -20,7 +20,7 @@ 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_ITEM_SLOT: u8 = 6; +pub const META_INDEX_POSE: u8 = 6; pub const META_INDEX_FALLING_BLOCK_SPAWN_POSITION: u8 = 7; @@ -44,17 +44,17 @@ pub enum MetaEntry { String(String), Chat(String), OptChat(OptChat), - Slot(Option), + Slot(InventorySlot), Boolean(bool), Rotation(f32, f32, f32), - Position(BlockPosition), - OptPosition(Option), + Position(ValidBlockPosition), + OptPosition(Option), Direction(Direction), OptUuid(OptUuid), OptBlockId(Option), Nbt(nbt::Blob), Particle, - VillagerData, + VillagerData(i32, i32, i32), OptVarInt(OptVarInt), Pose(i32), } @@ -78,13 +78,37 @@ impl MetaEntry { MetaEntry::OptBlockId(_) => 13, MetaEntry::Nbt(_) => 14, MetaEntry::Particle => 15, - MetaEntry::VillagerData => 16, + MetaEntry::VillagerData(_, _, _) => 16, MetaEntry::OptVarInt(_) => 17, MetaEntry::Pose(_) => 18, } } } +pub enum Pose { + Standing, + FallFlying, + Sleeping, + Swimming, + SpinAttack, + Sneaking, + Dying, +} + +impl ToMetaEntry for Pose { + fn to_meta_entry(&self) -> MetaEntry { + MetaEntry::Pose(match self { + Self::Standing => 0, + Self::FallFlying => 1, + Self::Sleeping => 2, + Self::Swimming => 3, + Self::SpinAttack => 4, + Self::Sneaking => 5, + Self::Dying => 6, + }) + } +} + pub trait ToMetaEntry { fn to_meta_entry(&self) -> MetaEntry; } @@ -119,7 +143,7 @@ impl ToMetaEntry for OptChat { } } -impl ToMetaEntry for Option { +impl ToMetaEntry for InventorySlot { fn to_meta_entry(&self) -> MetaEntry { MetaEntry::Slot(self.clone()) } @@ -131,7 +155,7 @@ impl ToMetaEntry for bool { } } -impl ToMetaEntry for BlockPosition { +impl ToMetaEntry for ValidBlockPosition { fn to_meta_entry(&self) -> MetaEntry { MetaEntry::Position(*self) } diff --git a/feather/blocks/Cargo.toml b/feather/blocks/Cargo.toml index 470369797..12a8835a9 100644 --- a/feather/blocks/Cargo.toml +++ b/feather/blocks/Cargo.toml @@ -7,9 +7,9 @@ edition = "2018" [dependencies] anyhow = "1" bincode = "1" -feather-generated = { path = "../generated" } 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/src/lib.rs b/feather/blocks/generator/src/lib.rs index 8405394eb..b5b8fbd84 100644 --- a/feather/blocks/generator/src/lib.rs +++ b/feather/blocks/generator/src/lib.rs @@ -43,7 +43,7 @@ struct Property { /// 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, + _name_camel_case: Ident, /// The kind of this property. kind: PropertyKind, /// Possible values of this property. diff --git a/feather/blocks/generator/src/load.rs b/feather/blocks/generator/src/load.rs index 232a6e3ea..10bd98909 100644 --- a/feather/blocks/generator/src/load.rs +++ b/feather/blocks/generator/src/load.rs @@ -90,7 +90,7 @@ impl PropertyStore { 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), + 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. @@ -122,7 +122,7 @@ impl PropertyStore { map.insert( new_name.to_owned(), - Self::prop_from_possible_values_and_name(&new_name, &name, possible_values), + Self::prop_from_possible_values_and_name(new_name, name, possible_values), ); } } @@ -146,7 +146,7 @@ impl PropertyStore { Property { name: ident(name), real_name: real_name.to_owned(), - name_camel_case: ident(name.to_camel_case()), + _name_camel_case: ident(name.to_camel_case()), kind: guess_property_kind(&possible_values, &name.to_camel_case()), possible_values, } diff --git a/feather/blocks/src/categories.rs b/feather/blocks/src/categories.rs index 7529310e3..16920fddf 100644 --- a/feather/blocks/src/categories.rs +++ b/feather/blocks/src/categories.rs @@ -1,5 +1,5 @@ use crate::{BlockId, BlockKind}; -use feather_generated::SimplifiedBlockKind; +use libcraft_blocks::SimplifiedBlockKind; #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum PlacementType { diff --git a/feather/blocks/src/lib.rs b/feather/blocks/src/lib.rs index 5716f92c3..f8cf91187 100644 --- a/feather/blocks/src/lib.rs +++ b/feather/blocks/src/lib.rs @@ -1,9 +1,8 @@ +pub use libcraft_blocks::{BlockKind, SimplifiedBlockKind}; use num_traits::FromPrimitive; use std::convert::TryFrom; use thiserror::Error; -pub use feather_generated::{BlockKind, SimplifiedBlockKind}; - pub mod categories; mod directions; #[allow(warnings)] @@ -21,7 +20,7 @@ static VANILLA_ID_TABLE: Lazy>> = Lazy::new(|| { bincode::deserialize(bytes).expect("failed to deserialize generated vanilla ID table (bincode)") }); -const HIGHEST_ID: u16 = 8596; +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]; @@ -171,6 +170,14 @@ mod tests { 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); diff --git a/feather/common/Cargo.toml b/feather/common/Cargo.toml index 9c14dc9f6..a371549d5 100644 --- a/feather/common/Cargo.toml +++ b/feather/common/Cargo.toml @@ -11,7 +11,6 @@ base = { path = "../base", package = "feather-base" } blocks = { path = "../blocks", package = "feather-blocks" } ecs = { path = "../ecs", package = "feather-ecs" } flume = "0.10" -generated = { path = "../generated", package = "feather-generated" } itertools = "0.10" log = "0.4" parking_lot = "0.11" @@ -20,3 +19,8 @@ smartstring = "0.2" 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" +worldgen = { path = "../worldgen", package = "feather-worldgen" } +rand = "0.8" \ No newline at end of file diff --git a/feather/common/src/chunk/cache.rs b/feather/common/src/chunk/cache.rs new file mode 100644 index 000000000..c07908968 --- /dev/null +++ b/feather/common/src/chunk/cache.rs @@ -0,0 +1,152 @@ +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 similarity index 96% rename from feather/common/src/chunk_entities.rs rename to feather/common/src/chunk/entities.rs index 0b666a392..02a2b0db4 100644 --- a/feather/common/src/chunk_entities.rs +++ b/feather/common/src/chunk/entities.rs @@ -1,12 +1,10 @@ use ahash::AHashMap; use base::{ChunkPosition, Position}; use ecs::{Entity, SysResult, SystemExecutor}; +use quill_common::events::{EntityCreateEvent, EntityRemoveEvent}; use utils::vec_remove_item; -use crate::{ - events::{ChunkCrossEvent, EntityCreateEvent, EntityRemoveEvent}, - Game, -}; +use crate::{events::ChunkCrossEvent, Game}; pub fn register(systems: &mut SystemExecutor) { systems.add_system(update_chunk_entities); diff --git a/feather/common/src/chunk_loading.rs b/feather/common/src/chunk/loading.rs similarity index 94% rename from feather/common/src/chunk_loading.rs rename to feather/common/src/chunk/loading.rs index e43463406..7e52d37fa 100644 --- a/feather/common/src/chunk_loading.rs +++ b/feather/common/src/chunk/loading.rs @@ -9,12 +9,10 @@ use std::{ use ahash::AHashMap; use base::ChunkPosition; use ecs::{Entity, SysResult, SystemExecutor}; +use quill_common::events::EntityRemoveEvent; use utils::vec_remove_item; -use crate::{ - events::{EntityRemoveEvent, ViewUpdateEvent}, - Game, -}; +use crate::{chunk::worker::LoadRequest, events::ViewUpdateEvent, Game}; pub fn register(game: &mut Game, systems: &mut SystemExecutor) { game.insert_resource(ChunkLoadState::default()); @@ -131,7 +129,7 @@ fn update_tickets_for_players(game: &mut Game, state: &mut ChunkLoadState) -> Sy // Load if needed if !game.world.is_chunk_loaded(new_chunk) && !game.world.is_chunk_loading(new_chunk) { - game.world.queue_chunk_load(new_chunk); + game.world.queue_chunk_load(LoadRequest { pos: new_chunk }); } } } @@ -155,8 +153,9 @@ fn unload_chunks(game: &mut Game, state: &mut ChunkLoadState) -> SysResult { continue; } - game.world.unload_chunk(unload.pos); + game.world.unload_chunk(unload.pos)?; } + game.world.cache.purge_unused(); Ok(()) } @@ -172,6 +171,5 @@ fn remove_dead_entities(game: &mut Game, state: &mut ChunkLoadState) -> SysResul /// 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); - Ok(()) + game.world.load_chunks(&mut game.ecs) } diff --git a/feather/common/src/chunk/mod.rs b/feather/common/src/chunk/mod.rs new file mode 100644 index 000000000..e1c180383 --- /dev/null +++ b/feather/common/src/chunk/mod.rs @@ -0,0 +1,4 @@ +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 new file mode 100644 index 000000000..85f4d7229 --- /dev/null +++ b/feather/common/src/chunk/worker.rs @@ -0,0 +1,115 @@ +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/player.rs b/feather/common/src/entities/player.rs index 4f62d4a48..a8cc7443a 100644 --- a/feather/common/src/entities/player.rs +++ b/feather/common/src/entities/player.rs @@ -2,7 +2,7 @@ use anyhow::bail; use base::EntityKind; use ecs::{EntityBuilder, SysResult}; use quill_common::{ - components::{CreativeFlying, Sneaking}, + components::{CreativeFlying, Sneaking, Sprinting}, entities::Player, }; @@ -12,6 +12,7 @@ pub fn build_default(builder: &mut EntityBuilder) { .add(Player) .add(CreativeFlying(false)) .add(Sneaking(false)) + .add(Sprinting(false)) .add(EntityKind::Player); } @@ -24,10 +25,6 @@ impl HotbarSlot { Self(id) } - pub fn default() -> Self { - Self(0) - } - pub fn get(&self) -> usize { self.0 } diff --git a/feather/common/src/events.rs b/feather/common/src/events.rs index b1ee3422c..114540089 100644 --- a/feather/common/src/events.rs +++ b/feather/common/src/events.rs @@ -1,7 +1,4 @@ -use std::sync::Arc; - -use base::{Chunk, ChunkPosition}; -use parking_lot::RwLock; +use base::{ChunkHandle, ChunkPosition}; use crate::view::View; @@ -11,10 +8,6 @@ mod plugin_message; pub use block_change::BlockChangeEvent; pub use plugin_message::PluginMessageEvent; -/// Triggered when a player joins the `Game`. -#[derive(Debug)] -pub struct PlayerJoinEvent; - /// Event triggered when a player changes their `View`, /// meaning they crossed into a new chunk. #[derive(Debug)] @@ -57,7 +50,7 @@ pub struct ChunkCrossEvent { #[derive(Debug)] pub struct ChunkLoadEvent { pub position: ChunkPosition, - pub chunk: Arc>, + pub chunk: ChunkHandle, } /// Triggered when an error occurs while loading a chunk. @@ -65,14 +58,3 @@ pub struct ChunkLoadEvent { pub struct ChunkLoadFailEvent { pub position: ChunkPosition, } - -/// Triggered when an entity is removed from the world. -/// -/// The entity will remain alive for one tick after it is -/// destroyed to allow systems to observe this event. -#[derive(Debug)] -pub struct EntityRemoveEvent; - -/// Triggered when an entity is added into the world. -#[derive(Debug)] -pub struct EntityCreateEvent; diff --git a/feather/common/src/events/block_change.rs b/feather/common/src/events/block_change.rs index c6041a831..bb92ba52d 100644 --- a/feather/common/src/events/block_change.rs +++ b/feather/common/src/events/block_change.rs @@ -1,8 +1,8 @@ -use std::iter; +use std::{convert::TryInto, iter}; use base::{ chunk::{SECTION_HEIGHT, SECTION_VOLUME}, - BlockPosition, ChunkPosition, + BlockPosition, ChunkPosition, ValidBlockPosition, }; use itertools::Either; @@ -18,7 +18,7 @@ pub struct BlockChangeEvent { impl BlockChangeEvent { /// Creates an event affecting a single block. - pub fn single(pos: BlockPosition) -> Self { + pub fn single(pos: ValidBlockPosition) -> Self { Self { changes: BlockChanges::Single { pos }, } @@ -42,7 +42,7 @@ impl BlockChangeEvent { } /// Returns an iterator over block positions affected by this block change. - pub fn iter_changed_blocks(&self) -> impl Iterator + '_ { + pub fn iter_changed_blocks(&self) -> impl Iterator + '_ { match &self.changes { BlockChanges::Single { pos } => Either::Left(iter::once(*pos)), BlockChanges::FillChunkSection { chunk, section } => { @@ -60,7 +60,7 @@ impl BlockChangeEvent { ) -> impl Iterator + '_ { match &self.changes { BlockChanges::Single { pos } => { - iter::once((pos.chunk(), pos.y as usize / SECTION_HEIGHT, 1)) + iter::once((pos.chunk(), pos.y() as usize / SECTION_HEIGHT, 1)) } BlockChanges::FillChunkSection { chunk, section } => { iter::once((*chunk, *section as usize, SECTION_VOLUME)) @@ -69,7 +69,10 @@ impl BlockChangeEvent { } } -fn iter_section_blocks(chunk: ChunkPosition, section: u32) -> impl Iterator { +fn iter_section_blocks( + chunk: ChunkPosition, + section: u32, +) -> impl Iterator { (0..16) .flat_map(|x| (0..16).map(move |y| (x, y))) .flat_map(|(x, y)| (0..16).map(move |z| (x, y, z))) @@ -77,14 +80,16 @@ fn iter_section_blocks(chunk: ChunkPosition, section: u32) -> impl Iterator>(), vec![pos]); @@ -123,9 +128,9 @@ mod tests { #[test] fn test_iter_section_blocks() { - let blocks: Vec = + let blocks: Vec = iter_section_blocks(ChunkPosition::new(-1, -2), 5).collect(); - let unique_blocks: AHashSet = blocks.iter().copied().collect(); + let unique_blocks: AHashSet = blocks.iter().copied().collect(); assert_eq!(blocks.len(), unique_blocks.len()); assert_eq!(blocks.len(), SECTION_VOLUME); @@ -134,7 +139,7 @@ mod tests { for y in 80..96 { for z in -32..-16 { assert!( - unique_blocks.contains(&BlockPosition::new(x, y, z)), + unique_blocks.contains(&BlockPosition::new(x, y, z).try_into().unwrap()), "{}, {}, {}", x, y, diff --git a/feather/common/src/game.rs b/feather/common/src/game.rs index db856e010..64e6bf87d 100644 --- a/feather/common/src/game.rs +++ b/feather/common/src/game.rs @@ -1,16 +1,17 @@ use std::{cell::RefCell, mem, rc::Rc, sync::Arc}; -use base::{BlockId, BlockPosition, ChunkPosition, Position, Text, Title}; +use base::{BlockId, ChunkPosition, Position, Text, Title, ValidBlockPosition}; use ecs::{ Ecs, Entity, EntityBuilder, HasEcs, HasResources, NoSuchEntity, 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, EntityCreateEvent, EntityRemoveEvent, PlayerJoinEvent}, + chunk::entities::ChunkEntities, + events::BlockChangeEvent, ChatBox, World, }; @@ -104,7 +105,7 @@ impl Game { self.entity_spawn_callbacks.push(Box::new(callback)); } - /// Creates an emtpy entity builder to create entities in + /// Creates an empty entity builder to create entities in /// the ecs world. pub fn create_empty_entity_builder(&mut self) -> EntityBuilder { mem::take(&mut self.entity_builder) @@ -181,14 +182,14 @@ impl Game { } /// Gets the block at the given position. - pub fn block(&self, pos: BlockPosition) -> Option { + pub fn block(&self, pos: ValidBlockPosition) -> Option { self.world.block_at(pos) } /// Sets the block at the given position. /// /// Triggers necessary `BlockChangeEvent`s. - pub fn set_block(&mut self, pos: BlockPosition, block: BlockId) -> bool { + 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)); @@ -226,7 +227,7 @@ impl Game { /// Breaks the block at the given position, propagating any /// necessary block updates. - pub fn break_block(&mut self, pos: BlockPosition) -> bool { + pub fn break_block(&mut self, pos: ValidBlockPosition) -> bool { self.set_block(pos, BlockId::air()) } } diff --git a/feather/common/src/lib.rs b/feather/common/src/lib.rs index ad70d0b70..9f9e7348a 100644 --- a/feather/common/src/lib.rs +++ b/feather/common/src/lib.rs @@ -19,15 +19,12 @@ pub use window::Window; pub mod events; -pub mod world_source; +pub mod chunk; +mod region_worker; pub mod world; pub use world::World; -mod chunk_loading; - -mod chunk_entities; - pub mod chat; pub use chat::ChatBox; @@ -38,8 +35,8 @@ pub mod interactable; /// 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); + chunk::loading::register(game, systems); + chunk::entities::register(systems); interactable::register(game); game.add_entity_spawn_callback(entities::add_entity_components); diff --git a/feather/common/src/world_source/region.rs b/feather/common/src/region_worker.rs similarity index 61% rename from feather/common/src/world_source/region.rs rename to feather/common/src/region_worker.rs index 4f1ec64e6..dac33c985 100644 --- a/feather/common/src/world_source/region.rs +++ b/feather/common/src/region_worker.rs @@ -5,45 +5,13 @@ use std::{ }; use ahash::AHashMap; -use base::{ - anvil::region::{RegionHandle, RegionPosition}, - ChunkPosition, +use base::anvil::{ + self, + region::{RegionHandle, RegionPosition}, }; use flume::{Receiver, Sender}; -use super::{ChunkLoadResult, LoadedChunk, WorldSource}; - -/// World source loading from a vanilla (Anvil) world. -pub struct RegionWorldSource { - request_sender: Sender, - result_receiver: Receiver, -} - -impl RegionWorldSource { - pub fn new(world_dir: impl Into) -> Self { - let (request_sender, request_receiver) = flume::unbounded(); - let (worker, result_receiver) = Worker::new(world_dir.into(), request_receiver); - - worker.start(); - - Self { - request_sender, - result_receiver, - } - } -} - -impl WorldSource for RegionWorldSource { - fn queue_load(&mut self, pos: ChunkPosition) { - self.request_sender - .send(pos) - .expect("chunk worker panicked"); - } - - fn poll_loaded_chunk(&mut self) -> Option { - self.result_receiver.try_recv().ok() - } -} +use crate::chunk::worker::{ChunkLoadResult, LoadRequest, LoadedChunk, SaveRequest, WorkerRequest}; /// Duration to keep a region file open when not in use. const CACHE_TIME: Duration = Duration::from_secs(60); @@ -66,19 +34,19 @@ impl OpenRegionFile { } } -struct Worker { - request_receiver: Receiver, - result_sender: Sender, +pub struct RegionWorker { + request_receiver: Receiver, + result_sender: Sender, world_dir: PathBuf, region_files: AHashMap, last_cache_update: Instant, } -impl Worker { +impl RegionWorker { pub fn new( world_dir: PathBuf, - request_receiver: Receiver, - ) -> (Self, Receiver) { + request_receiver: Receiver, + ) -> (Self, Receiver) { let (result_sender, result_receiver) = flume::bounded(256); ( Self { @@ -102,8 +70,11 @@ impl Worker { fn run(mut self) { log::info!("Chunk worker started"); loop { - match self.request_receiver.recv_timeout(Duration::from_secs(30)) { - Ok(pos) => self.load_chunk(pos), + match self.request_receiver.recv_timeout(CACHE_TIME) { + Ok(req) => match req { + WorkerRequest::Load(load) => self.load_chunk(load), + WorkerRequest::Save(save) => self.save_chunk(save).unwrap(), + }, Err(flume::RecvTimeoutError::Timeout) => (), Err(flume::RecvTimeoutError::Disconnected) => { log::info!("Chunk worker shutting down"); @@ -114,26 +85,50 @@ impl Worker { } } - fn load_chunk(&mut self, pos: ChunkPosition) { - let result = self.get_chunk_load_result(pos); - let _ = self.result_sender.send(LoadedChunk { pos, result }); + fn save_chunk(&mut self, req: SaveRequest) -> anyhow::Result<()> { + let reg_pos = RegionPosition::from_chunk(req.pos); + 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)?; + self.region_files + .insert(reg_pos, OpenRegionFile::new(new_handle)); + self.region_file_handle(reg_pos).unwrap() + } + } + .handle; + handle.save_chunk( + &req.chunk.read(), + &req.entities[..], + &req.block_entities[..], + )?; + Ok(()) } - fn get_chunk_load_result(&mut self, pos: ChunkPosition) -> ChunkLoadResult { + fn load_chunk(&mut self, req: LoadRequest) { + let result = self.get_chunk_load_result(req); + let _ = self.result_sender.send(result); + } + + fn get_chunk_load_result(&mut self, req: LoadRequest) -> ChunkLoadResult { + let pos = req.pos; let region = RegionPosition::from_chunk(pos); let file = match self.region_file_handle(region) { Some(file) => file, - None => return ChunkLoadResult::Missing, + None => return ChunkLoadResult::Missing(pos), }; let chunk = match file.handle.load_chunk(pos) { Ok((chunk, _, _)) => chunk, - Err(e) => return ChunkLoadResult::Error(e.into()), + Err(e) => match e { + anvil::region::Error::ChunkNotExist => return ChunkLoadResult::Missing(pos), + err => return ChunkLoadResult::Error(err.into()), + }, }; file.last_used = Instant::now(); - ChunkLoadResult::Loaded { chunk } + ChunkLoadResult::Loaded(LoadedChunk { pos, chunk }) } fn region_file_handle(&mut self, region: RegionPosition) -> Option<&mut OpenRegionFile> { diff --git a/feather/common/src/view.rs b/feather/common/src/view.rs index 325b27a8f..52c404f5b 100644 --- a/feather/common/src/view.rs +++ b/feather/common/src/view.rs @@ -3,11 +3,9 @@ use base::{ChunkPosition, Position}; use ecs::{SysResult, SystemExecutor}; use itertools::Either; use quill_common::components::Name; +use quill_common::events::PlayerJoinEvent; -use crate::{ - events::{PlayerJoinEvent, ViewUpdateEvent}, - Game, -}; +use crate::{events::ViewUpdateEvent, Game}; /// Registers systems to update the `View` of a player. pub fn register(_game: &mut Game, systems: &mut SystemExecutor) { diff --git a/feather/common/src/window.rs b/feather/common/src/window.rs index 38db95f56..ba41b6381 100644 --- a/feather/common/src/window.rs +++ b/feather/common/src/window.rs @@ -1,11 +1,13 @@ use std::mem; use anyhow::{anyhow, bail}; -use base::{Area, Item, ItemStack}; + +use base::{Area, Item}; use ecs::SysResult; -pub use generated::Window as BackingWindow; -use generated::WindowError; +pub use libcraft_inventory::Window as BackingWindow; +use libcraft_inventory::WindowError; +use libcraft_items::InventorySlot::{self, Empty}; use parking_lot::MutexGuard; /// A player's window. Wraps one or more inventories and handles @@ -18,7 +20,7 @@ pub struct Window { /// The backing window (contains the `Inventory`s) inner: BackingWindow, /// The item currently held by the player's cursor. - cursor_item: Option, + cursor_item: InventorySlot, /// Current painting state (mouse drag) paint_state: Option, } @@ -28,84 +30,185 @@ impl Window { pub fn new(inner: BackingWindow) -> Self { Self { inner, - cursor_item: None, + cursor_item: Empty, paint_state: None, } } /// Left-click a slot in the window. pub fn left_click(&mut self, slot: usize) -> SysResult { - let mut slot_item = self.inner.item(slot)?; + let slot = &mut *self.inner.item(slot)?; + let cursor_slot = &mut self.cursor_item; // Cases: // * Either the cursor slot or the clicked slot is empty; swap the two. // * Both slots are present but are of different types; swap the two. // * Both slots are present and have the same type; merge the two. - match (slot_item.as_mut(), self.cursor_item.as_mut()) { - (Some(slot_item), Some(cursor_item)) => { - if cursor_item.has_same_type(slot_item) { - slot_item.merge_with(cursor_item); - } else { - mem::swap(slot_item, cursor_item); - } - } - (Some(_), None) => self.cursor_item = slot_item.take(), - (None, Some(_)) => *slot_item = self.cursor_item.take(), - (None, None) => (), - } - drop(slot_item); - self.refresh(); + if slot.is_filled() && cursor_slot.is_filled() && cursor_slot.is_mergable(slot) { + slot.merge(cursor_slot); + } else { + mem::swap(cursor_slot, slot); + } Ok(()) } /// Right-clicks a slot in the window. - pub fn right_click(&mut self, slot: usize) -> SysResult { - let mut slot_item = self.inner.item(slot)?; + pub fn right_click(&mut self, slot_index: usize) -> SysResult { + let slot = &mut *self.inner.item(slot_index)?; + let cursor_slot = &mut self.cursor_item; // Cases: // * Cursor slot is present and clicked slot has the same item type; drop one item in the clicked slot. // * Clicked slot is present but cursor slot is not; move half the items into the cursor slot. // * Both slots are present but differ in type; swap the two. - match (slot_item.as_mut(), self.cursor_item.as_mut()) { - (Some(slot_item), Some(cursor_item)) => { - if slot_item.has_same_type(cursor_item) { - cursor_item.transfer_to(1, slot_item); + + match (slot.is_filled(), cursor_slot.is_filled()) { + (true, true) => { + if slot.is_mergable(cursor_slot) { + cursor_slot.transfer_to(1, slot); } else { - mem::swap(slot_item, cursor_item); + mem::swap(slot, cursor_slot); } } - (Some(slot_item), None) => self.cursor_item = Some(slot_item.take_half()), - (None, Some(cursor_item)) => *slot_item = Some(cursor_item.take(1)), - (None, None) => (), + (true, false) => { + *cursor_slot = slot.take_half(); + } + (false, true) => { + *slot = cursor_slot.try_take(1); + } + (false, false) => {} } - drop(slot_item); - self.refresh(); - Ok(()) } /// Shift-clicks the given slot. (Either right or left click.) pub fn shift_click(&mut self, slot: usize) -> SysResult { - let mut slot_item_guard = self.inner.item(slot)?; - let slot_item = match slot_item_guard.as_mut() { - Some(item) => item, - None => return Ok(()), - }; + // If we are shift clicking on a empty slot, then nothing happens. + { + let slot_inventory = &mut *self.inner.item(slot)?; + if slot_inventory.is_empty() { + // Shift clicking on a empty inventory slot does nothing. + return Ok(()); + } + } + + match &self.inner { + BackingWindow::Player { player: _ } => self.shift_click_in_player_window(slot), + + BackingWindow::Generic9x1 { + block: _, + player: _, + } + | BackingWindow::Generic9x2 { + block: _, + player: _, + } + | BackingWindow::Generic9x3 { + block: _, + player: _, + } + | BackingWindow::Generic9x4 { + block: _, + player: _, + } + | BackingWindow::Generic9x5 { + block: _, + player: _, + } + | BackingWindow::Generic3x3 { + block: _, + player: _, + } + | BackingWindow::Generic9x6 { + left_chest: _, + right_chest: _, + player: _, + } => self.shift_click_in_generic_window(slot), + + BackingWindow::Crafting { + crafting_table: _, + player: _, + } => self.shift_click_in_crafting_window(slot), + BackingWindow::Furnace { + furnace: _, + player: _, + } => self.shift_click_in_furnace(slot), + + BackingWindow::BlastFurnace { + blast_furnace: _, + player: _, + } => self.shift_click_in_blast_furnace(slot), + + BackingWindow::Smoker { + smoker: _, + player: _, + } => self.shift_click_in_smoker(slot), + + BackingWindow::Enchantment { + enchantment_table: _, + player: _, + } => self.shift_click_in_enchantment(slot), + + BackingWindow::BrewingStand { + brewing_stand: _, + player: _, + } => self.shift_click_in_brewing_window(slot), + + BackingWindow::Beacon { + beacon: _, + player: _, + } => self.shift_click_in_beacon(slot), + + BackingWindow::Anvil { + anvil: _, + player: _, + } => self.shift_click_in_anvil(slot), + BackingWindow::Hopper { + hopper: _, + player: _, + } => self.shift_click_in_hopper(slot), + BackingWindow::ShulkerBox { + shulker_box: _, + player: _, + } => self.shift_click_in_shulker_box(slot), + + BackingWindow::Cartography { + cartography_table: _, + player: _, + } => self.shift_click_in_cartography_window(slot), + BackingWindow::Grindstone { + grindstone: _, + player: _, + } => self.shift_click_in_grindstone(slot), + BackingWindow::Lectern { + lectern: _, + player: _, + } => self.shift_click_in_lectern(slot), + BackingWindow::Loom { loom: _, player: _ } => self.shift_click_in_loom(slot), + BackingWindow::Stonecutter { + stonecutter: _, + player: _, + } => self.shift_click_in_stonecutter(slot), + } + } + + fn shift_click_in_player_window(&mut self, slot: usize) -> SysResult { + let slot_item = &mut *self.inner.item(slot)?; let (inventory, slot_area, _) = self.inner.index_to_slot(slot).unwrap(); - // TODO: correctly support non-player windows let areas_to_try = [ - Area::Hotbar, - Area::Storage, Area::Helmet, Area::Chestplate, Area::Leggings, Area::Boots, Area::CraftingInput, + Area::Hotbar, + Area::Storage, ]; + for &area in &areas_to_try { if area == slot_area || !will_accept(area, slot_item) { continue; @@ -114,35 +217,105 @@ impl Window { // Find slot with same type first let mut i = 0; while let Some(mut stack) = inventory.item(area, i) { - if let Some(stack) = stack.as_mut() { - if stack.has_same_type(slot_item) { - slot_item.transfer_to(u32::MAX, stack); - } + if slot_item.is_mergable(&stack) && stack.is_filled() { + stack.merge(slot_item); } i += 1; } - // If we still haven't moved all the items, transfer to any empty space - i = 0; - while let Some(mut stack) = inventory.item(area, i) { - if stack.is_none() { - *stack = Some(slot_item.take(u32::MAX)); - break; - } - i += 1; + if slot_item.is_empty() { + return Ok(()); } + } - if slot_item.count() == 0 { - break; + if slot_item.is_filled() { + for &area in &areas_to_try { + if area == slot_area || !will_accept(area, slot_item) { + continue; + } + + // 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) { + if stack.is_empty() { + stack.merge(slot_item); + } + i += 1; + } + + if slot_item.is_empty() { + break; + } } } - drop(slot_item_guard); - self.refresh(); - Ok(()) } + fn shift_click_in_generic_window(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_crafting_window(&mut self, _slot: usize) -> SysResult { + // TODO: If you shift click an item in the crafting table, then you craft + // as many as possible. So the items are crafted and put in Area::CraftingOutput + // We don't currently have a working crafting system, and once we have we probably + // need to change the function signature to get acsess to the crafting system. + todo!() + } + + fn shift_click_in_furnace(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_blast_furnace(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_smoker(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_enchantment(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_brewing_window(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_beacon(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_anvil(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_hopper(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_shulker_box(&mut self, _slot: usize) -> SysResult { + todo!() + } + + fn shift_click_in_cartography_window(&mut self, _slot: usize) -> SysResult { + todo!() + } + fn shift_click_in_grindstone(&mut self, _slot: usize) -> SysResult { + todo!() + } + fn shift_click_in_lectern(&mut self, _slot: usize) -> SysResult { + todo!() + } + fn shift_click_in_loom(&mut self, _slot: usize) -> SysResult { + todo!() + } + fn shift_click_in_stonecutter(&mut self, _slot: usize) -> SysResult { + todo!() + } + /// Starts a left mouse paint operation. pub fn begin_left_mouse_paint(&mut self) { self.paint_state = Some(PaintState::new(Mouse::Left)); @@ -172,33 +345,18 @@ impl Window { } /// Gets the item currently held in the cursor. - pub fn cursor_item(&self) -> Option { - self.cursor_item.clone() - } - - /// Refreshes items by fixing item stacks with count=0. - fn refresh(&mut self) { - Self::refresh_item(&mut self.cursor_item); - let mut i = 0; - while let Ok(mut slot) = self.inner.item(i) { - Self::refresh_item(&mut *slot); - i += 1; - } + pub fn cursor_item(&self) -> &InventorySlot { + &self.cursor_item } - fn refresh_item(item: &mut Option) { - if let Some(inner) = item { - if inner.count() == 0 { - *item = None; - } - } - } - - pub fn item(&self, index: usize) -> Result>, WindowError> { + pub fn item(&self, index: usize) -> Result, WindowError> { self.inner.item(index) } - pub fn set_item(&self, index: usize, item: Option) -> Result<(), WindowError> { + /// Sets an [`InventorySlot`] at the index. + /// # Error + /// Returns an error if the index is [`WindowError::OutOfBounds`] + pub fn set_item(&self, index: usize, item: InventorySlot) -> Result<(), WindowError> { self.inner.set_item(index, item) } @@ -209,46 +367,46 @@ impl Window { /// Determines whether the given area will accept the given item /// for shift-click transfer. -fn will_accept(area: Area, stack: &ItemStack) -> bool { +fn will_accept(area: Area, stack: &InventorySlot) -> bool { match area { Area::Storage => true, Area::CraftingOutput => false, Area::CraftingInput => false, Area::Helmet => matches!( - stack.item(), - Item::LeatherHelmet - | Item::ChainmailHelmet - | Item::GoldenHelmet - | Item::IronHelmet - | Item::DiamondHelmet - | Item::NetheriteHelmet + stack.item_kind(), + Some(Item::LeatherHelmet) + | Some(Item::ChainmailHelmet) + | Some(Item::GoldenHelmet) + | Some(Item::IronHelmet) + | Some(Item::DiamondHelmet) + | Some(Item::NetheriteHelmet) ), Area::Chestplate => matches!( - stack.item(), - Item::LeatherChestplate - | Item::ChainmailChestplate - | Item::GoldenChestplate - | Item::IronChestplate - | Item::DiamondChestplate - | Item::NetheriteChestplate + stack.item_kind(), + Some(Item::LeatherChestplate) + | Some(Item::ChainmailChestplate) + | Some(Item::GoldenChestplate) + | Some(Item::IronChestplate) + | Some(Item::DiamondChestplate) + | Some(Item::NetheriteChestplate) ), Area::Leggings => matches!( - stack.item(), - Item::LeatherHelmet - | Item::ChainmailLeggings - | Item::GoldenLeggings - | Item::IronLeggings - | Item::DiamondLeggings - | Item::NetheriteLeggings + stack.item_kind(), + Some(Item::LeatherHelmet) + | Some(Item::ChainmailLeggings) + | Some(Item::GoldenLeggings) + | Some(Item::IronLeggings) + | Some(Item::DiamondLeggings) + | Some(Item::NetheriteLeggings) ), Area::Boots => matches!( - stack.item(), - Item::LeatherBoots - | Item::ChainmailBoots - | Item::GoldenBoots - | Item::IronBoots - | Item::DiamondBoots - | Item::NetheriteBoots + stack.item_kind(), + Some(Item::LeatherBoots) + | Some(Item::ChainmailBoots) + | Some(Item::GoldenBoots) + | Some(Item::IronBoots) + | Some(Item::DiamondBoots) + | Some(Item::NetheriteBoots) ), Area::Hotbar => true, Area::Offhand => true, @@ -256,37 +414,42 @@ fn will_accept(area: Area, stack: &ItemStack) -> bool { Area::FurnaceFuel => true, Area::FurnaceOutput => false, Area::EnchantmentItem => true, - Area::EnchantmentLapis => stack.item() == Item::LapisLazuli, + Area::EnchantmentLapis => stack.item_kind() == Some(Item::LapisLazuli), Area::BrewingBottle => matches!( - stack.item(), - Item::GlassBottle | Item::Potion | Item::SplashPotion | Item::LingeringPotion + stack.item_kind(), + Some(Item::GlassBottle) + | Some(Item::Potion) + | Some(Item::SplashPotion) + | Some(Item::LingeringPotion) ), Area::BrewingIngredient => true, - Area::BrewingBlazePowder => stack.item() == Item::BlazePowder, + Area::BrewingBlazePowder => stack.item_kind() == Some(Item::BlazePowder), Area::VillagerInput => true, Area::VillagerOutput => false, Area::BeaconPayment => matches!( - stack.item(), - Item::IronIngot - | Item::GoldIngot - | Item::Diamond - | Item::NetheriteIngot - | Item::Emerald + stack.item_kind(), + Some(Item::IronIngot) + | Some(Item::GoldIngot) + | Some(Item::Diamond) + | Some(Item::NetheriteIngot) + | Some(Item::Emerald) ), Area::AnvilInput1 => true, Area::AnvilInput2 => true, Area::AnvilOutput => false, - Area::Saddle => stack.item() == Item::Saddle, + Area::Saddle => stack.item_kind() == Some(Item::Saddle), Area::HorseArmor => matches!( - stack.item(), - Item::LeatherHorseArmor - | Item::IronHorseArmor - | Item::GoldenHorseArmor - | Item::DiamondHorseArmor + stack.item_kind(), + Some(Item::LeatherHorseArmor) + | Some(Item::IronHorseArmor) + | Some(Item::GoldenHorseArmor) + | Some(Item::DiamondHorseArmor) ), Area::LlamaCarpet => true, - Area::CartographyMap => matches!(stack.item(), Item::Map | Item::FilledMap), - Area::CartographyPaper => stack.item() == Item::Paper, + Area::CartographyMap => { + matches!(stack.item_kind(), Some(Item::Map) | Some(Item::FilledMap)) + } + Area::CartographyPaper => stack.item_kind() == Some(Item::Paper), Area::CartographyOutput => false, Area::GrindstoneInput1 => true, Area::GrindstoneInput2 => true, @@ -325,50 +488,63 @@ impl PaintState { } pub fn finish(self, window: &mut Window) -> SysResult { - let cursor_item = match &mut window.cursor_item { - Some(item) => item, - None => bail!("cannot paint without cursor item"), - }; - match self.mouse { - Mouse::Left => { - let amount = cursor_item.count / self.slots.len() as u32; - let mut remainder = cursor_item.count % self.slots.len() as u32; + Mouse::Left => self.handle_left_drag(window), + Mouse::Right => self.handle_right_drag(window), + } + Ok(()) + } - for slot in self.slots { - if window.inner.item(slot)?.is_some() { - bail!("attempted to overwrite item"); - } + /** + 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) { + // If the cursor has no item then there are no items to share. + if window.cursor_item().is_empty() { + return; + } - let amount = if amount > 0 { - amount - } else { - let amount = 1.min(remainder); - remainder -= amount; - amount - }; - window - .inner - .set_item(slot, Some(cursor_item.take(amount)))?; - } - } - Mouse::Right => { - for slot in self.slots { - let mut item = window.inner.item(slot)?; - let item = match item.as_mut() { - Some(item) => item, - None => { - *item = Some(cursor_item.take(0)); - item.as_mut().unwrap() - } - }; - cursor_item.transfer_to(1, &mut *item); - } + // Number of slots that can contain cursors item kind. + let slots = self + .slots + .iter() + .filter(|s| { + // unwrap is safe because index is valid. + let slot = &*window.inner.item(**s).unwrap(); + slot.is_mergable(window.cursor_item()) + }) + .count() as u32; + + // If slots is 0 that means there are no slots to put items into. + // So the cursor keeps all the items. + if slots == 0 { + return; + }; + + let items_for_cursor = window.cursor_item().count(); + // This can't be zero because items_cursor is the count of an ItemStack and ItemStack is NonZeroU32. + let items_per_slot = (items_for_cursor / slots).max(1); + self.move_items_into_slots(window, items_per_slot); + } + + /// 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) { + for s in &self.slots { + let slot = &mut *window.inner.item(*s).unwrap(); + if !slot.is_mergable(window.cursor_item()) { + continue; } + + window.cursor_item.transfer_to(items_per_slot, slot); + if window.cursor_item().is_empty() { + break; + }; } + } - window.refresh(); - Ok(()) + fn handle_right_drag(&self, window: &mut Window) { + self.move_items_into_slots(window, 1) } } @@ -380,7 +556,7 @@ enum Mouse { #[cfg(test)] mod tests { - use base::{Inventory, Item}; + use base::{Inventory, Item, ItemStack}; use super::*; @@ -389,89 +565,107 @@ mod tests { let mut window = window(); window.left_click(0).unwrap(); - assert_eq!(window.cursor_item, None); + assert_eq!(window.cursor_item, Empty); - let stack = ItemStack::new(Item::Diamond, 32); - window.set_item(0, Some(stack.clone())).unwrap(); + let stack = ItemStack::new(Item::Diamond, 32).unwrap(); + window + .set_item(0, InventorySlot::Filled(stack.clone())) + .unwrap(); window.left_click(0).unwrap(); - assert_eq!(window.cursor_item, Some(stack.clone())); - assert!(window.item(0).unwrap().is_none()); + assert_eq!(window.cursor_item, InventorySlot::Filled(stack.clone())); + assert!(window.item(0).unwrap().is_empty()); window.left_click(1).unwrap(); - assert_eq!(window.cursor_item, None); - assert_eq!(window.item(1).unwrap().as_ref(), Some(&stack)); + assert_eq!(window.cursor_item, Empty); + assert_eq!(*window.item(1).unwrap(), InventorySlot::Filled(stack)); } #[test] fn window_left_click_same_item() { let mut window = window(); - let item = ItemStack::new(Item::AcaciaSlab, 32); - window.set_item(0, Some(item.clone())).unwrap(); + let item = ItemStack::new(Item::AcaciaSlab, 32).unwrap(); + window + .set_item(0, InventorySlot::Filled(item.clone())) + .unwrap(); window.left_click(0).unwrap(); - window.set_item(1, Some(item)).unwrap(); + window.set_item(1, InventorySlot::Filled(item)).unwrap(); window.left_click(1).unwrap(); - assert_eq!(window.cursor_item, None); + assert_eq!(window.cursor_item, Empty); assert_eq!( - window.item(1).unwrap().as_ref(), - Some(&ItemStack::new(Item::AcaciaSlab, 64)) + *window.item(1).unwrap(), + InventorySlot::Filled(ItemStack::new(Item::AcaciaSlab, 64).unwrap()) ); } + /* + thread 'window::tests::window_left_click_same_item' panicked at 'assertion failed: `(left == right)` + left: `Filled(ItemStack { item: AcaciaSlab, count: 32, meta: Some(ItemStackMeta { title: "acacia_slab", lore: "", damage: None, repair_cost: None, enchantments: [] }) })`, + right: `Filled(ItemStack { item: AcaciaSlab, count: 64, meta: Some(ItemStackMeta { title: "acacia_slab", lore: "", damage: None, repair_cost: None, enchantments: [] }) })`', + feather/common/src/window.rs:452:9 + */ + #[test] fn window_right_click_pick_up_half() { let mut window = window(); - let stack = ItemStack::new(Item::GlassPane, 17); - window.set_item(0, Some(stack)).unwrap(); + let stack = ItemStack::new(Item::GlassPane, 17).unwrap(); + window.set_item(0, InventorySlot::Filled(stack)).unwrap(); window.right_click(0).unwrap(); - assert_eq!(window.cursor_item, Some(ItemStack::new(Item::GlassPane, 9))); assert_eq!( - window.item(0).unwrap().as_ref(), - Some(&ItemStack::new(Item::GlassPane, 8)) + window.cursor_item, + InventorySlot::Filled(ItemStack::new(Item::GlassPane, 9).unwrap()) + ); + assert_eq!( + *window.item(0).unwrap(), + InventorySlot::Filled(ItemStack::new(Item::GlassPane, 8).unwrap()) ); } #[test] fn window_right_click_drop_one_item() { let mut window = window(); - let stack = ItemStack::new(Item::GlassPane, 17); - window.cursor_item = Some(stack); + let stack = ItemStack::new(Item::GlassPane, 17).unwrap(); + window.cursor_item = InventorySlot::Filled(stack); window.right_click(1).unwrap(); assert_eq!( window.cursor_item, - Some(ItemStack::new(Item::GlassPane, 16)) + InventorySlot::Filled(ItemStack::new(Item::GlassPane, 16).unwrap()) ); assert_eq!( - window.item(1).unwrap().as_ref(), - Some(&ItemStack::new(Item::GlassPane, 1)) + *window.item(1).unwrap(), + InventorySlot::Filled(ItemStack::new(Item::GlassPane, 1).unwrap()) ); } #[test] fn window_right_click_swap() { let mut window = window(); - let stack1 = ItemStack::new(Item::GlassPane, 17); - let stack2 = ItemStack::new(Item::Diamond, 2); - window.cursor_item = Some(stack1.clone()); - window.set_item(0, Some(stack2.clone())).unwrap(); + let stack1 = ItemStack::new(Item::GlassPane, 17).unwrap(); + let stack2 = ItemStack::new(Item::Diamond, 2).unwrap(); + window.cursor_item = InventorySlot::Filled(stack1.clone()); + window + .set_item(0, InventorySlot::Filled(stack2.clone())) + .unwrap(); window.right_click(0).unwrap(); - assert_eq!(window.cursor_item, Some(stack2)); - assert_eq!(window.item(0).unwrap().as_ref(), Some(&stack1)); + assert_eq!(window.cursor_item, InventorySlot::Filled(stack2)); + assert_eq!(*window.item(0).unwrap(), InventorySlot::Filled(stack1)); } #[test] fn window_shift_click_full_hotbar() { let inventory = Inventory::player(); for i in 0..9 { - *inventory.item(Area::Hotbar, i).unwrap() = Some(ItemStack::new(Item::EnderPearl, 1)); + *inventory.item(Area::Hotbar, i).unwrap() = + InventorySlot::Filled(ItemStack::new(Item::EnderPearl, 1).unwrap()); } - *inventory.item(Area::Storage, 0).unwrap() = Some(ItemStack::new(Item::AcaciaSign, 1)); + *inventory.item(Area::Storage, 0).unwrap() = + InventorySlot::Filled(ItemStack::new(Item::AcaciaSign, 1).unwrap()); let mut window = Window::new(BackingWindow::Player { player: inventory.new_handle(), }); @@ -481,16 +675,20 @@ mod tests { .unwrap(); window.shift_click(index).unwrap(); assert_eq!( - window.item(index).unwrap().as_ref(), - Some(&ItemStack::new(Item::AcaciaSign, 1)) + *window.item(index).unwrap(), + InventorySlot::Filled(ItemStack::new(Item::AcaciaSign, 1).unwrap()) ); } #[test] fn window_shift_click_available_item_in_hotbar() { let inventory = Inventory::player(); - *inventory.item(Area::Hotbar, 3).unwrap() = Some(ItemStack::new(Item::Stone, 4)); - *inventory.item(Area::Storage, 3).unwrap() = Some(ItemStack::new(Item::Stone, 7)); + + *inventory.item(Area::Hotbar, 3).unwrap() = + InventorySlot::Filled(ItemStack::new(Item::Stone, 4).unwrap()); + *inventory.item(Area::Storage, 3).unwrap() = + InventorySlot::Filled(ItemStack::new(Item::Stone, 7).unwrap()); + let mut window = Window::new(BackingWindow::Player { player: inventory.new_handle(), }); @@ -499,23 +697,28 @@ mod tests { .inner() .slot_to_index(&inventory, Area::Storage, 3) .unwrap(); + window.shift_click(index).unwrap(); + dbg!(&window); + let hotbar_index = window .inner() .slot_to_index(&inventory, Area::Hotbar, 3) .unwrap(); + assert_eq!( - window.item(hotbar_index).unwrap().as_ref(), - Some(&ItemStack::new(Item::Stone, 11)) + *window.item(hotbar_index).unwrap(), + InventorySlot::Filled(ItemStack::new(Item::Stone, 11).unwrap()) ); - assert!(window.item(index).unwrap().is_none()); + assert!(window.item(index).unwrap().is_empty()); } #[test] fn window_shift_click_empty_hotbar() { let inventory = Inventory::player(); - *inventory.item(Area::Storage, 3).unwrap() = Some(ItemStack::new(Item::Stone, 7)); + *inventory.item(Area::Storage, 3).unwrap() = + InventorySlot::Filled(ItemStack::new(Item::Stone, 7).unwrap()); let mut window = Window::new(BackingWindow::Player { player: inventory.new_handle(), }); @@ -530,17 +733,20 @@ mod tests { .slot_to_index(&inventory, Area::Hotbar, 0) .unwrap(); assert_eq!( - window.item(hotbar_index).unwrap().as_ref(), - Some(&ItemStack::new(Item::Stone, 7)) + *window.item(hotbar_index).unwrap(), + InventorySlot::Filled(ItemStack::new(Item::Stone, 7).unwrap()) ); - assert!(window.item(storage_index).unwrap().is_none()); + assert!(window.item(storage_index).unwrap().is_empty()); } #[test] fn left_mouse_paint() { let mut window = window(); window - .set_item(0, Some(ItemStack::new(Item::Stone, 64))) + .set_item( + 0, + InventorySlot::Filled(ItemStack::new(Item::Stone, 64).unwrap()), + ) .unwrap(); window.left_click(0).unwrap(); @@ -552,21 +758,30 @@ mod tests { for &slot in &[0, 1, 5] { assert_eq!( - window.item(slot).unwrap().as_ref(), - Some(&ItemStack::new(Item::Stone, 21)) + *window.item(slot).unwrap(), + InventorySlot::Filled(ItemStack::new(Item::Stone, 21).unwrap()) ); } - assert_eq!(window.cursor_item, Some(ItemStack::new(Item::Stone, 1))); + assert_eq!( + window.cursor_item, + InventorySlot::Filled(ItemStack::new(Item::Stone, 1).unwrap()) + ); } #[test] fn right_mouse_paint() { let mut window = window(); window - .set_item(0, Some(ItemStack::new(Item::Stone, 64))) + .set_item( + 0, + InventorySlot::Filled(ItemStack::new(Item::Stone, 2).unwrap()), + ) .unwrap(); window - .set_item(4, Some(ItemStack::new(Item::Stone, 3))) + .set_item( + 4, + InventorySlot::Filled(ItemStack::new(Item::Stone, 3).unwrap()), + ) .unwrap(); window.left_click(0).unwrap(); @@ -576,14 +791,14 @@ mod tests { window.end_paint().unwrap(); assert_eq!( - window.item(4).unwrap().as_ref(), - Some(&ItemStack::new(Item::Stone, 4)) + *window.item(4).unwrap(), + InventorySlot::Filled(ItemStack::new(Item::Stone, 4).unwrap()) ); assert_eq!( - window.item(5).unwrap().as_ref(), - Some(&ItemStack::new(Item::Stone, 1)) + *window.item(5).unwrap(), + InventorySlot::Filled(ItemStack::new(Item::Stone, 1).unwrap()) ); - assert_eq!(window.cursor_item, Some(ItemStack::new(Item::Stone, 62))); + assert_eq!(window.cursor_item, InventorySlot::Empty); } fn window() -> Window { @@ -591,4 +806,13 @@ mod tests { player: Inventory::player(), }) } + + #[test] + fn set_item_test() { + let window = window(); + + window + .set_item(45, InventorySlot::new(Item::Stone, 1)) + .unwrap(); + } } diff --git a/feather/common/src/world.rs b/feather/common/src/world.rs index 72e5e64a3..f82ffc427 100644 --- a/feather/common/src/world.rs +++ b/feather/common/src/world.rs @@ -1,13 +1,21 @@ +use std::{path::PathBuf, sync::Arc}; + use ahash::{AHashMap, AHashSet}; -use base::{BlockPosition, Chunk, ChunkPosition, CHUNK_HEIGHT}; +use parking_lot::{RwLockReadGuard, RwLockWriteGuard}; +use uuid::Uuid; + +use base::anvil::player::PlayerData; +use base::{ + BlockPosition, Chunk, ChunkHandle, ChunkLock, ChunkPosition, ValidBlockPosition, CHUNK_HEIGHT, +}; use blocks::BlockId; -use ecs::Ecs; -use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; -use std::sync::Arc; +use ecs::{Ecs, SysResult}; +use worldgen::{ComposableGenerator, WorldGenerator}; use crate::{ + chunk::cache::ChunkCache, + chunk::worker::{ChunkWorker, LoadRequest, SaveRequest}, events::ChunkLoadEvent, - world_source::{null::NullWorldSource, ChunkLoadResult, WorldSource}, }; /// Stores all blocks and chunks in a world, @@ -18,18 +26,25 @@ use crate::{ /// This does not store entities; it only contains blocks. pub struct World { chunk_map: ChunkMap, - world_source: Box, + pub cache: ChunkCache, + chunk_worker: ChunkWorker, loading_chunks: AHashSet, canceled_chunk_loads: AHashSet, + world_dir: PathBuf, } impl Default for World { fn default() -> Self { Self { chunk_map: ChunkMap::new(), - world_source: Box::new(NullWorldSource::default()), + chunk_worker: ChunkWorker::new( + "world", + Arc::new(ComposableGenerator::default_with_seed(0)), + ), + cache: ChunkCache::new(), loading_chunks: AHashSet::new(), canceled_chunk_loads: AHashSet::new(), + world_dir: "world".into(), } } } @@ -39,43 +54,42 @@ impl World { Self::default() } - /// Creates a `World` from a `WorldSource` for loading chunks. - pub fn with_source(world_source: impl WorldSource + 'static) -> Self { + pub fn with_gen_and_path( + generator: Arc, + world_dir: impl Into + Clone, + ) -> Self { Self { - world_source: Box::new(world_source), + world_dir: world_dir.clone().into(), + chunk_worker: ChunkWorker::new(world_dir, generator), ..Default::default() } } - /// Queues the given chunk to be loaded. - pub fn queue_chunk_load(&mut self, pos: ChunkPosition) { - self.loading_chunks.insert(pos); - self.world_source.queue_load(pos); + /// 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) { + // 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); + } } /// 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) { - while let Some(loaded) = self.world_source.poll_loaded_chunk() { + pub fn load_chunks(&mut self, ecs: &mut Ecs) -> SysResult { + while let Some(loaded) = self.chunk_worker.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 { - ChunkLoadResult::Missing => { - log::debug!( - "Chunk {:?} is missing; using default empty chunk", - loaded.pos - ); - Chunk::new(loaded.pos) - } - ChunkLoadResult::Error(e) => { - log::error!("Failed to load chunk {:?}: {:?}", loaded.pos, e); - continue; - } - ChunkLoadResult::Loaded { chunk } => chunk, - }; self.chunk_map.insert_chunk(chunk); ecs.insert_event(ChunkLoadEvent { chunk: Arc::clone(&self.chunk_map.0[&loaded.pos]), @@ -83,16 +97,28 @@ impl World { }); log::trace!("Loaded chunk {:?}", loaded.pos); } + Ok(()) } /// Unloads the given chunk. - pub fn unload_chunk(&mut self, pos: ChunkPosition) { + 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); + } 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. @@ -111,7 +137,7 @@ impl World { /// 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: BlockPosition, block: BlockId) -> bool { + pub fn set_block_at(&self, pos: ValidBlockPosition, block: BlockId) -> bool { self.chunk_map.set_block_at(pos, block) } @@ -119,7 +145,7 @@ impl World { /// 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: BlockPosition) -> Option { + pub fn block_at(&self, pos: ValidBlockPosition) -> Option { self.chunk_map.block_at(pos) } @@ -132,9 +158,20 @@ impl World { pub fn chunk_map_mut(&mut self) -> &mut ChunkMap { &mut self.chunk_map } + + pub fn load_player_data(&self, uuid: Uuid) -> anyhow::Result { + Ok(base::anvil::player::load_player_data( + &self.world_dir, + uuid, + )?) + } + + pub fn save_player_data(&self, uuid: Uuid, data: &PlayerData) -> anyhow::Result<()> { + base::anvil::player::save_player_data(&self.world_dir, uuid, data) + } } -pub type ChunkMapInner = AHashMap>>; +pub type ChunkMapInner = AHashMap; /// This struct stores all the chunks on the server, /// so it allows access to blocks and lighting data. @@ -162,42 +199,43 @@ impl ChunkMap { /// 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).map(|lock| lock.write()) + self.0.get(&pos).and_then(|lock| lock.write()) } /// Returns an `Arc>` at the given position. - pub fn chunk_handle_at(&self, pos: ChunkPosition) -> Option>> { + pub fn chunk_handle_at(&self, pos: ChunkPosition) -> Option { self.0.get(&pos).map(Arc::clone) } - pub fn block_at(&self, pos: BlockPosition) -> Option { + pub fn block_at(&self, pos: ValidBlockPosition) -> Option { check_coords(pos)?; - let (x, y, z) = chunk_relative_pos(pos); - self.chunk_at(pos.into()) - .map(|chunk| chunk.block_at(x, y, z)) - .flatten() + + let (x, y, z) = chunk_relative_pos(pos.into()); + self.chunk_at(pos.chunk()) + .and_then(|chunk| chunk.block_at(x, y, z)) } - pub fn set_block_at(&self, pos: BlockPosition, block: BlockId) -> bool { + 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); - self.chunk_at_mut(pos.into()) + 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() } /// Returns an iterator over chunks. - pub fn iter_chunks(&self) -> impl IntoIterator>> { + pub fn iter_chunks(&self) -> impl IntoIterator { self.0.values() } /// Inserts a new chunk into the chunk map. pub fn insert_chunk(&mut self, chunk: Chunk) { self.0 - .insert(chunk.position(), Arc::new(RwLock::new(chunk))); + .insert(chunk.position(), Arc::new(ChunkLock::new(chunk, true))); } /// Removes the chunk at the given position, returning `true` if it existed. @@ -206,8 +244,8 @@ impl ChunkMap { } } -fn check_coords(pos: BlockPosition) -> Option<()> { - if pos.y >= 0 && pos.y < CHUNK_HEIGHT as i32 { +fn check_coords(pos: ValidBlockPosition) -> Option<()> { + if pos.y() >= 0 && pos.y() < CHUNK_HEIGHT as i32 { Some(()) } else { None @@ -224,6 +262,8 @@ fn chunk_relative_pos(block_pos: BlockPosition) -> (usize, usize, usize) { #[cfg(test)] mod tests { + use std::convert::TryInto; + use super::*; #[test] @@ -233,7 +273,11 @@ mod tests { .chunk_map_mut() .insert_chunk(Chunk::new(ChunkPosition::new(0, 0))); - assert!(world.block_at(BlockPosition::new(0, -1, 0)).is_none()); - assert!(world.block_at(BlockPosition::new(0, 0, 0)).is_some()); + 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()); } } diff --git a/feather/common/src/world_source.rs b/feather/common/src/world_source.rs deleted file mode 100644 index 1dda51b20..000000000 --- a/feather/common/src/world_source.rs +++ /dev/null @@ -1,84 +0,0 @@ -use base::{Chunk, ChunkPosition}; - -pub mod flat; -pub mod null; -pub mod region; - -/// A chunk loaded from a [`WorldSource`]. -pub struct LoadedChunk { - pub pos: ChunkPosition, - pub result: ChunkLoadResult, -} - -#[derive(Debug)] -#[allow(clippy::large_enum_variant)] -pub enum ChunkLoadResult { - /// The chunk does not exist in this source. - Missing, - /// An error occurred while loading the chunk. - Error(anyhow::Error), - /// Successfully loaded the chunk. - Loaded { chunk: Chunk }, -} - -/// Provides methods to load chunks, entities, and global world data. -pub trait WorldSource: 'static { - /// Enqueues the chunk at `pos` to be loaded. - /// A future call to `poll_loaded_chunk` should - /// return this chunk. - fn queue_load(&mut self, pos: ChunkPosition); - - /// Polls for the next loaded chunk. Should not block - /// - /// The order in which chunks are loaded is not defined. In other - /// words, this method does not need to yield chunks in the - /// same order they were queued for loading. - fn poll_loaded_chunk(&mut self) -> Option; - - /// Creates a `WorldSource` that falls back to `fallback` - /// if chunks in `self` are missing or corrupt. - fn with_fallback(self, fallback: impl WorldSource) -> FallbackWorldSource - where - Self: Sized, - { - FallbackWorldSource { - first: Box::new(self), - fallback: Box::new(fallback), - } - } -} - -/// `WorldSource` wrapping two world sources. Falls back -/// to the second source if the first one is missing a chunk. -pub struct FallbackWorldSource { - first: Box, - fallback: Box, -} - -impl WorldSource for FallbackWorldSource { - fn queue_load(&mut self, pos: ChunkPosition) { - self.first.queue_load(pos); - } - - fn poll_loaded_chunk(&mut self) -> Option { - self.first - .poll_loaded_chunk() - .map(|chunk| { - if matches!( - &chunk.result, - ChunkLoadResult::Error(_) | ChunkLoadResult::Missing - ) { - self.fallback.queue_load(chunk.pos); - log::trace!( - "Chunk load falling back (failure cause: {:?})", - chunk.result - ); - None - } else { - Some(chunk) - } - }) - .flatten() - .or_else(|| self.fallback.poll_loaded_chunk()) - } -} diff --git a/feather/common/src/world_source/flat.rs b/feather/common/src/world_source/flat.rs deleted file mode 100644 index f4bb635dd..000000000 --- a/feather/common/src/world_source/flat.rs +++ /dev/null @@ -1,64 +0,0 @@ -use base::{BlockId, Chunk, ChunkPosition, CHUNK_WIDTH}; - -use super::{ChunkLoadResult, LoadedChunk, WorldSource}; - -/// A world source used for debugging that emits -/// only flat chunks and does no IO. -pub struct FlatWorldSource { - archetype: Chunk, - loaded: Vec, -} - -impl Default for FlatWorldSource { - fn default() -> Self { - Self::new() - } -} - -impl FlatWorldSource { - pub fn new() -> Self { - let archetype = Self::generate(); - - Self { - archetype, - loaded: Vec::new(), - } - } - - fn generate() -> Chunk { - let mut archetype = Chunk::new(ChunkPosition::new(0, 0)); - for y in 0..64 { - for z in 0..CHUNK_WIDTH { - for x in 0..CHUNK_WIDTH { - archetype.set_block_at(x, y, z, Self::select_block(y)); - } - } - } - archetype - } - - fn select_block(height: usize) -> BlockId { - match height { - 0 => BlockId::bedrock(), - 1..=57 => BlockId::stone(), - 58..=62 => BlockId::dirt(), - 63 => BlockId::grass_block(), - _ => BlockId::air(), - } - } -} - -impl WorldSource for FlatWorldSource { - fn queue_load(&mut self, pos: base::ChunkPosition) { - let mut chunk = self.archetype.clone(); - chunk.set_position(pos); - self.loaded.push(LoadedChunk { - pos, - result: ChunkLoadResult::Loaded { chunk }, - }); - } - - fn poll_loaded_chunk(&mut self) -> Option { - self.loaded.pop() - } -} diff --git a/feather/common/src/world_source/null.rs b/feather/common/src/world_source/null.rs deleted file mode 100644 index 8a3a929d6..000000000 --- a/feather/common/src/world_source/null.rs +++ /dev/null @@ -1,22 +0,0 @@ -use base::ChunkPosition; - -use super::{ChunkLoadResult, LoadedChunk, WorldSource}; - -/// A world source that always yields `ChunkLoadResult::Missing`. -#[derive(Default)] -pub struct NullWorldSource { - loaded: Vec, -} - -impl WorldSource for NullWorldSource { - fn queue_load(&mut self, pos: ChunkPosition) { - self.loaded.push(pos); - } - - fn poll_loaded_chunk(&mut self) -> Option { - self.loaded.pop().map(|pos| LoadedChunk { - pos, - result: ChunkLoadResult::Missing, - }) - } -} diff --git a/feather/datapacks/Cargo.toml b/feather/datapacks/Cargo.toml index d43a9bcf2..d7bfd149c 100644 --- a/feather/datapacks/Cargo.toml +++ b/feather/datapacks/Cargo.toml @@ -12,5 +12,5 @@ serde = { version = "1", features = [ "derive" ] } serde_json = "1" smartstring = { version = "0.2", features = [ "serde" ] } thiserror = "1" -ureq = { version = "1", default-features = false, features = [ "tls" ] } -zip = "0.5" +ureq = { version = "2", default-features = false, features = [ "tls" ] } +zip = { version = "0.5", default-features = false, features = [ "deflate", "bzip2" ] } diff --git a/feather/datapacks/src/vanilla.rs b/feather/datapacks/src/vanilla.rs index 566cd0f7f..05e36053e 100644 --- a/feather/datapacks/src/vanilla.rs +++ b/feather/datapacks/src/vanilla.rs @@ -1,4 +1,7 @@ use anyhow::Context; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::Arc; +use std::time::SystemTime; use std::{ fs::{self, File}, io, @@ -11,6 +14,8 @@ use zip::ZipArchive; const JAR_URL: &str = "https://launcher.mojang.com/v1/objects/c5f6fb23c3876461d46ec380421e42b289789530/server.jar"; const JAR_NAME: &str = "server-1.16.2.jar"; +const DOWNLOAD_WARNING_MINUTES: f64 = 2.0; +const DOWNLOAD_TIMEOUT_MINUTES: u64 = 30; /// Downloads vanilla server/client JARs and assets, used /// for loot tables, recipes, etc. @@ -19,7 +24,10 @@ const JAR_NAME: &str = "server-1.16.2.jar"; /// The vanilla datapack will be extracted to `$base/datapacks`. pub fn download_vanilla_assets(base: &Path) -> anyhow::Result<()> { let jar = download_jar(base) - .context("failed to download vanilla server JAR") + .context(format!( + "failed to download vanilla server JAR in {} minutes", + DOWNLOAD_TIMEOUT_MINUTES + )) .context("please make sure you have an Internet connection.")?; // NB: JAR files are just glorified ZIP files, so we can use the zip crate @@ -33,10 +41,37 @@ pub fn download_vanilla_assets(base: &Path) -> anyhow::Result<()> { fn download_jar(base: &Path) -> anyhow::Result { log::info!("Downloading vanilla server JAR from {}", JAR_URL); + + let downloaded = Arc::new(AtomicBool::new(false)); + let download_start_time = SystemTime::now(); + let mut download_time = 1.0; + let mut warning = 1; + let downloaded1 = downloaded.clone(); + std::thread::spawn(move || { + while !downloaded1.load(Ordering::Relaxed) { + let elapsed = download_start_time.elapsed().unwrap().as_secs_f64(); + if elapsed / 60.0 >= warning as f64 * DOWNLOAD_WARNING_MINUTES + && download_time / 60.0 < warning as f64 * DOWNLOAD_WARNING_MINUTES + { + log::warn!("Looks like you have a slow internet connection! Downloading vanilla server JAR for {} minutes", warning as f64 * DOWNLOAD_WARNING_MINUTES); + warning += 1; + } + download_time = elapsed; + std::thread::sleep(Duration::from_secs(1)); + } + }); + let mut data = ureq::get(JAR_URL) - .timeout(Duration::from_secs(10)) + .timeout(Duration::from_secs(60 * DOWNLOAD_TIMEOUT_MINUTES)) .call() + .map_err(|err| { + // stop download time counter + downloaded.store(true, Ordering::Relaxed); + err + })? .into_reader(); + downloaded.store(true, Ordering::Relaxed); + log::info!("Downloaded vanilla server JAR successfully"); let downloaded_dir = base.join("downloaded"); fs::create_dir_all(&downloaded_dir)?; diff --git a/feather/ecs/src/lib.rs b/feather/ecs/src/lib.rs index 0ccf5002f..77fd48c2d 100644 --- a/feather/ecs/src/lib.rs +++ b/feather/ecs/src/lib.rs @@ -3,7 +3,7 @@ //! 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 sequentialy. +//! 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. //! diff --git a/feather/generated/Cargo.toml b/feather/generated/Cargo.toml deleted file mode 100644 index ce0e2f907..000000000 --- a/feather/generated/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "feather-generated" -version = "0.1.0" -edition = "2018" - -[dependencies] -num-derive = "0.3" -num-traits = "0.2" -parking_lot = "0.11" -thiserror = "1" -vek = "0.14" diff --git a/feather/generated/README.md b/feather/generated/README.md deleted file mode 100644 index 4c77b4fba..000000000 --- a/feather/generated/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# feather-generated - -Code generated from JSON files. - -Code generators are written in Python and live in the `generators` directory. The script `regenerate.sh` -can be used to invoke all generators and regenerate all code. - -Running these scripts requires `rustfmt` 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. - -`feather-generated` currently provides the following: -* Generated `Biome` enum and ID mappings. -* Generated `BlockKind` enum, which is used by `feather-blocks`. -* Generated `EntityKind` enum and ID mappings. -* Slot conversion functions for inventories, including the `Window` struct. -* Items and associated data (ID mappings, tool mappings, durability, ...) -* The `Particle` struct with protocol ID mappings. - -Data is sourced from two sets of files: -* [`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. -* Feather's own data files, which live in the `feather` directory. diff --git a/feather/generated/feather/simplified_block.json b/feather/generated/feather/simplified_block.json deleted file mode 100644 index 79d97f792..000000000 --- a/feather/generated/feather/simplified_block.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "regexes": { - "air": "^.*air$", - "planks": "^.+_planks$", - "sapling": "^(\\w+|dark_oak)_sapling$", - "log": "^.+_(log|wood)$", - "leaves": ".+_leaves$", - "bed": "^.+_bed$", - "wool": "^.+_wool$", - "flower": "^(allium|poppy|dandelion|\\w+_(orchid|bluet|tulip|daisy))$", - "wooden_pressure_plate": "^(oak|spruce|birch|jungle|acacia|dark_oak)_pressure_plate$", - "stained_glass": "^.+_stained_glass$", - "wooden_trapdoor": "^(oak|spruce|birch|jungle|acacia|dark_oak)_trapdoor$", - "wooden_button": "^(oak|spruce|birch|jungle|acacia|dark_oak)_button$", - "anvil": "^(\\w+_)?anvil$", - "glazed_teracotta": "^.+_glazed_terracotta$", - "teracotta": "^.*terracotta$", - "stained_glass_pane": "^.+_stained_glass_pane$", - "carpet": "^.+_carpet$", - "wall_banner": "^.+_wall_banner$", - "banner": "^.+_banner$", - "slab": "^.+_slab$", - "stairs": "^.+_stairs$", - "fence_gate": "^.+_fence_gate$", - "fence": "^.+_fence$", - "wooden_door": "^(oak|spruce|birch|jungle|acacia|dark_oak)_door$", - "shulker_box": "^.*shulker_box$", - "concrete": "^.+_concrete$", - "concrete_powder": "^.+_concrete_powder$", - "coral": "^.+_coral$", - "coral_block": "^.+_coral_block$", - "coral_fan": "^.+_coral_fan$", - "coral_wall_fan": "^.+_coral_wall_fan$", - "mushroom": "^\\w+_mushroom$", - "wall_sign": "^.+_wall_sign", - "sign": "^.+_sign" - } -} diff --git a/feather/generated/generators/biome.py b/feather/generated/generators/biome.py deleted file mode 100644 index a95fc1bd0..000000000 --- a/feather/generated/generators/biome.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generation of the Biome enum. Uses minecraft-data/biomes.json. -import common - -data = common.load_minecraft_json("biomes.json") - -variants = [] -ids = {} -names = {} -display_names = {} -rainfalls = {} -temperatures = {} - -for biome in data: - variant = common.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 = common.generate_enum("Biome", variants) -output += common.generate_enum_property("Biome", "id", "u32", ids, True) -output += common.generate_enum_property("Biome", "name", "&str", names, True, "&'static str") -output += common.generate_enum_property("Biome", "display_name", "&str", display_names, True, "&'static str") -output += common.generate_enum_property("Biome", "rainfall", "f32", rainfalls) -output += common.generate_enum_property("Biome", "temperature", "f32", temperatures) - -common.output("src/biome.rs", output) - diff --git a/feather/generated/generators/block.py b/feather/generated/generators/block.py deleted file mode 100644 index 88da4f82f..000000000 --- a/feather/generated/generators/block.py +++ /dev/null @@ -1,96 +0,0 @@ -import common - -data = common.load_minecraft_json("blocks.json") - -# build item ID => item kind index -item_data = common.load_minecraft_json("items.json") -item_kinds_by_id = {} -for item in item_data: - item_kinds_by_id[item['id']] = common.camel_case(item['name']) - -# Build material name => dig multipliers index -material_data = common.load_minecraft_json("materials.json") -material_dig_multipliers = {} -for name, material in material_data.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"(crate::Item::{item}, {multiplier} as f32)," - constant = f"DIG_MULTIPLIERS_{name}" - material_constants += f"#[allow(dead_code, non_upper_case_globals)] const {constant}: &[(crate::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 data: - variant = common.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"crate::Item::{kind}," - - if len(ht) == 0: - harvest_tools[variant] = 'None' - else: - harvest_tools[variant] = f""" - const TOOLS: &[crate::Item] = &[{ht}]; - Some(TOOLS) - """ - -output = "#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive)]" + common.generate_enum("BlockKind", blocks) -output += common.generate_enum_property("BlockKind", "id", "u32", ids, True) -output += common.generate_enum_property("BlockKind", "name", "&str", names, True, "&'static str") -output += common.generate_enum_property("BlockKind", "display_name", "&str", display_names, True, "&'static str") -output += common.generate_enum_property("BlockKind", "hardness", "f32", hardnesses) -output += common.generate_enum_property("BlockKind", "diggable", "bool", diggables) -output += common.generate_enum_property("BlockKind", "transparent", "bool", transparents) -output += common.generate_enum_property("BlockKind", "light_emission", "u8", light_emissions) -output += common.generate_enum_property("BlockKind", "light_filter", "u8", light_filters) -output += common.generate_enum_property("BlockKind", "solid", "bool", solids) -output += material_constants -output += common.generate_enum_property("BlockKind", "dig_multipliers", "&'static [(crate::Item, f32)]", dig_multipliers) -output += common.generate_enum_property("BlockKind", "harvest_tools", "Option<&'static [crate::Item]>", harvest_tools) - -common.output("src/block.rs", output) diff --git a/feather/generated/generators/common.py b/feather/generated/generators/common.py deleted file mode 100644 index 8a16c20bb..000000000 --- a/feather/generated/generators/common.py +++ /dev/null @@ -1,126 +0,0 @@ -# Common code shared by most code generators. - -import subprocess -import json -from re import split - - -# Runs rustfmt on a file. -def rustfmt(file_path): - subprocess.run(["rustfmt", file_path]) - - -PRISMARINEJS_BASE_PATH = "../../minecraft-data/data/pc" -FEATHER_BASE_PATH = "feather" - - -# Loads in a JSON file from the minecraft-data file with the given name. -def load_minecraft_json(name, version="1.16.1"): - file = open(f'{PRISMARINEJS_BASE_PATH}/{version}/{name}') - return json.load(file) - - -# Loads in a JSON file from the feather file with the given name. -def load_feather_json(name): - file = open(f"{FEATHER_BASE_PATH}/{name}") - return json.load(file) - - -# Writes Rust source to an output file, then runs rustfmt. -def output(path, content): - f = open(path, "w") - f.write("// This file is @generated. Please do not edit.\n") - f.write(content) - f.close() - - rustfmt(path) - - -# Generate two functions for an enum, one which maps -# the enum value to some property value and one which -# does the reverse (returning an Option). -def generate_enum_property( - enum, # Identifier of the enum (e.g. "Biome") - property_name, # Name of the property - type_, # The property type (e.g. u32, &str - mapping, # Dictionary mapping from enum variant name => property value expression - reverse=False, # Whether to generate the reverse mapping (property value => Self) - return_type=None, - # Property type that should be returned. This is used when the type has a lifetime, such as &'static str - needs_bindings=False, # Whether to bind enum fields using Enum::Variant { .. } -): - 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 - - -# Generates an enum definition with the provided variants. -def generate_enum(name, variants): - body = "" - for variant in variants: - body += f"{variant}," - - return f""" - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] - pub enum {name} {{ - {body} - }} - """ - - -# Converts a string to UpperCamelCase. -def camel_case(string): - return ''.join(a.capitalize() for a in split('([^a-zA-Z0-9])', string) - if a.isalnum()) diff --git a/feather/generated/generators/entity.py b/feather/generated/generators/entity.py deleted file mode 100644 index 8c3f6b67d..000000000 --- a/feather/generated/generators/entity.py +++ /dev/null @@ -1,31 +0,0 @@ -import common - -data = common.load_minecraft_json("entities.json", "1.16.2") - -entities = [] -ids = {} -internal_ids = {} -names = {} -display_names = {} -bboxes = {} - -for entity in data: - variant = common.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 = common.generate_enum("EntityKind", entities) -output += common.generate_enum_property("EntityKind", "id", "u32", ids, True) -output += common.generate_enum_property("EntityKind", "internal_id", "u32", internal_ids, True) -output += common.generate_enum_property("EntityKind", "name", "&str", names, True, "&'static str") -output += common.generate_enum_property("EntityKind", "display_name", "&str", display_names, True, "&'static str") -output += common.generate_enum_property("EntityKind", "bounding_box", "vek::Aabb", bboxes) - -common.output("src/entity.rs", output) diff --git a/feather/generated/generators/item.py b/feather/generated/generators/item.py deleted file mode 100644 index 207aa8554..000000000 --- a/feather/generated/generators/item.py +++ /dev/null @@ -1,33 +0,0 @@ -import common - -data = common.load_minecraft_json("items.json", "1.16.2") - -items = [] -ids = {} -names = {} -display_names = {} -stack_sizes = {} -durabilities = {} - -for item in data: - variant = common.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 = common.generate_enum("Item", items) -output += common.generate_enum_property("Item", "id", "u32", ids, True) -output += common.generate_enum_property("Item", "name", "&str", names, True, "&'static str") -output += common.generate_enum_property("Item", "display_name", "&str", display_names, True, "&'static str") -output += common.generate_enum_property("Item", "stack_size", "u32", stack_sizes) -output += common.generate_enum_property("Item", "durability", "Option", durabilities) - -common.output("src/item.rs", output) diff --git a/feather/generated/generators/particle.py b/feather/generated/generators/particle.py deleted file mode 100644 index 0bc0fafb2..000000000 --- a/feather/generated/generators/particle.py +++ /dev/null @@ -1,19 +0,0 @@ -import common as common - -data = common.load_minecraft_json("particles.json", "1.16") - -particles = [] -ids = {} -names = {} - -for particle in data: - variant = common.camel_case(particle['name']) - particles.append(variant) - ids[variant] = particle['id'] - names[variant] = particle['name'] - -output = common.generate_enum("Particle", particles) -output += common.generate_enum_property("Particle", "id", "u32", ids, True) -output += common.generate_enum_property("Particle", "name", "&str", names, True, "&'static str") - -common.output("src/particle.rs", output) diff --git a/feather/generated/generators/simplified_block.py b/feather/generated/generators/simplified_block.py deleted file mode 100644 index eb94f49f4..000000000 --- a/feather/generated/generators/simplified_block.py +++ /dev/null @@ -1,35 +0,0 @@ -import common -import re - -blocks = common.load_minecraft_json("blocks.json") -simplified_block = common.load_feather_json("simplified_block.json") - -regexes = {} -for name, regex in simplified_block['regexes'].items(): - regexes[name] = re.compile(regex) - -variants = [] -mapping = {} -for name in regexes: - variants.append(common.camel_case(name)) - -for block in blocks: - name = block['name'] - block_variant = common.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::" + common.camel_case(simplified) - found = True - break - - if not found: - # Default to block variant - variants.append(block_variant) - mapping[block_variant] = "SimplifiedBlockKind::" + block_variant - -output = "use crate::BlockKind;" + common.generate_enum("SimplifiedBlockKind", variants) -output += common.generate_enum_property("BlockKind", "simplified_kind", "SimplifiedBlockKind", mapping) -common.output("src/simplified_block.rs", output) diff --git a/feather/generated/regenerate.sh b/feather/generated/regenerate.sh deleted file mode 100755 index e9f24f3e3..000000000 --- a/feather/generated/regenerate.sh +++ /dev/null @@ -1,15 +0,0 @@ -generators=( - "biome" - "block" - "entity" - "inventory" - "item" - "particle" - "simplified_block" -) - -for generator in ${generators[@]}; do - python3 generators/$generator.py -done - -cargo fmt diff --git a/feather/generated/src/biome.rs b/feather/generated/src/biome.rs deleted file mode 100644 index 2b81c3bc5..000000000 --- a/feather/generated/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/feather/generated/src/block.rs b/feather/generated/src/block.rs deleted file mode 100644 index cfb4fad0e..000000000 --- a/feather/generated/src/block.rs +++ /dev/null @@ -1,13705 +0,0 @@ -// This file is @generated. Please do not edit. -#[derive( - num_derive::FromPrimitive, - num_derive::ToPrimitive, - Copy, - Clone, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, -)] -pub enum 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, - IronOre, - CoalOre, - 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, - Sponge, - WetSponge, - Glass, - LapisOre, - 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, - 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, - 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, - OakFenceGate, - BrickStairs, - StoneBrickStairs, - Mycelium, - LilyPad, - NetherBricks, - NetherBrickFence, - NetherBrickStairs, - NetherWart, - EnchantingTable, - BrewingStand, - Cauldron, - EndPortal, - EndPortalFrame, - EndStone, - DragonEgg, - RedstoneLamp, - Cocoa, - SandstoneStairs, - EmeraldOre, - 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, - 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, - GrassPath, - 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, -} - -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `id` property of this `BlockKind`. - 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, - } - } - - /// Gets a `BlockKind` by its `id`. - 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), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `name` property of this `BlockKind`. - pub fn name(&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_ore", - BlockKind::LapisBlock => "lapis_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 => "gold_block", - BlockKind::IronBlock => "iron_block", - 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 => "diamond_block", - BlockKind::CraftingTable => "crafting_table", - BlockKind::Wheat => "wheat", - 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 => "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 => "vine", - 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 => "emerald_block", - 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 => "comparator", - BlockKind::DaylightDetector => "daylight_detector", - BlockKind::RedstoneBlock => "redstone_block", - BlockKind::NetherQuartzOre => "nether_quartz_ore", - BlockKind::Hopper => "hopper", - BlockKind::QuartzBlock => "quartz_block", - 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_block", - 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 => "coal_block", - 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", - 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_sapling", - 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", - BlockKind::Composter => "composter", - BlockKind::Target => "target", - BlockKind::BeeNest => "bee_nest", - BlockKind::Beehive => "beehive", - BlockKind::HoneyBlock => "honey_block", - BlockKind::HoneycombBlock => "honeycomb_block", - BlockKind::NetheriteBlock => "netherite_block", - 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", - } - } - - /// Gets a `BlockKind` by its `name`. - pub fn from_name(name: &str) -> Option { - match 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_ore" => Some(BlockKind::LapisOre), - "lapis_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), - "gold_block" => Some(BlockKind::GoldBlock), - "iron_block" => 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), - "diamond_block" => Some(BlockKind::DiamondBlock), - "crafting_table" => Some(BlockKind::CraftingTable), - "wheat" => 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), - "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), - "vine" => 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), - "emerald_block" => 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), - "comparator" => Some(BlockKind::Comparator), - "daylight_detector" => Some(BlockKind::DaylightDetector), - "redstone_block" => Some(BlockKind::RedstoneBlock), - "nether_quartz_ore" => Some(BlockKind::NetherQuartzOre), - "hopper" => Some(BlockKind::Hopper), - "quartz_block" => 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_block" => 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), - "coal_block" => 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" => 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_sapling" => 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" => 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), - "netherite_block" => 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" => { - 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" => { - 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), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `display_name` property of this `BlockKind`. - pub fn display_name(&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", - } - } - - /// 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" => { - 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" => { - 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), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `hardness` property of this `BlockKind`. - 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, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `diggable` property of this `BlockKind`. - pub fn diggable(&self) -> bool { - match self { - BlockKind::Air => true, - 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, - BlockKind::SprucePlanks => true, - BlockKind::BirchPlanks => true, - BlockKind::JunglePlanks => true, - BlockKind::AcaciaPlanks => true, - BlockKind::DarkOakPlanks => true, - BlockKind::OakSapling => true, - BlockKind::SpruceSapling => true, - BlockKind::BirchSapling => true, - BlockKind::JungleSapling => true, - BlockKind::AcaciaSapling => true, - BlockKind::DarkOakSapling => true, - BlockKind::Bedrock => false, - BlockKind::Water => false, - BlockKind::Lava => false, - BlockKind::Sand => true, - BlockKind::RedSand => true, - BlockKind::Gravel => true, - BlockKind::GoldOre => true, - BlockKind::IronOre => true, - BlockKind::CoalOre => true, - BlockKind::NetherGoldOre => true, - BlockKind::OakLog => true, - BlockKind::SpruceLog => true, - BlockKind::BirchLog => true, - BlockKind::JungleLog => true, - BlockKind::AcaciaLog => true, - BlockKind::DarkOakLog => true, - BlockKind::StrippedSpruceLog => true, - BlockKind::StrippedBirchLog => true, - BlockKind::StrippedJungleLog => true, - BlockKind::StrippedAcaciaLog => true, - BlockKind::StrippedDarkOakLog => true, - BlockKind::StrippedOakLog => true, - BlockKind::OakWood => true, - BlockKind::SpruceWood => true, - BlockKind::BirchWood => true, - BlockKind::JungleWood => true, - BlockKind::AcaciaWood => true, - BlockKind::DarkOakWood => true, - BlockKind::StrippedOakWood => true, - BlockKind::StrippedSpruceWood => true, - BlockKind::StrippedBirchWood => true, - BlockKind::StrippedJungleWood => true, - BlockKind::StrippedAcaciaWood => true, - BlockKind::StrippedDarkOakWood => true, - BlockKind::OakLeaves => true, - BlockKind::SpruceLeaves => true, - BlockKind::BirchLeaves => true, - BlockKind::JungleLeaves => true, - BlockKind::AcaciaLeaves => true, - BlockKind::DarkOakLeaves => true, - BlockKind::Sponge => true, - BlockKind::WetSponge => true, - BlockKind::Glass => true, - BlockKind::LapisOre => true, - BlockKind::LapisBlock => true, - BlockKind::Dispenser => true, - BlockKind::Sandstone => true, - BlockKind::ChiseledSandstone => true, - BlockKind::CutSandstone => true, - BlockKind::NoteBlock => true, - BlockKind::WhiteBed => true, - BlockKind::OrangeBed => true, - BlockKind::MagentaBed => true, - BlockKind::LightBlueBed => true, - BlockKind::YellowBed => true, - BlockKind::LimeBed => true, - BlockKind::PinkBed => true, - BlockKind::GrayBed => true, - BlockKind::LightGrayBed => true, - BlockKind::CyanBed => true, - BlockKind::PurpleBed => true, - BlockKind::BlueBed => true, - BlockKind::BrownBed => true, - BlockKind::GreenBed => true, - BlockKind::RedBed => true, - BlockKind::BlackBed => true, - BlockKind::PoweredRail => true, - BlockKind::DetectorRail => true, - BlockKind::StickyPiston => true, - BlockKind::Cobweb => true, - BlockKind::Grass => true, - BlockKind::Fern => true, - BlockKind::DeadBush => true, - BlockKind::Seagrass => true, - BlockKind::TallSeagrass => true, - BlockKind::Piston => true, - BlockKind::PistonHead => true, - BlockKind::WhiteWool => true, - BlockKind::OrangeWool => true, - BlockKind::MagentaWool => true, - BlockKind::LightBlueWool => true, - BlockKind::YellowWool => true, - BlockKind::LimeWool => true, - BlockKind::PinkWool => true, - BlockKind::GrayWool => true, - BlockKind::LightGrayWool => true, - BlockKind::CyanWool => true, - BlockKind::PurpleWool => true, - BlockKind::BlueWool => true, - BlockKind::BrownWool => true, - BlockKind::GreenWool => true, - BlockKind::RedWool => true, - BlockKind::BlackWool => true, - BlockKind::MovingPiston => false, - BlockKind::Dandelion => true, - BlockKind::Poppy => true, - BlockKind::BlueOrchid => true, - BlockKind::Allium => true, - BlockKind::AzureBluet => true, - BlockKind::RedTulip => true, - BlockKind::OrangeTulip => true, - BlockKind::WhiteTulip => true, - BlockKind::PinkTulip => true, - BlockKind::OxeyeDaisy => true, - BlockKind::Cornflower => true, - BlockKind::WitherRose => true, - BlockKind::LilyOfTheValley => true, - BlockKind::BrownMushroom => true, - BlockKind::RedMushroom => true, - BlockKind::GoldBlock => true, - BlockKind::IronBlock => true, - BlockKind::Bricks => true, - BlockKind::Tnt => true, - BlockKind::Bookshelf => true, - BlockKind::MossyCobblestone => true, - BlockKind::Obsidian => true, - BlockKind::Torch => true, - BlockKind::WallTorch => true, - BlockKind::Fire => true, - BlockKind::SoulFire => true, - BlockKind::Spawner => true, - BlockKind::OakStairs => true, - BlockKind::Chest => true, - BlockKind::RedstoneWire => true, - BlockKind::DiamondOre => true, - BlockKind::DiamondBlock => true, - BlockKind::CraftingTable => true, - BlockKind::Wheat => true, - BlockKind::Farmland => true, - BlockKind::Furnace => true, - BlockKind::OakSign => true, - BlockKind::SpruceSign => true, - BlockKind::BirchSign => true, - BlockKind::AcaciaSign => true, - BlockKind::JungleSign => true, - BlockKind::DarkOakSign => true, - BlockKind::OakDoor => true, - BlockKind::Ladder => true, - BlockKind::Rail => true, - BlockKind::CobblestoneStairs => true, - BlockKind::OakWallSign => true, - BlockKind::SpruceWallSign => true, - BlockKind::BirchWallSign => true, - BlockKind::AcaciaWallSign => true, - BlockKind::JungleWallSign => true, - BlockKind::DarkOakWallSign => true, - BlockKind::Lever => true, - BlockKind::StonePressurePlate => true, - BlockKind::IronDoor => true, - BlockKind::OakPressurePlate => true, - BlockKind::SprucePressurePlate => true, - BlockKind::BirchPressurePlate => true, - BlockKind::JunglePressurePlate => true, - BlockKind::AcaciaPressurePlate => true, - BlockKind::DarkOakPressurePlate => true, - BlockKind::RedstoneOre => true, - BlockKind::RedstoneTorch => true, - BlockKind::RedstoneWallTorch => true, - BlockKind::StoneButton => true, - BlockKind::Snow => true, - BlockKind::Ice => true, - BlockKind::SnowBlock => true, - BlockKind::Cactus => true, - BlockKind::Clay => true, - BlockKind::SugarCane => true, - BlockKind::Jukebox => true, - BlockKind::OakFence => true, - BlockKind::Pumpkin => true, - BlockKind::Netherrack => true, - BlockKind::SoulSand => true, - BlockKind::SoulSoil => true, - BlockKind::Basalt => true, - BlockKind::PolishedBasalt => true, - BlockKind::SoulTorch => true, - BlockKind::SoulWallTorch => true, - BlockKind::Glowstone => true, - BlockKind::NetherPortal => false, - BlockKind::CarvedPumpkin => true, - BlockKind::JackOLantern => true, - BlockKind::Cake => true, - BlockKind::Repeater => true, - BlockKind::WhiteStainedGlass => true, - BlockKind::OrangeStainedGlass => true, - BlockKind::MagentaStainedGlass => true, - BlockKind::LightBlueStainedGlass => true, - BlockKind::YellowStainedGlass => true, - BlockKind::LimeStainedGlass => true, - BlockKind::PinkStainedGlass => true, - BlockKind::GrayStainedGlass => true, - BlockKind::LightGrayStainedGlass => true, - BlockKind::CyanStainedGlass => true, - BlockKind::PurpleStainedGlass => true, - BlockKind::BlueStainedGlass => true, - BlockKind::BrownStainedGlass => true, - BlockKind::GreenStainedGlass => true, - BlockKind::RedStainedGlass => true, - BlockKind::BlackStainedGlass => true, - BlockKind::OakTrapdoor => true, - BlockKind::SpruceTrapdoor => true, - BlockKind::BirchTrapdoor => true, - BlockKind::JungleTrapdoor => true, - BlockKind::AcaciaTrapdoor => true, - BlockKind::DarkOakTrapdoor => true, - BlockKind::StoneBricks => true, - BlockKind::MossyStoneBricks => true, - BlockKind::CrackedStoneBricks => true, - BlockKind::ChiseledStoneBricks => true, - BlockKind::InfestedStone => true, - BlockKind::InfestedCobblestone => true, - BlockKind::InfestedStoneBricks => true, - BlockKind::InfestedMossyStoneBricks => true, - BlockKind::InfestedCrackedStoneBricks => true, - BlockKind::InfestedChiseledStoneBricks => true, - BlockKind::BrownMushroomBlock => true, - BlockKind::RedMushroomBlock => true, - BlockKind::MushroomStem => true, - BlockKind::IronBars => true, - BlockKind::Chain => true, - BlockKind::GlassPane => true, - BlockKind::Melon => true, - 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::Mycelium => true, - BlockKind::LilyPad => true, - BlockKind::NetherBricks => true, - BlockKind::NetherBrickFence => true, - BlockKind::NetherBrickStairs => true, - BlockKind::NetherWart => true, - BlockKind::EnchantingTable => true, - BlockKind::BrewingStand => true, - BlockKind::Cauldron => true, - BlockKind::EndPortal => false, - BlockKind::EndPortalFrame => false, - BlockKind::EndStone => true, - BlockKind::DragonEgg => true, - BlockKind::RedstoneLamp => true, - BlockKind::Cocoa => true, - BlockKind::SandstoneStairs => true, - BlockKind::EmeraldOre => true, - BlockKind::EnderChest => true, - BlockKind::TripwireHook => true, - BlockKind::Tripwire => true, - BlockKind::EmeraldBlock => true, - BlockKind::SpruceStairs => true, - BlockKind::BirchStairs => true, - BlockKind::JungleStairs => true, - BlockKind::CommandBlock => false, - BlockKind::Beacon => true, - BlockKind::CobblestoneWall => true, - BlockKind::MossyCobblestoneWall => true, - BlockKind::FlowerPot => true, - BlockKind::PottedOakSapling => true, - BlockKind::PottedSpruceSapling => true, - BlockKind::PottedBirchSapling => true, - BlockKind::PottedJungleSapling => true, - BlockKind::PottedAcaciaSapling => true, - BlockKind::PottedDarkOakSapling => true, - BlockKind::PottedFern => true, - BlockKind::PottedDandelion => true, - BlockKind::PottedPoppy => true, - BlockKind::PottedBlueOrchid => true, - BlockKind::PottedAllium => true, - BlockKind::PottedAzureBluet => true, - BlockKind::PottedRedTulip => true, - BlockKind::PottedOrangeTulip => true, - BlockKind::PottedWhiteTulip => true, - BlockKind::PottedPinkTulip => true, - BlockKind::PottedOxeyeDaisy => true, - BlockKind::PottedCornflower => true, - BlockKind::PottedLilyOfTheValley => true, - BlockKind::PottedWitherRose => true, - BlockKind::PottedRedMushroom => true, - BlockKind::PottedBrownMushroom => true, - BlockKind::PottedDeadBush => true, - BlockKind::PottedCactus => true, - 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::LightWeightedPressurePlate => true, - BlockKind::HeavyWeightedPressurePlate => true, - BlockKind::Comparator => true, - BlockKind::DaylightDetector => true, - BlockKind::RedstoneBlock => true, - BlockKind::NetherQuartzOre => true, - BlockKind::Hopper => true, - BlockKind::QuartzBlock => true, - BlockKind::ChiseledQuartzBlock => true, - BlockKind::QuartzPillar => true, - BlockKind::QuartzStairs => true, - BlockKind::ActivatorRail => true, - BlockKind::Dropper => true, - BlockKind::WhiteTerracotta => true, - BlockKind::OrangeTerracotta => true, - BlockKind::MagentaTerracotta => true, - BlockKind::LightBlueTerracotta => true, - BlockKind::YellowTerracotta => true, - BlockKind::LimeTerracotta => true, - BlockKind::PinkTerracotta => true, - BlockKind::GrayTerracotta => true, - BlockKind::LightGrayTerracotta => true, - BlockKind::CyanTerracotta => true, - BlockKind::PurpleTerracotta => true, - BlockKind::BlueTerracotta => true, - BlockKind::BrownTerracotta => true, - BlockKind::GreenTerracotta => true, - BlockKind::RedTerracotta => true, - BlockKind::BlackTerracotta => true, - BlockKind::WhiteStainedGlassPane => true, - BlockKind::OrangeStainedGlassPane => true, - BlockKind::MagentaStainedGlassPane => true, - BlockKind::LightBlueStainedGlassPane => true, - BlockKind::YellowStainedGlassPane => true, - BlockKind::LimeStainedGlassPane => true, - BlockKind::PinkStainedGlassPane => true, - BlockKind::GrayStainedGlassPane => true, - BlockKind::LightGrayStainedGlassPane => true, - BlockKind::CyanStainedGlassPane => true, - BlockKind::PurpleStainedGlassPane => true, - BlockKind::BlueStainedGlassPane => true, - BlockKind::BrownStainedGlassPane => true, - BlockKind::GreenStainedGlassPane => true, - BlockKind::RedStainedGlassPane => true, - BlockKind::BlackStainedGlassPane => true, - BlockKind::AcaciaStairs => true, - BlockKind::DarkOakStairs => true, - BlockKind::SlimeBlock => true, - BlockKind::Barrier => false, - BlockKind::IronTrapdoor => true, - BlockKind::Prismarine => true, - BlockKind::PrismarineBricks => true, - BlockKind::DarkPrismarine => true, - BlockKind::PrismarineStairs => true, - BlockKind::PrismarineBrickStairs => true, - BlockKind::DarkPrismarineStairs => true, - BlockKind::PrismarineSlab => true, - BlockKind::PrismarineBrickSlab => true, - BlockKind::DarkPrismarineSlab => true, - BlockKind::SeaLantern => true, - BlockKind::HayBlock => true, - 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::Terracotta => true, - BlockKind::CoalBlock => true, - BlockKind::PackedIce => true, - BlockKind::Sunflower => true, - BlockKind::Lilac => true, - BlockKind::RoseBush => true, - BlockKind::Peony => true, - BlockKind::TallGrass => true, - BlockKind::LargeFern => true, - BlockKind::WhiteBanner => true, - BlockKind::OrangeBanner => true, - BlockKind::MagentaBanner => true, - BlockKind::LightBlueBanner => true, - BlockKind::YellowBanner => true, - BlockKind::LimeBanner => true, - BlockKind::PinkBanner => true, - BlockKind::GrayBanner => true, - BlockKind::LightGrayBanner => true, - BlockKind::CyanBanner => true, - BlockKind::PurpleBanner => true, - BlockKind::BlueBanner => true, - BlockKind::BrownBanner => true, - BlockKind::GreenBanner => true, - BlockKind::RedBanner => true, - BlockKind::BlackBanner => true, - BlockKind::WhiteWallBanner => true, - BlockKind::OrangeWallBanner => true, - BlockKind::MagentaWallBanner => true, - BlockKind::LightBlueWallBanner => true, - BlockKind::YellowWallBanner => true, - BlockKind::LimeWallBanner => true, - BlockKind::PinkWallBanner => true, - BlockKind::GrayWallBanner => true, - BlockKind::LightGrayWallBanner => true, - BlockKind::CyanWallBanner => true, - BlockKind::PurpleWallBanner => true, - BlockKind::BlueWallBanner => true, - BlockKind::BrownWallBanner => true, - BlockKind::GreenWallBanner => true, - BlockKind::RedWallBanner => true, - BlockKind::BlackWallBanner => true, - BlockKind::RedSandstone => true, - BlockKind::ChiseledRedSandstone => true, - BlockKind::CutRedSandstone => true, - 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::SmoothStone => true, - BlockKind::SmoothSandstone => true, - BlockKind::SmoothQuartz => true, - BlockKind::SmoothRedSandstone => true, - 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::SpruceDoor => true, - BlockKind::BirchDoor => true, - BlockKind::JungleDoor => true, - BlockKind::AcaciaDoor => true, - BlockKind::DarkOakDoor => true, - BlockKind::EndRod => true, - BlockKind::ChorusPlant => true, - BlockKind::ChorusFlower => true, - BlockKind::PurpurBlock => true, - BlockKind::PurpurPillar => true, - BlockKind::PurpurStairs => true, - BlockKind::EndStoneBricks => true, - BlockKind::Beetroots => true, - BlockKind::GrassPath => true, - BlockKind::EndGateway => false, - BlockKind::RepeatingCommandBlock => false, - BlockKind::ChainCommandBlock => false, - BlockKind::FrostedIce => true, - BlockKind::MagmaBlock => true, - BlockKind::NetherWartBlock => true, - BlockKind::RedNetherBricks => true, - BlockKind::BoneBlock => true, - BlockKind::StructureVoid => true, - BlockKind::Observer => true, - BlockKind::ShulkerBox => true, - BlockKind::WhiteShulkerBox => true, - BlockKind::OrangeShulkerBox => true, - BlockKind::MagentaShulkerBox => true, - BlockKind::LightBlueShulkerBox => true, - BlockKind::YellowShulkerBox => true, - BlockKind::LimeShulkerBox => true, - BlockKind::PinkShulkerBox => true, - BlockKind::GrayShulkerBox => true, - BlockKind::LightGrayShulkerBox => true, - BlockKind::CyanShulkerBox => true, - BlockKind::PurpleShulkerBox => true, - BlockKind::BlueShulkerBox => true, - BlockKind::BrownShulkerBox => true, - BlockKind::GreenShulkerBox => true, - BlockKind::RedShulkerBox => true, - BlockKind::BlackShulkerBox => true, - BlockKind::WhiteGlazedTerracotta => true, - BlockKind::OrangeGlazedTerracotta => true, - BlockKind::MagentaGlazedTerracotta => true, - BlockKind::LightBlueGlazedTerracotta => true, - BlockKind::YellowGlazedTerracotta => true, - BlockKind::LimeGlazedTerracotta => true, - BlockKind::PinkGlazedTerracotta => true, - BlockKind::GrayGlazedTerracotta => true, - BlockKind::LightGrayGlazedTerracotta => true, - BlockKind::CyanGlazedTerracotta => true, - BlockKind::PurpleGlazedTerracotta => true, - BlockKind::BlueGlazedTerracotta => true, - BlockKind::BrownGlazedTerracotta => true, - BlockKind::GreenGlazedTerracotta => true, - BlockKind::RedGlazedTerracotta => true, - BlockKind::BlackGlazedTerracotta => true, - BlockKind::WhiteConcrete => true, - BlockKind::OrangeConcrete => true, - BlockKind::MagentaConcrete => true, - BlockKind::LightBlueConcrete => true, - BlockKind::YellowConcrete => true, - BlockKind::LimeConcrete => true, - BlockKind::PinkConcrete => true, - BlockKind::GrayConcrete => true, - BlockKind::LightGrayConcrete => true, - BlockKind::CyanConcrete => true, - BlockKind::PurpleConcrete => true, - BlockKind::BlueConcrete => true, - BlockKind::BrownConcrete => true, - BlockKind::GreenConcrete => true, - BlockKind::RedConcrete => true, - BlockKind::BlackConcrete => true, - BlockKind::WhiteConcretePowder => true, - BlockKind::OrangeConcretePowder => true, - BlockKind::MagentaConcretePowder => true, - BlockKind::LightBlueConcretePowder => true, - BlockKind::YellowConcretePowder => true, - BlockKind::LimeConcretePowder => true, - BlockKind::PinkConcretePowder => true, - BlockKind::GrayConcretePowder => true, - BlockKind::LightGrayConcretePowder => true, - BlockKind::CyanConcretePowder => true, - BlockKind::PurpleConcretePowder => true, - BlockKind::BlueConcretePowder => true, - BlockKind::BrownConcretePowder => true, - BlockKind::GreenConcretePowder => true, - BlockKind::RedConcretePowder => true, - BlockKind::BlackConcretePowder => true, - BlockKind::Kelp => true, - BlockKind::KelpPlant => true, - BlockKind::DriedKelpBlock => true, - BlockKind::TurtleEgg => true, - BlockKind::DeadTubeCoralBlock => true, - BlockKind::DeadBrainCoralBlock => true, - BlockKind::DeadBubbleCoralBlock => true, - BlockKind::DeadFireCoralBlock => true, - BlockKind::DeadHornCoralBlock => true, - BlockKind::TubeCoralBlock => true, - BlockKind::BrainCoralBlock => true, - BlockKind::BubbleCoralBlock => true, - BlockKind::FireCoralBlock => true, - BlockKind::HornCoralBlock => true, - BlockKind::DeadTubeCoral => true, - BlockKind::DeadBrainCoral => true, - BlockKind::DeadBubbleCoral => true, - BlockKind::DeadFireCoral => true, - BlockKind::DeadHornCoral => true, - BlockKind::TubeCoral => true, - BlockKind::BrainCoral => true, - BlockKind::BubbleCoral => true, - BlockKind::FireCoral => true, - BlockKind::HornCoral => true, - BlockKind::DeadTubeCoralFan => true, - BlockKind::DeadBrainCoralFan => true, - BlockKind::DeadBubbleCoralFan => true, - BlockKind::DeadFireCoralFan => true, - BlockKind::DeadHornCoralFan => true, - BlockKind::TubeCoralFan => true, - BlockKind::BrainCoralFan => true, - BlockKind::BubbleCoralFan => true, - BlockKind::FireCoralFan => true, - BlockKind::HornCoralFan => true, - BlockKind::DeadTubeCoralWallFan => true, - BlockKind::DeadBrainCoralWallFan => true, - BlockKind::DeadBubbleCoralWallFan => true, - BlockKind::DeadFireCoralWallFan => true, - BlockKind::DeadHornCoralWallFan => true, - BlockKind::TubeCoralWallFan => true, - BlockKind::BrainCoralWallFan => true, - BlockKind::BubbleCoralWallFan => true, - BlockKind::FireCoralWallFan => true, - BlockKind::HornCoralWallFan => true, - BlockKind::SeaPickle => true, - BlockKind::BlueIce => true, - 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::Scaffolding => true, - BlockKind::Loom => true, - BlockKind::Barrel => true, - BlockKind::Smoker => true, - BlockKind::BlastFurnace => true, - BlockKind::CartographyTable => true, - BlockKind::FletchingTable => true, - BlockKind::Grindstone => true, - BlockKind::Lectern => true, - BlockKind::SmithingTable => true, - BlockKind::Stonecutter => true, - BlockKind::Bell => true, - BlockKind::Lantern => true, - BlockKind::SoulLantern => true, - BlockKind::Campfire => true, - BlockKind::SoulCampfire => true, - BlockKind::SweetBerryBush => true, - BlockKind::WarpedStem => true, - BlockKind::StrippedWarpedStem => true, - BlockKind::WarpedHyphae => true, - BlockKind::StrippedWarpedHyphae => true, - BlockKind::WarpedNylium => true, - BlockKind::WarpedFungus => true, - BlockKind::WarpedWartBlock => true, - BlockKind::WarpedRoots => true, - BlockKind::NetherSprouts => true, - BlockKind::CrimsonStem => true, - BlockKind::StrippedCrimsonStem => true, - BlockKind::CrimsonHyphae => true, - BlockKind::StrippedCrimsonHyphae => true, - BlockKind::CrimsonNylium => true, - BlockKind::CrimsonFungus => true, - BlockKind::Shroomlight => true, - BlockKind::WeepingVines => true, - BlockKind::WeepingVinesPlant => true, - BlockKind::TwistingVines => true, - BlockKind::TwistingVinesPlant => true, - BlockKind::CrimsonRoots => true, - BlockKind::CrimsonPlanks => true, - BlockKind::WarpedPlanks => true, - BlockKind::CrimsonSlab => true, - BlockKind::WarpedSlab => true, - BlockKind::CrimsonPressurePlate => true, - BlockKind::WarpedPressurePlate => true, - BlockKind::CrimsonFence => true, - BlockKind::WarpedFence => true, - BlockKind::CrimsonTrapdoor => true, - BlockKind::WarpedTrapdoor => true, - BlockKind::CrimsonFenceGate => true, - BlockKind::WarpedFenceGate => true, - BlockKind::CrimsonStairs => true, - BlockKind::WarpedStairs => true, - BlockKind::CrimsonButton => true, - BlockKind::WarpedButton => true, - BlockKind::CrimsonDoor => true, - BlockKind::WarpedDoor => true, - BlockKind::CrimsonSign => true, - BlockKind::WarpedSign => true, - BlockKind::CrimsonWallSign => true, - BlockKind::WarpedWallSign => true, - BlockKind::StructureBlock => false, - BlockKind::Jigsaw => false, - BlockKind::Composter => true, - BlockKind::Target => true, - BlockKind::BeeNest => true, - BlockKind::Beehive => true, - BlockKind::HoneyBlock => true, - BlockKind::HoneycombBlock => true, - BlockKind::NetheriteBlock => true, - BlockKind::AncientDebris => true, - BlockKind::CryingObsidian => true, - BlockKind::RespawnAnchor => true, - BlockKind::PottedCrimsonFungus => true, - BlockKind::PottedWarpedFungus => true, - BlockKind::PottedCrimsonRoots => true, - BlockKind::PottedWarpedRoots => true, - BlockKind::Lodestone => true, - BlockKind::Blackstone => true, - BlockKind::BlackstoneStairs => true, - BlockKind::BlackstoneWall => true, - BlockKind::BlackstoneSlab => true, - BlockKind::PolishedBlackstone => true, - BlockKind::PolishedBlackstoneBricks => true, - BlockKind::CrackedPolishedBlackstoneBricks => true, - BlockKind::ChiseledPolishedBlackstone => true, - BlockKind::PolishedBlackstoneBrickSlab => true, - BlockKind::PolishedBlackstoneBrickStairs => true, - BlockKind::PolishedBlackstoneBrickWall => true, - BlockKind::GildedBlackstone => true, - BlockKind::PolishedBlackstoneStairs => true, - BlockKind::PolishedBlackstoneSlab => true, - BlockKind::PolishedBlackstonePressurePlate => true, - BlockKind::PolishedBlackstoneButton => true, - BlockKind::PolishedBlackstoneWall => true, - BlockKind::ChiseledNetherBricks => true, - BlockKind::CrackedNetherBricks => true, - BlockKind::QuartzBricks => true, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `transparent` property of this `BlockKind`. - pub fn transparent(&self) -> bool { - match self { - BlockKind::Air => true, - BlockKind::Stone => false, - BlockKind::Granite => false, - BlockKind::PolishedGranite => false, - BlockKind::Diorite => false, - BlockKind::PolishedDiorite => false, - BlockKind::Andesite => false, - BlockKind::PolishedAndesite => false, - BlockKind::GrassBlock => false, - BlockKind::Dirt => false, - BlockKind::CoarseDirt => false, - BlockKind::Podzol => false, - BlockKind::Cobblestone => false, - BlockKind::OakPlanks => false, - BlockKind::SprucePlanks => false, - BlockKind::BirchPlanks => false, - BlockKind::JunglePlanks => false, - BlockKind::AcaciaPlanks => false, - BlockKind::DarkOakPlanks => false, - BlockKind::OakSapling => true, - BlockKind::SpruceSapling => true, - BlockKind::BirchSapling => true, - BlockKind::JungleSapling => true, - BlockKind::AcaciaSapling => true, - BlockKind::DarkOakSapling => true, - BlockKind::Bedrock => false, - BlockKind::Water => true, - BlockKind::Lava => true, - BlockKind::Sand => false, - BlockKind::RedSand => false, - BlockKind::Gravel => false, - BlockKind::GoldOre => false, - BlockKind::IronOre => false, - BlockKind::CoalOre => false, - BlockKind::NetherGoldOre => false, - BlockKind::OakLog => false, - BlockKind::SpruceLog => false, - BlockKind::BirchLog => false, - BlockKind::JungleLog => false, - BlockKind::AcaciaLog => false, - BlockKind::DarkOakLog => false, - BlockKind::StrippedSpruceLog => false, - BlockKind::StrippedBirchLog => false, - BlockKind::StrippedJungleLog => false, - BlockKind::StrippedAcaciaLog => false, - BlockKind::StrippedDarkOakLog => false, - BlockKind::StrippedOakLog => false, - BlockKind::OakWood => false, - BlockKind::SpruceWood => false, - BlockKind::BirchWood => false, - BlockKind::JungleWood => false, - BlockKind::AcaciaWood => false, - BlockKind::DarkOakWood => false, - BlockKind::StrippedOakWood => false, - BlockKind::StrippedSpruceWood => false, - BlockKind::StrippedBirchWood => false, - BlockKind::StrippedJungleWood => false, - BlockKind::StrippedAcaciaWood => false, - BlockKind::StrippedDarkOakWood => false, - BlockKind::OakLeaves => true, - BlockKind::SpruceLeaves => true, - BlockKind::BirchLeaves => true, - BlockKind::JungleLeaves => true, - BlockKind::AcaciaLeaves => true, - BlockKind::DarkOakLeaves => true, - BlockKind::Sponge => false, - BlockKind::WetSponge => false, - BlockKind::Glass => true, - BlockKind::LapisOre => false, - BlockKind::LapisBlock => false, - BlockKind::Dispenser => false, - BlockKind::Sandstone => false, - BlockKind::ChiseledSandstone => false, - BlockKind::CutSandstone => false, - BlockKind::NoteBlock => false, - BlockKind::WhiteBed => true, - BlockKind::OrangeBed => true, - BlockKind::MagentaBed => true, - BlockKind::LightBlueBed => true, - BlockKind::YellowBed => true, - BlockKind::LimeBed => true, - BlockKind::PinkBed => true, - BlockKind::GrayBed => true, - BlockKind::LightGrayBed => true, - BlockKind::CyanBed => true, - BlockKind::PurpleBed => true, - BlockKind::BlueBed => true, - BlockKind::BrownBed => true, - BlockKind::GreenBed => true, - BlockKind::RedBed => true, - BlockKind::BlackBed => true, - BlockKind::PoweredRail => true, - BlockKind::DetectorRail => true, - BlockKind::StickyPiston => true, - BlockKind::Cobweb => true, - BlockKind::Grass => false, - BlockKind::Fern => true, - BlockKind::DeadBush => true, - BlockKind::Seagrass => true, - BlockKind::TallSeagrass => true, - BlockKind::Piston => true, - BlockKind::PistonHead => true, - BlockKind::WhiteWool => false, - BlockKind::OrangeWool => false, - BlockKind::MagentaWool => false, - BlockKind::LightBlueWool => false, - BlockKind::YellowWool => false, - BlockKind::LimeWool => false, - BlockKind::PinkWool => false, - BlockKind::GrayWool => false, - BlockKind::LightGrayWool => false, - BlockKind::CyanWool => false, - BlockKind::PurpleWool => false, - BlockKind::BlueWool => false, - BlockKind::BrownWool => false, - BlockKind::GreenWool => false, - BlockKind::RedWool => false, - BlockKind::BlackWool => false, - BlockKind::MovingPiston => true, - BlockKind::Dandelion => false, - BlockKind::Poppy => false, - BlockKind::BlueOrchid => true, - BlockKind::Allium => false, - BlockKind::AzureBluet => false, - BlockKind::RedTulip => true, - BlockKind::OrangeTulip => true, - BlockKind::WhiteTulip => true, - BlockKind::PinkTulip => true, - BlockKind::OxeyeDaisy => false, - BlockKind::Cornflower => true, - BlockKind::WitherRose => true, - BlockKind::LilyOfTheValley => true, - BlockKind::BrownMushroom => false, - BlockKind::RedMushroom => false, - BlockKind::GoldBlock => false, - BlockKind::IronBlock => false, - BlockKind::Bricks => false, - BlockKind::Tnt => true, - BlockKind::Bookshelf => false, - BlockKind::MossyCobblestone => false, - BlockKind::Obsidian => false, - BlockKind::Torch => true, - BlockKind::WallTorch => true, - BlockKind::Fire => true, - BlockKind::SoulFire => true, - BlockKind::Spawner => true, - BlockKind::OakStairs => true, - BlockKind::Chest => true, - BlockKind::RedstoneWire => true, - BlockKind::DiamondOre => false, - BlockKind::DiamondBlock => false, - BlockKind::CraftingTable => false, - BlockKind::Wheat => true, - BlockKind::Farmland => true, - BlockKind::Furnace => true, - BlockKind::OakSign => true, - BlockKind::SpruceSign => true, - BlockKind::BirchSign => true, - BlockKind::AcaciaSign => true, - BlockKind::JungleSign => true, - BlockKind::DarkOakSign => true, - BlockKind::OakDoor => true, - BlockKind::Ladder => true, - BlockKind::Rail => true, - BlockKind::CobblestoneStairs => true, - BlockKind::OakWallSign => true, - BlockKind::SpruceWallSign => true, - BlockKind::BirchWallSign => true, - BlockKind::AcaciaWallSign => true, - BlockKind::JungleWallSign => true, - BlockKind::DarkOakWallSign => true, - BlockKind::Lever => true, - BlockKind::StonePressurePlate => true, - BlockKind::IronDoor => true, - BlockKind::OakPressurePlate => true, - BlockKind::SprucePressurePlate => true, - BlockKind::BirchPressurePlate => true, - BlockKind::JunglePressurePlate => true, - BlockKind::AcaciaPressurePlate => true, - BlockKind::DarkOakPressurePlate => true, - BlockKind::RedstoneOre => true, - BlockKind::RedstoneTorch => true, - BlockKind::RedstoneWallTorch => true, - BlockKind::StoneButton => true, - BlockKind::Snow => false, - BlockKind::Ice => true, - BlockKind::SnowBlock => false, - BlockKind::Cactus => true, - BlockKind::Clay => false, - BlockKind::SugarCane => true, - BlockKind::Jukebox => false, - BlockKind::OakFence => true, - BlockKind::Pumpkin => true, - BlockKind::Netherrack => false, - BlockKind::SoulSand => false, - BlockKind::SoulSoil => false, - BlockKind::Basalt => false, - BlockKind::PolishedBasalt => false, - BlockKind::SoulTorch => true, - BlockKind::SoulWallTorch => true, - BlockKind::Glowstone => true, - BlockKind::NetherPortal => true, - BlockKind::CarvedPumpkin => true, - BlockKind::JackOLantern => true, - BlockKind::Cake => true, - BlockKind::Repeater => true, - BlockKind::WhiteStainedGlass => true, - BlockKind::OrangeStainedGlass => true, - BlockKind::MagentaStainedGlass => true, - BlockKind::LightBlueStainedGlass => true, - BlockKind::YellowStainedGlass => true, - BlockKind::LimeStainedGlass => true, - BlockKind::PinkStainedGlass => true, - BlockKind::GrayStainedGlass => true, - BlockKind::LightGrayStainedGlass => true, - BlockKind::CyanStainedGlass => true, - BlockKind::PurpleStainedGlass => true, - BlockKind::BlueStainedGlass => true, - BlockKind::BrownStainedGlass => true, - BlockKind::GreenStainedGlass => true, - BlockKind::RedStainedGlass => true, - BlockKind::BlackStainedGlass => true, - BlockKind::OakTrapdoor => true, - BlockKind::SpruceTrapdoor => true, - BlockKind::BirchTrapdoor => true, - BlockKind::JungleTrapdoor => true, - BlockKind::AcaciaTrapdoor => true, - BlockKind::DarkOakTrapdoor => true, - BlockKind::StoneBricks => false, - BlockKind::MossyStoneBricks => false, - BlockKind::CrackedStoneBricks => false, - BlockKind::ChiseledStoneBricks => false, - BlockKind::InfestedStone => false, - BlockKind::InfestedCobblestone => false, - BlockKind::InfestedStoneBricks => false, - BlockKind::InfestedMossyStoneBricks => false, - BlockKind::InfestedCrackedStoneBricks => false, - BlockKind::InfestedChiseledStoneBricks => false, - BlockKind::BrownMushroomBlock => false, - BlockKind::RedMushroomBlock => false, - BlockKind::MushroomStem => false, - BlockKind::IronBars => true, - BlockKind::Chain => true, - BlockKind::GlassPane => true, - BlockKind::Melon => true, - 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::Mycelium => false, - BlockKind::LilyPad => true, - BlockKind::NetherBricks => false, - BlockKind::NetherBrickFence => true, - BlockKind::NetherBrickStairs => true, - BlockKind::NetherWart => true, - BlockKind::EnchantingTable => true, - BlockKind::BrewingStand => true, - BlockKind::Cauldron => true, - BlockKind::EndPortal => true, - BlockKind::EndPortalFrame => true, - BlockKind::EndStone => false, - BlockKind::DragonEgg => true, - BlockKind::RedstoneLamp => true, - BlockKind::Cocoa => true, - BlockKind::SandstoneStairs => true, - BlockKind::EmeraldOre => false, - BlockKind::EnderChest => true, - BlockKind::TripwireHook => true, - BlockKind::Tripwire => true, - BlockKind::EmeraldBlock => false, - BlockKind::SpruceStairs => true, - BlockKind::BirchStairs => true, - BlockKind::JungleStairs => true, - BlockKind::CommandBlock => false, - BlockKind::Beacon => true, - BlockKind::CobblestoneWall => true, - BlockKind::MossyCobblestoneWall => true, - BlockKind::FlowerPot => true, - BlockKind::PottedOakSapling => true, - BlockKind::PottedSpruceSapling => true, - BlockKind::PottedBirchSapling => true, - BlockKind::PottedJungleSapling => true, - BlockKind::PottedAcaciaSapling => true, - BlockKind::PottedDarkOakSapling => true, - BlockKind::PottedFern => true, - BlockKind::PottedDandelion => true, - BlockKind::PottedPoppy => true, - BlockKind::PottedBlueOrchid => true, - BlockKind::PottedAllium => true, - BlockKind::PottedAzureBluet => true, - BlockKind::PottedRedTulip => true, - BlockKind::PottedOrangeTulip => true, - BlockKind::PottedWhiteTulip => true, - BlockKind::PottedPinkTulip => true, - BlockKind::PottedOxeyeDaisy => true, - BlockKind::PottedCornflower => true, - BlockKind::PottedLilyOfTheValley => true, - BlockKind::PottedWitherRose => true, - BlockKind::PottedRedMushroom => true, - BlockKind::PottedBrownMushroom => true, - BlockKind::PottedDeadBush => true, - BlockKind::PottedCactus => true, - BlockKind::Carrots => false, - BlockKind::Potatoes => false, - 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::LightWeightedPressurePlate => true, - BlockKind::HeavyWeightedPressurePlate => true, - BlockKind::Comparator => true, - BlockKind::DaylightDetector => true, - BlockKind::RedstoneBlock => true, - BlockKind::NetherQuartzOre => false, - BlockKind::Hopper => true, - BlockKind::QuartzBlock => false, - BlockKind::ChiseledQuartzBlock => false, - BlockKind::QuartzPillar => false, - BlockKind::QuartzStairs => true, - BlockKind::ActivatorRail => true, - BlockKind::Dropper => false, - BlockKind::WhiteTerracotta => false, - BlockKind::OrangeTerracotta => false, - BlockKind::MagentaTerracotta => false, - BlockKind::LightBlueTerracotta => false, - BlockKind::YellowTerracotta => false, - BlockKind::LimeTerracotta => false, - BlockKind::PinkTerracotta => false, - BlockKind::GrayTerracotta => false, - BlockKind::LightGrayTerracotta => false, - BlockKind::CyanTerracotta => false, - BlockKind::PurpleTerracotta => false, - BlockKind::BlueTerracotta => false, - BlockKind::BrownTerracotta => false, - BlockKind::GreenTerracotta => false, - BlockKind::RedTerracotta => false, - BlockKind::BlackTerracotta => false, - BlockKind::WhiteStainedGlassPane => true, - BlockKind::OrangeStainedGlassPane => true, - BlockKind::MagentaStainedGlassPane => true, - BlockKind::LightBlueStainedGlassPane => true, - BlockKind::YellowStainedGlassPane => true, - BlockKind::LimeStainedGlassPane => true, - BlockKind::PinkStainedGlassPane => true, - BlockKind::GrayStainedGlassPane => true, - BlockKind::LightGrayStainedGlassPane => true, - BlockKind::CyanStainedGlassPane => true, - BlockKind::PurpleStainedGlassPane => true, - BlockKind::BlueStainedGlassPane => true, - BlockKind::BrownStainedGlassPane => true, - BlockKind::GreenStainedGlassPane => true, - BlockKind::RedStainedGlassPane => true, - BlockKind::BlackStainedGlassPane => true, - BlockKind::AcaciaStairs => true, - BlockKind::DarkOakStairs => true, - BlockKind::SlimeBlock => true, - BlockKind::Barrier => 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::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::Terracotta => false, - BlockKind::CoalBlock => false, - BlockKind::PackedIce => false, - BlockKind::Sunflower => true, - BlockKind::Lilac => true, - BlockKind::RoseBush => true, - BlockKind::Peony => false, - BlockKind::TallGrass => true, - BlockKind::LargeFern => true, - BlockKind::WhiteBanner => true, - BlockKind::OrangeBanner => true, - BlockKind::MagentaBanner => true, - BlockKind::LightBlueBanner => true, - BlockKind::YellowBanner => true, - BlockKind::LimeBanner => true, - BlockKind::PinkBanner => true, - BlockKind::GrayBanner => true, - BlockKind::LightGrayBanner => true, - BlockKind::CyanBanner => true, - BlockKind::PurpleBanner => true, - BlockKind::BlueBanner => true, - BlockKind::BrownBanner => true, - BlockKind::GreenBanner => true, - BlockKind::RedBanner => true, - BlockKind::BlackBanner => true, - BlockKind::WhiteWallBanner => true, - BlockKind::OrangeWallBanner => true, - BlockKind::MagentaWallBanner => true, - BlockKind::LightBlueWallBanner => true, - BlockKind::YellowWallBanner => true, - BlockKind::LimeWallBanner => true, - BlockKind::PinkWallBanner => true, - BlockKind::GrayWallBanner => true, - BlockKind::LightGrayWallBanner => true, - BlockKind::CyanWallBanner => true, - BlockKind::PurpleWallBanner => true, - BlockKind::BlueWallBanner => true, - BlockKind::BrownWallBanner => true, - BlockKind::GreenWallBanner => true, - BlockKind::RedWallBanner => true, - BlockKind::BlackWallBanner => true, - 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::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::SpruceDoor => true, - BlockKind::BirchDoor => true, - BlockKind::JungleDoor => true, - BlockKind::AcaciaDoor => true, - BlockKind::DarkOakDoor => true, - BlockKind::EndRod => false, - BlockKind::ChorusPlant => true, - BlockKind::ChorusFlower => true, - BlockKind::PurpurBlock => false, - BlockKind::PurpurPillar => false, - BlockKind::PurpurStairs => true, - BlockKind::EndStoneBricks => false, - BlockKind::Beetroots => true, - BlockKind::GrassPath => true, - BlockKind::EndGateway => false, - BlockKind::RepeatingCommandBlock => false, - BlockKind::ChainCommandBlock => false, - BlockKind::FrostedIce => true, - BlockKind::MagmaBlock => false, - BlockKind::NetherWartBlock => false, - BlockKind::RedNetherBricks => false, - BlockKind::BoneBlock => false, - BlockKind::StructureVoid => false, - BlockKind::Observer => true, - BlockKind::ShulkerBox => true, - BlockKind::WhiteShulkerBox => true, - BlockKind::OrangeShulkerBox => true, - BlockKind::MagentaShulkerBox => true, - BlockKind::LightBlueShulkerBox => true, - BlockKind::YellowShulkerBox => true, - BlockKind::LimeShulkerBox => true, - BlockKind::PinkShulkerBox => true, - BlockKind::GrayShulkerBox => true, - BlockKind::LightGrayShulkerBox => true, - BlockKind::CyanShulkerBox => true, - BlockKind::PurpleShulkerBox => true, - BlockKind::BlueShulkerBox => true, - BlockKind::BrownShulkerBox => true, - BlockKind::GreenShulkerBox => true, - BlockKind::RedShulkerBox => true, - BlockKind::BlackShulkerBox => true, - BlockKind::WhiteGlazedTerracotta => false, - BlockKind::OrangeGlazedTerracotta => false, - BlockKind::MagentaGlazedTerracotta => false, - BlockKind::LightBlueGlazedTerracotta => false, - BlockKind::YellowGlazedTerracotta => false, - BlockKind::LimeGlazedTerracotta => false, - BlockKind::PinkGlazedTerracotta => false, - BlockKind::GrayGlazedTerracotta => false, - BlockKind::LightGrayGlazedTerracotta => false, - BlockKind::CyanGlazedTerracotta => false, - BlockKind::PurpleGlazedTerracotta => false, - BlockKind::BlueGlazedTerracotta => false, - BlockKind::BrownGlazedTerracotta => false, - BlockKind::GreenGlazedTerracotta => false, - BlockKind::RedGlazedTerracotta => false, - BlockKind::BlackGlazedTerracotta => false, - BlockKind::WhiteConcrete => false, - BlockKind::OrangeConcrete => false, - BlockKind::MagentaConcrete => false, - BlockKind::LightBlueConcrete => false, - BlockKind::YellowConcrete => false, - BlockKind::LimeConcrete => false, - BlockKind::PinkConcrete => false, - BlockKind::GrayConcrete => false, - BlockKind::LightGrayConcrete => false, - BlockKind::CyanConcrete => false, - BlockKind::PurpleConcrete => false, - BlockKind::BlueConcrete => false, - BlockKind::BrownConcrete => false, - BlockKind::GreenConcrete => false, - BlockKind::RedConcrete => false, - BlockKind::BlackConcrete => false, - BlockKind::WhiteConcretePowder => false, - BlockKind::OrangeConcretePowder => false, - BlockKind::MagentaConcretePowder => false, - BlockKind::LightBlueConcretePowder => false, - BlockKind::YellowConcretePowder => false, - BlockKind::LimeConcretePowder => false, - BlockKind::PinkConcretePowder => false, - BlockKind::GrayConcretePowder => false, - BlockKind::LightGrayConcretePowder => false, - BlockKind::CyanConcretePowder => false, - BlockKind::PurpleConcretePowder => false, - BlockKind::BlueConcretePowder => false, - BlockKind::BrownConcretePowder => false, - BlockKind::GreenConcretePowder => false, - BlockKind::RedConcretePowder => false, - BlockKind::BlackConcretePowder => false, - BlockKind::Kelp => true, - BlockKind::KelpPlant => true, - BlockKind::DriedKelpBlock => false, - BlockKind::TurtleEgg => false, - BlockKind::DeadTubeCoralBlock => false, - BlockKind::DeadBrainCoralBlock => false, - BlockKind::DeadBubbleCoralBlock => false, - BlockKind::DeadFireCoralBlock => false, - BlockKind::DeadHornCoralBlock => false, - BlockKind::TubeCoralBlock => false, - BlockKind::BrainCoralBlock => false, - BlockKind::BubbleCoralBlock => false, - BlockKind::FireCoralBlock => false, - BlockKind::HornCoralBlock => false, - BlockKind::DeadTubeCoral => true, - BlockKind::DeadBrainCoral => true, - BlockKind::DeadBubbleCoral => true, - BlockKind::DeadFireCoral => true, - BlockKind::DeadHornCoral => true, - BlockKind::TubeCoral => true, - BlockKind::BrainCoral => true, - BlockKind::BubbleCoral => true, - BlockKind::FireCoral => true, - BlockKind::HornCoral => true, - BlockKind::DeadTubeCoralFan => true, - BlockKind::DeadBrainCoralFan => true, - BlockKind::DeadBubbleCoralFan => true, - BlockKind::DeadFireCoralFan => true, - BlockKind::DeadHornCoralFan => true, - BlockKind::TubeCoralFan => true, - BlockKind::BrainCoralFan => true, - BlockKind::BubbleCoralFan => true, - BlockKind::FireCoralFan => true, - BlockKind::HornCoralFan => true, - BlockKind::DeadTubeCoralWallFan => true, - BlockKind::DeadBrainCoralWallFan => true, - BlockKind::DeadBubbleCoralWallFan => true, - BlockKind::DeadFireCoralWallFan => true, - BlockKind::DeadHornCoralWallFan => true, - BlockKind::TubeCoralWallFan => true, - BlockKind::BrainCoralWallFan => true, - BlockKind::BubbleCoralWallFan => true, - BlockKind::FireCoralWallFan => true, - BlockKind::HornCoralWallFan => true, - BlockKind::SeaPickle => false, - BlockKind::BlueIce => false, - BlockKind::Conduit => false, - BlockKind::BambooSapling => false, - BlockKind::Bamboo => false, - 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::Scaffolding => true, - BlockKind::Loom => false, - BlockKind::Barrel => true, - BlockKind::Smoker => true, - BlockKind::BlastFurnace => true, - BlockKind::CartographyTable => false, - BlockKind::FletchingTable => false, - BlockKind::Grindstone => true, - BlockKind::Lectern => false, - BlockKind::SmithingTable => false, - BlockKind::Stonecutter => false, - BlockKind::Bell => true, - BlockKind::Lantern => true, - BlockKind::SoulLantern => true, - BlockKind::Campfire => false, - BlockKind::SoulCampfire => false, - BlockKind::SweetBerryBush => true, - BlockKind::WarpedStem => false, - BlockKind::StrippedWarpedStem => false, - BlockKind::WarpedHyphae => false, - BlockKind::StrippedWarpedHyphae => false, - BlockKind::WarpedNylium => false, - BlockKind::WarpedFungus => true, - BlockKind::WarpedWartBlock => false, - BlockKind::WarpedRoots => true, - BlockKind::NetherSprouts => true, - BlockKind::CrimsonStem => false, - BlockKind::StrippedCrimsonStem => false, - BlockKind::CrimsonHyphae => false, - BlockKind::StrippedCrimsonHyphae => false, - BlockKind::CrimsonNylium => false, - BlockKind::CrimsonFungus => true, - BlockKind::Shroomlight => false, - BlockKind::WeepingVines => true, - BlockKind::WeepingVinesPlant => true, - BlockKind::TwistingVines => true, - BlockKind::TwistingVinesPlant => true, - BlockKind::CrimsonRoots => true, - BlockKind::CrimsonPlanks => false, - BlockKind::WarpedPlanks => false, - BlockKind::CrimsonSlab => true, - BlockKind::WarpedSlab => true, - BlockKind::CrimsonPressurePlate => true, - BlockKind::WarpedPressurePlate => true, - BlockKind::CrimsonFence => true, - BlockKind::WarpedFence => true, - BlockKind::CrimsonTrapdoor => true, - BlockKind::WarpedTrapdoor => true, - BlockKind::CrimsonFenceGate => true, - BlockKind::WarpedFenceGate => true, - BlockKind::CrimsonStairs => true, - BlockKind::WarpedStairs => true, - BlockKind::CrimsonButton => true, - BlockKind::WarpedButton => true, - BlockKind::CrimsonDoor => true, - BlockKind::WarpedDoor => true, - BlockKind::CrimsonSign => true, - BlockKind::WarpedSign => true, - BlockKind::CrimsonWallSign => true, - BlockKind::WarpedWallSign => true, - BlockKind::StructureBlock => false, - BlockKind::Jigsaw => false, - BlockKind::Composter => true, - BlockKind::Target => true, - BlockKind::BeeNest => false, - BlockKind::Beehive => false, - BlockKind::HoneyBlock => true, - BlockKind::HoneycombBlock => false, - BlockKind::NetheriteBlock => false, - BlockKind::AncientDebris => false, - BlockKind::CryingObsidian => false, - BlockKind::RespawnAnchor => false, - BlockKind::PottedCrimsonFungus => true, - BlockKind::PottedWarpedFungus => true, - BlockKind::PottedCrimsonRoots => true, - BlockKind::PottedWarpedRoots => true, - BlockKind::Lodestone => false, - BlockKind::Blackstone => false, - BlockKind::BlackstoneStairs => true, - BlockKind::BlackstoneWall => true, - BlockKind::BlackstoneSlab => true, - BlockKind::PolishedBlackstone => false, - BlockKind::PolishedBlackstoneBricks => false, - BlockKind::CrackedPolishedBlackstoneBricks => false, - BlockKind::ChiseledPolishedBlackstone => true, - BlockKind::PolishedBlackstoneBrickSlab => true, - BlockKind::PolishedBlackstoneBrickStairs => true, - BlockKind::PolishedBlackstoneBrickWall => true, - BlockKind::GildedBlackstone => false, - BlockKind::PolishedBlackstoneStairs => true, - BlockKind::PolishedBlackstoneSlab => true, - BlockKind::PolishedBlackstonePressurePlate => true, - BlockKind::PolishedBlackstoneButton => true, - BlockKind::PolishedBlackstoneWall => true, - BlockKind::ChiseledNetherBricks => false, - BlockKind::CrackedNetherBricks => false, - BlockKind::QuartzBricks => false, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `light_emission` property of this `BlockKind`. - pub fn light_emission(&self) -> u8 { - 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, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `light_filter` property of this `BlockKind`. - pub fn light_filter(&self) -> u8 { - 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, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `solid` property of this `BlockKind`. - 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, - BlockKind::SprucePlanks => true, - BlockKind::BirchPlanks => true, - BlockKind::JunglePlanks => true, - BlockKind::AcaciaPlanks => true, - BlockKind::DarkOakPlanks => true, - BlockKind::OakSapling => false, - BlockKind::SpruceSapling => false, - BlockKind::BirchSapling => false, - BlockKind::JungleSapling => false, - BlockKind::AcaciaSapling => false, - BlockKind::DarkOakSapling => false, - BlockKind::Bedrock => true, - BlockKind::Water => false, - BlockKind::Lava => false, - BlockKind::Sand => true, - BlockKind::RedSand => true, - BlockKind::Gravel => true, - BlockKind::GoldOre => true, - BlockKind::IronOre => true, - BlockKind::CoalOre => true, - BlockKind::NetherGoldOre => true, - BlockKind::OakLog => true, - BlockKind::SpruceLog => true, - BlockKind::BirchLog => true, - BlockKind::JungleLog => true, - BlockKind::AcaciaLog => true, - BlockKind::DarkOakLog => true, - BlockKind::StrippedSpruceLog => true, - BlockKind::StrippedBirchLog => true, - BlockKind::StrippedJungleLog => true, - BlockKind::StrippedAcaciaLog => true, - BlockKind::StrippedDarkOakLog => true, - BlockKind::StrippedOakLog => true, - BlockKind::OakWood => true, - BlockKind::SpruceWood => true, - BlockKind::BirchWood => true, - BlockKind::JungleWood => true, - BlockKind::AcaciaWood => true, - BlockKind::DarkOakWood => true, - BlockKind::StrippedOakWood => true, - BlockKind::StrippedSpruceWood => true, - BlockKind::StrippedBirchWood => true, - BlockKind::StrippedJungleWood => true, - BlockKind::StrippedAcaciaWood => true, - BlockKind::StrippedDarkOakWood => true, - BlockKind::OakLeaves => true, - BlockKind::SpruceLeaves => true, - BlockKind::BirchLeaves => true, - BlockKind::JungleLeaves => true, - BlockKind::AcaciaLeaves => true, - BlockKind::DarkOakLeaves => true, - BlockKind::Sponge => true, - BlockKind::WetSponge => true, - BlockKind::Glass => true, - BlockKind::LapisOre => true, - BlockKind::LapisBlock => true, - BlockKind::Dispenser => true, - BlockKind::Sandstone => true, - BlockKind::ChiseledSandstone => true, - BlockKind::CutSandstone => true, - BlockKind::NoteBlock => true, - BlockKind::WhiteBed => true, - BlockKind::OrangeBed => true, - BlockKind::MagentaBed => true, - BlockKind::LightBlueBed => true, - BlockKind::YellowBed => true, - BlockKind::LimeBed => true, - BlockKind::PinkBed => true, - BlockKind::GrayBed => true, - BlockKind::LightGrayBed => true, - BlockKind::CyanBed => true, - BlockKind::PurpleBed => true, - BlockKind::BlueBed => true, - BlockKind::BrownBed => true, - BlockKind::GreenBed => true, - BlockKind::RedBed => true, - BlockKind::BlackBed => true, - BlockKind::PoweredRail => false, - BlockKind::DetectorRail => false, - BlockKind::StickyPiston => true, - BlockKind::Cobweb => false, - BlockKind::Grass => false, - BlockKind::Fern => false, - BlockKind::DeadBush => false, - BlockKind::Seagrass => false, - BlockKind::TallSeagrass => false, - BlockKind::Piston => true, - BlockKind::PistonHead => true, - BlockKind::WhiteWool => true, - BlockKind::OrangeWool => true, - BlockKind::MagentaWool => true, - BlockKind::LightBlueWool => true, - BlockKind::YellowWool => true, - BlockKind::LimeWool => true, - BlockKind::PinkWool => true, - BlockKind::GrayWool => true, - BlockKind::LightGrayWool => true, - BlockKind::CyanWool => true, - BlockKind::PurpleWool => true, - BlockKind::BlueWool => true, - BlockKind::BrownWool => true, - BlockKind::GreenWool => true, - BlockKind::RedWool => true, - BlockKind::BlackWool => true, - BlockKind::MovingPiston => false, - BlockKind::Dandelion => false, - BlockKind::Poppy => false, - BlockKind::BlueOrchid => false, - BlockKind::Allium => false, - BlockKind::AzureBluet => false, - BlockKind::RedTulip => false, - BlockKind::OrangeTulip => false, - BlockKind::WhiteTulip => false, - BlockKind::PinkTulip => false, - BlockKind::OxeyeDaisy => false, - BlockKind::Cornflower => false, - BlockKind::WitherRose => false, - BlockKind::LilyOfTheValley => false, - BlockKind::BrownMushroom => false, - BlockKind::RedMushroom => false, - BlockKind::GoldBlock => true, - BlockKind::IronBlock => true, - BlockKind::Bricks => true, - BlockKind::Tnt => true, - BlockKind::Bookshelf => true, - BlockKind::MossyCobblestone => true, - BlockKind::Obsidian => true, - BlockKind::Torch => false, - BlockKind::WallTorch => false, - BlockKind::Fire => false, - BlockKind::SoulFire => false, - BlockKind::Spawner => true, - BlockKind::OakStairs => true, - BlockKind::Chest => true, - BlockKind::RedstoneWire => false, - BlockKind::DiamondOre => true, - BlockKind::DiamondBlock => true, - BlockKind::CraftingTable => true, - BlockKind::Wheat => false, - BlockKind::Farmland => true, - BlockKind::Furnace => true, - BlockKind::OakSign => false, - BlockKind::SpruceSign => false, - BlockKind::BirchSign => false, - BlockKind::AcaciaSign => false, - BlockKind::JungleSign => false, - BlockKind::DarkOakSign => false, - BlockKind::OakDoor => true, - BlockKind::Ladder => true, - BlockKind::Rail => false, - BlockKind::CobblestoneStairs => true, - BlockKind::OakWallSign => false, - BlockKind::SpruceWallSign => false, - BlockKind::BirchWallSign => false, - BlockKind::AcaciaWallSign => false, - BlockKind::JungleWallSign => false, - BlockKind::DarkOakWallSign => false, - BlockKind::Lever => false, - BlockKind::StonePressurePlate => false, - BlockKind::IronDoor => true, - BlockKind::OakPressurePlate => false, - BlockKind::SprucePressurePlate => false, - BlockKind::BirchPressurePlate => false, - BlockKind::JunglePressurePlate => false, - BlockKind::AcaciaPressurePlate => false, - BlockKind::DarkOakPressurePlate => false, - BlockKind::RedstoneOre => true, - BlockKind::RedstoneTorch => false, - BlockKind::RedstoneWallTorch => false, - BlockKind::StoneButton => false, - BlockKind::Snow => true, - BlockKind::Ice => true, - BlockKind::SnowBlock => true, - BlockKind::Cactus => true, - BlockKind::Clay => true, - BlockKind::SugarCane => false, - BlockKind::Jukebox => true, - BlockKind::OakFence => true, - BlockKind::Pumpkin => true, - BlockKind::Netherrack => true, - BlockKind::SoulSand => true, - BlockKind::SoulSoil => true, - BlockKind::Basalt => true, - BlockKind::PolishedBasalt => true, - BlockKind::SoulTorch => false, - BlockKind::SoulWallTorch => false, - BlockKind::Glowstone => true, - BlockKind::NetherPortal => false, - BlockKind::CarvedPumpkin => true, - BlockKind::JackOLantern => true, - BlockKind::Cake => true, - BlockKind::Repeater => true, - BlockKind::WhiteStainedGlass => true, - BlockKind::OrangeStainedGlass => true, - BlockKind::MagentaStainedGlass => true, - BlockKind::LightBlueStainedGlass => true, - BlockKind::YellowStainedGlass => true, - BlockKind::LimeStainedGlass => true, - BlockKind::PinkStainedGlass => true, - BlockKind::GrayStainedGlass => true, - BlockKind::LightGrayStainedGlass => true, - BlockKind::CyanStainedGlass => true, - BlockKind::PurpleStainedGlass => true, - BlockKind::BlueStainedGlass => true, - BlockKind::BrownStainedGlass => true, - BlockKind::GreenStainedGlass => true, - BlockKind::RedStainedGlass => true, - BlockKind::BlackStainedGlass => true, - BlockKind::OakTrapdoor => true, - BlockKind::SpruceTrapdoor => true, - BlockKind::BirchTrapdoor => true, - BlockKind::JungleTrapdoor => true, - BlockKind::AcaciaTrapdoor => true, - BlockKind::DarkOakTrapdoor => true, - BlockKind::StoneBricks => true, - BlockKind::MossyStoneBricks => true, - BlockKind::CrackedStoneBricks => true, - BlockKind::ChiseledStoneBricks => true, - BlockKind::InfestedStone => true, - BlockKind::InfestedCobblestone => true, - BlockKind::InfestedStoneBricks => true, - BlockKind::InfestedMossyStoneBricks => true, - BlockKind::InfestedCrackedStoneBricks => true, - BlockKind::InfestedChiseledStoneBricks => true, - BlockKind::BrownMushroomBlock => true, - BlockKind::RedMushroomBlock => true, - BlockKind::MushroomStem => true, - BlockKind::IronBars => true, - BlockKind::Chain => true, - BlockKind::GlassPane => true, - BlockKind::Melon => true, - BlockKind::AttachedPumpkinStem => false, - BlockKind::AttachedMelonStem => false, - BlockKind::PumpkinStem => false, - BlockKind::MelonStem => false, - BlockKind::Vine => false, - BlockKind::OakFenceGate => true, - BlockKind::BrickStairs => true, - BlockKind::StoneBrickStairs => true, - BlockKind::Mycelium => true, - BlockKind::LilyPad => true, - BlockKind::NetherBricks => true, - BlockKind::NetherBrickFence => true, - BlockKind::NetherBrickStairs => true, - BlockKind::NetherWart => false, - BlockKind::EnchantingTable => true, - BlockKind::BrewingStand => true, - BlockKind::Cauldron => true, - BlockKind::EndPortal => false, - BlockKind::EndPortalFrame => true, - BlockKind::EndStone => true, - BlockKind::DragonEgg => true, - BlockKind::RedstoneLamp => true, - BlockKind::Cocoa => true, - BlockKind::SandstoneStairs => true, - BlockKind::EmeraldOre => true, - BlockKind::EnderChest => true, - BlockKind::TripwireHook => false, - BlockKind::Tripwire => false, - BlockKind::EmeraldBlock => true, - BlockKind::SpruceStairs => true, - BlockKind::BirchStairs => true, - BlockKind::JungleStairs => true, - BlockKind::CommandBlock => true, - BlockKind::Beacon => true, - BlockKind::CobblestoneWall => true, - BlockKind::MossyCobblestoneWall => true, - BlockKind::FlowerPot => true, - BlockKind::PottedOakSapling => true, - BlockKind::PottedSpruceSapling => true, - BlockKind::PottedBirchSapling => true, - BlockKind::PottedJungleSapling => true, - BlockKind::PottedAcaciaSapling => true, - BlockKind::PottedDarkOakSapling => true, - BlockKind::PottedFern => true, - BlockKind::PottedDandelion => true, - BlockKind::PottedPoppy => true, - BlockKind::PottedBlueOrchid => true, - BlockKind::PottedAllium => true, - BlockKind::PottedAzureBluet => true, - BlockKind::PottedRedTulip => true, - BlockKind::PottedOrangeTulip => true, - BlockKind::PottedWhiteTulip => true, - BlockKind::PottedPinkTulip => true, - BlockKind::PottedOxeyeDaisy => true, - BlockKind::PottedCornflower => true, - BlockKind::PottedLilyOfTheValley => true, - BlockKind::PottedWitherRose => true, - BlockKind::PottedRedMushroom => true, - BlockKind::PottedBrownMushroom => true, - BlockKind::PottedDeadBush => true, - BlockKind::PottedCactus => true, - BlockKind::Carrots => false, - BlockKind::Potatoes => false, - BlockKind::OakButton => false, - BlockKind::SpruceButton => false, - BlockKind::BirchButton => false, - BlockKind::JungleButton => false, - BlockKind::AcaciaButton => false, - BlockKind::DarkOakButton => false, - 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::LightWeightedPressurePlate => false, - BlockKind::HeavyWeightedPressurePlate => false, - BlockKind::Comparator => true, - BlockKind::DaylightDetector => true, - BlockKind::RedstoneBlock => true, - BlockKind::NetherQuartzOre => true, - BlockKind::Hopper => true, - BlockKind::QuartzBlock => true, - BlockKind::ChiseledQuartzBlock => true, - BlockKind::QuartzPillar => true, - BlockKind::QuartzStairs => true, - BlockKind::ActivatorRail => false, - BlockKind::Dropper => true, - BlockKind::WhiteTerracotta => true, - BlockKind::OrangeTerracotta => true, - BlockKind::MagentaTerracotta => true, - BlockKind::LightBlueTerracotta => true, - BlockKind::YellowTerracotta => true, - BlockKind::LimeTerracotta => true, - BlockKind::PinkTerracotta => true, - BlockKind::GrayTerracotta => true, - BlockKind::LightGrayTerracotta => true, - BlockKind::CyanTerracotta => true, - BlockKind::PurpleTerracotta => true, - BlockKind::BlueTerracotta => true, - BlockKind::BrownTerracotta => true, - BlockKind::GreenTerracotta => true, - BlockKind::RedTerracotta => true, - BlockKind::BlackTerracotta => true, - BlockKind::WhiteStainedGlassPane => true, - BlockKind::OrangeStainedGlassPane => true, - BlockKind::MagentaStainedGlassPane => true, - BlockKind::LightBlueStainedGlassPane => true, - BlockKind::YellowStainedGlassPane => true, - BlockKind::LimeStainedGlassPane => true, - BlockKind::PinkStainedGlassPane => true, - BlockKind::GrayStainedGlassPane => true, - BlockKind::LightGrayStainedGlassPane => true, - BlockKind::CyanStainedGlassPane => true, - BlockKind::PurpleStainedGlassPane => true, - BlockKind::BlueStainedGlassPane => true, - BlockKind::BrownStainedGlassPane => true, - BlockKind::GreenStainedGlassPane => true, - BlockKind::RedStainedGlassPane => true, - BlockKind::BlackStainedGlassPane => true, - BlockKind::AcaciaStairs => true, - BlockKind::DarkOakStairs => true, - BlockKind::SlimeBlock => true, - BlockKind::Barrier => true, - BlockKind::IronTrapdoor => true, - BlockKind::Prismarine => true, - BlockKind::PrismarineBricks => true, - BlockKind::DarkPrismarine => true, - BlockKind::PrismarineStairs => true, - BlockKind::PrismarineBrickStairs => true, - BlockKind::DarkPrismarineStairs => true, - BlockKind::PrismarineSlab => true, - BlockKind::PrismarineBrickSlab => true, - BlockKind::DarkPrismarineSlab => true, - BlockKind::SeaLantern => true, - BlockKind::HayBlock => true, - 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::Terracotta => true, - BlockKind::CoalBlock => true, - BlockKind::PackedIce => true, - BlockKind::Sunflower => false, - BlockKind::Lilac => false, - BlockKind::RoseBush => false, - BlockKind::Peony => false, - BlockKind::TallGrass => false, - BlockKind::LargeFern => false, - BlockKind::WhiteBanner => false, - BlockKind::OrangeBanner => false, - BlockKind::MagentaBanner => false, - BlockKind::LightBlueBanner => false, - BlockKind::YellowBanner => false, - BlockKind::LimeBanner => false, - BlockKind::PinkBanner => false, - BlockKind::GrayBanner => false, - BlockKind::LightGrayBanner => false, - BlockKind::CyanBanner => false, - BlockKind::PurpleBanner => false, - BlockKind::BlueBanner => false, - BlockKind::BrownBanner => false, - BlockKind::GreenBanner => false, - BlockKind::RedBanner => false, - BlockKind::BlackBanner => false, - BlockKind::WhiteWallBanner => false, - BlockKind::OrangeWallBanner => false, - BlockKind::MagentaWallBanner => false, - BlockKind::LightBlueWallBanner => false, - BlockKind::YellowWallBanner => false, - BlockKind::LimeWallBanner => false, - BlockKind::PinkWallBanner => false, - BlockKind::GrayWallBanner => false, - BlockKind::LightGrayWallBanner => false, - BlockKind::CyanWallBanner => false, - BlockKind::PurpleWallBanner => false, - BlockKind::BlueWallBanner => false, - BlockKind::BrownWallBanner => false, - BlockKind::GreenWallBanner => false, - BlockKind::RedWallBanner => false, - BlockKind::BlackWallBanner => false, - BlockKind::RedSandstone => true, - BlockKind::ChiseledRedSandstone => true, - BlockKind::CutRedSandstone => true, - 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::SmoothStone => true, - BlockKind::SmoothSandstone => true, - BlockKind::SmoothQuartz => true, - BlockKind::SmoothRedSandstone => true, - 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::SpruceDoor => true, - BlockKind::BirchDoor => true, - BlockKind::JungleDoor => true, - BlockKind::AcaciaDoor => true, - BlockKind::DarkOakDoor => true, - BlockKind::EndRod => true, - BlockKind::ChorusPlant => true, - BlockKind::ChorusFlower => true, - BlockKind::PurpurBlock => true, - BlockKind::PurpurPillar => true, - BlockKind::PurpurStairs => true, - BlockKind::EndStoneBricks => true, - BlockKind::Beetroots => false, - BlockKind::GrassPath => true, - BlockKind::EndGateway => false, - BlockKind::RepeatingCommandBlock => true, - BlockKind::ChainCommandBlock => true, - BlockKind::FrostedIce => true, - BlockKind::MagmaBlock => true, - BlockKind::NetherWartBlock => true, - BlockKind::RedNetherBricks => true, - BlockKind::BoneBlock => true, - BlockKind::StructureVoid => false, - BlockKind::Observer => true, - BlockKind::ShulkerBox => true, - BlockKind::WhiteShulkerBox => true, - BlockKind::OrangeShulkerBox => true, - BlockKind::MagentaShulkerBox => true, - BlockKind::LightBlueShulkerBox => true, - BlockKind::YellowShulkerBox => true, - BlockKind::LimeShulkerBox => true, - BlockKind::PinkShulkerBox => true, - BlockKind::GrayShulkerBox => true, - BlockKind::LightGrayShulkerBox => true, - BlockKind::CyanShulkerBox => true, - BlockKind::PurpleShulkerBox => true, - BlockKind::BlueShulkerBox => true, - BlockKind::BrownShulkerBox => true, - BlockKind::GreenShulkerBox => true, - BlockKind::RedShulkerBox => true, - BlockKind::BlackShulkerBox => true, - BlockKind::WhiteGlazedTerracotta => true, - BlockKind::OrangeGlazedTerracotta => true, - BlockKind::MagentaGlazedTerracotta => true, - BlockKind::LightBlueGlazedTerracotta => true, - BlockKind::YellowGlazedTerracotta => true, - BlockKind::LimeGlazedTerracotta => true, - BlockKind::PinkGlazedTerracotta => true, - BlockKind::GrayGlazedTerracotta => true, - BlockKind::LightGrayGlazedTerracotta => true, - BlockKind::CyanGlazedTerracotta => true, - BlockKind::PurpleGlazedTerracotta => true, - BlockKind::BlueGlazedTerracotta => true, - BlockKind::BrownGlazedTerracotta => true, - BlockKind::GreenGlazedTerracotta => true, - BlockKind::RedGlazedTerracotta => true, - BlockKind::BlackGlazedTerracotta => true, - BlockKind::WhiteConcrete => true, - BlockKind::OrangeConcrete => true, - BlockKind::MagentaConcrete => true, - BlockKind::LightBlueConcrete => true, - BlockKind::YellowConcrete => true, - BlockKind::LimeConcrete => true, - BlockKind::PinkConcrete => true, - BlockKind::GrayConcrete => true, - BlockKind::LightGrayConcrete => true, - BlockKind::CyanConcrete => true, - BlockKind::PurpleConcrete => true, - BlockKind::BlueConcrete => true, - BlockKind::BrownConcrete => true, - BlockKind::GreenConcrete => true, - BlockKind::RedConcrete => true, - BlockKind::BlackConcrete => true, - BlockKind::WhiteConcretePowder => true, - BlockKind::OrangeConcretePowder => true, - BlockKind::MagentaConcretePowder => true, - BlockKind::LightBlueConcretePowder => true, - BlockKind::YellowConcretePowder => true, - BlockKind::LimeConcretePowder => true, - BlockKind::PinkConcretePowder => true, - BlockKind::GrayConcretePowder => true, - BlockKind::LightGrayConcretePowder => true, - BlockKind::CyanConcretePowder => true, - BlockKind::PurpleConcretePowder => true, - BlockKind::BlueConcretePowder => true, - BlockKind::BrownConcretePowder => true, - BlockKind::GreenConcretePowder => true, - BlockKind::RedConcretePowder => true, - BlockKind::BlackConcretePowder => true, - BlockKind::Kelp => false, - BlockKind::KelpPlant => false, - BlockKind::DriedKelpBlock => true, - BlockKind::TurtleEgg => true, - BlockKind::DeadTubeCoralBlock => true, - BlockKind::DeadBrainCoralBlock => true, - BlockKind::DeadBubbleCoralBlock => true, - BlockKind::DeadFireCoralBlock => true, - BlockKind::DeadHornCoralBlock => true, - BlockKind::TubeCoralBlock => true, - BlockKind::BrainCoralBlock => true, - BlockKind::BubbleCoralBlock => true, - BlockKind::FireCoralBlock => true, - BlockKind::HornCoralBlock => true, - BlockKind::DeadTubeCoral => false, - BlockKind::DeadBrainCoral => false, - BlockKind::DeadBubbleCoral => false, - BlockKind::DeadFireCoral => false, - BlockKind::DeadHornCoral => false, - BlockKind::TubeCoral => false, - BlockKind::BrainCoral => false, - BlockKind::BubbleCoral => false, - BlockKind::FireCoral => false, - BlockKind::HornCoral => false, - BlockKind::DeadTubeCoralFan => false, - BlockKind::DeadBrainCoralFan => false, - BlockKind::DeadBubbleCoralFan => false, - BlockKind::DeadFireCoralFan => false, - BlockKind::DeadHornCoralFan => false, - BlockKind::TubeCoralFan => false, - BlockKind::BrainCoralFan => false, - BlockKind::BubbleCoralFan => false, - BlockKind::FireCoralFan => false, - BlockKind::HornCoralFan => false, - BlockKind::DeadTubeCoralWallFan => false, - BlockKind::DeadBrainCoralWallFan => false, - BlockKind::DeadBubbleCoralWallFan => false, - BlockKind::DeadFireCoralWallFan => false, - BlockKind::DeadHornCoralWallFan => false, - BlockKind::TubeCoralWallFan => false, - BlockKind::BrainCoralWallFan => false, - BlockKind::BubbleCoralWallFan => false, - BlockKind::FireCoralWallFan => false, - BlockKind::HornCoralWallFan => false, - BlockKind::SeaPickle => true, - BlockKind::BlueIce => true, - BlockKind::Conduit => true, - BlockKind::BambooSapling => false, - BlockKind::Bamboo => true, - BlockKind::PottedBamboo => true, - BlockKind::VoidAir => false, - BlockKind::CaveAir => false, - BlockKind::BubbleColumn => false, - 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::Scaffolding => true, - BlockKind::Loom => true, - BlockKind::Barrel => true, - BlockKind::Smoker => true, - BlockKind::BlastFurnace => true, - BlockKind::CartographyTable => true, - BlockKind::FletchingTable => true, - BlockKind::Grindstone => true, - BlockKind::Lectern => true, - BlockKind::SmithingTable => true, - BlockKind::Stonecutter => true, - BlockKind::Bell => true, - BlockKind::Lantern => true, - BlockKind::SoulLantern => true, - BlockKind::Campfire => true, - BlockKind::SoulCampfire => true, - BlockKind::SweetBerryBush => false, - BlockKind::WarpedStem => true, - BlockKind::StrippedWarpedStem => true, - BlockKind::WarpedHyphae => true, - BlockKind::StrippedWarpedHyphae => true, - BlockKind::WarpedNylium => true, - BlockKind::WarpedFungus => false, - BlockKind::WarpedWartBlock => true, - BlockKind::WarpedRoots => false, - BlockKind::NetherSprouts => false, - BlockKind::CrimsonStem => true, - BlockKind::StrippedCrimsonStem => true, - BlockKind::CrimsonHyphae => true, - BlockKind::StrippedCrimsonHyphae => true, - BlockKind::CrimsonNylium => true, - BlockKind::CrimsonFungus => false, - BlockKind::Shroomlight => true, - BlockKind::WeepingVines => false, - BlockKind::WeepingVinesPlant => false, - BlockKind::TwistingVines => false, - BlockKind::TwistingVinesPlant => false, - BlockKind::CrimsonRoots => false, - BlockKind::CrimsonPlanks => true, - BlockKind::WarpedPlanks => true, - BlockKind::CrimsonSlab => true, - BlockKind::WarpedSlab => true, - BlockKind::CrimsonPressurePlate => false, - BlockKind::WarpedPressurePlate => false, - BlockKind::CrimsonFence => true, - BlockKind::WarpedFence => true, - BlockKind::CrimsonTrapdoor => true, - BlockKind::WarpedTrapdoor => true, - BlockKind::CrimsonFenceGate => true, - BlockKind::WarpedFenceGate => true, - BlockKind::CrimsonStairs => true, - BlockKind::WarpedStairs => true, - BlockKind::CrimsonButton => false, - BlockKind::WarpedButton => false, - BlockKind::CrimsonDoor => true, - BlockKind::WarpedDoor => true, - BlockKind::CrimsonSign => false, - BlockKind::WarpedSign => false, - BlockKind::CrimsonWallSign => false, - BlockKind::WarpedWallSign => false, - BlockKind::StructureBlock => true, - BlockKind::Jigsaw => true, - BlockKind::Composter => true, - BlockKind::Target => true, - BlockKind::BeeNest => true, - BlockKind::Beehive => true, - BlockKind::HoneyBlock => true, - BlockKind::HoneycombBlock => true, - BlockKind::NetheriteBlock => true, - BlockKind::AncientDebris => true, - BlockKind::CryingObsidian => true, - BlockKind::RespawnAnchor => true, - BlockKind::PottedCrimsonFungus => true, - BlockKind::PottedWarpedFungus => true, - BlockKind::PottedCrimsonRoots => true, - BlockKind::PottedWarpedRoots => true, - BlockKind::Lodestone => true, - BlockKind::Blackstone => true, - BlockKind::BlackstoneStairs => true, - BlockKind::BlackstoneWall => true, - BlockKind::BlackstoneSlab => true, - BlockKind::PolishedBlackstone => true, - BlockKind::PolishedBlackstoneBricks => true, - BlockKind::CrackedPolishedBlackstoneBricks => true, - BlockKind::ChiseledPolishedBlackstone => true, - BlockKind::PolishedBlackstoneBrickSlab => true, - BlockKind::PolishedBlackstoneBrickStairs => true, - BlockKind::PolishedBlackstoneBrickWall => true, - BlockKind::GildedBlackstone => true, - BlockKind::PolishedBlackstoneStairs => true, - BlockKind::PolishedBlackstoneSlab => true, - BlockKind::PolishedBlackstonePressurePlate => false, - BlockKind::PolishedBlackstoneButton => false, - BlockKind::PolishedBlackstoneWall => true, - BlockKind::ChiseledNetherBricks => true, - BlockKind::CrackedNetherBricks => true, - BlockKind::QuartzBricks => true, - } - } -} -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_rock: &[(crate::Item, f32)] = &[ - (crate::Item::IronPickaxe, 6.0 as f32), - (crate::Item::WoodenPickaxe, 2.0 as f32), - (crate::Item::StonePickaxe, 4.0 as f32), - (crate::Item::DiamondPickaxe, 8.0 as f32), - (crate::Item::NetheritePickaxe, 9.0 as f32), - (crate::Item::GoldenPickaxe, 12.0 as f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_wood: &[(crate::Item, f32)] = &[ - (crate::Item::IronAxe, 6.0 as f32), - (crate::Item::WoodenAxe, 2.0 as f32), - (crate::Item::StoneAxe, 4.0 as f32), - (crate::Item::DiamondAxe, 8.0 as f32), - (crate::Item::NetheriteAxe, 9.0 as f32), - (crate::Item::GoldenAxe, 12.0 as f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_plant: &[(crate::Item, f32)] = &[ - (crate::Item::IronAxe, 6.0 as f32), - (crate::Item::IronSword, 1.5 as f32), - (crate::Item::WoodenSword, 1.5 as f32), - (crate::Item::WoodenAxe, 2.0 as f32), - (crate::Item::StoneSword, 1.5 as f32), - (crate::Item::StoneAxe, 4.0 as f32), - (crate::Item::DiamondSword, 1.5 as f32), - (crate::Item::DiamondAxe, 8.0 as f32), - (crate::Item::NetheriteAxe, 9.0 as f32), - (crate::Item::NetheriteSword, 1.5 as f32), - (crate::Item::GoldenSword, 1.5 as f32), - (crate::Item::GoldenAxe, 12.0 as f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_melon: &[(crate::Item, f32)] = &[ - (crate::Item::IronSword, 1.5 as f32), - (crate::Item::WoodenSword, 1.5 as f32), - (crate::Item::StoneSword, 1.5 as f32), - (crate::Item::DiamondSword, 1.5 as f32), - (crate::Item::NetheriteSword, 1.5 as f32), - (crate::Item::GoldenSword, 1.5 as f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_leaves: &[(crate::Item, f32)] = &[ - (crate::Item::IronSword, 1.5 as f32), - (crate::Item::WoodenSword, 1.5 as f32), - (crate::Item::StoneSword, 1.5 as f32), - (crate::Item::DiamondSword, 1.5 as f32), - (crate::Item::GoldenSword, 1.5 as f32), - (crate::Item::NetheriteSword, 1.5 as f32), - (crate::Item::Shears, 6.0 as f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_dirt: &[(crate::Item, f32)] = &[ - (crate::Item::IronShovel, 6.0 as f32), - (crate::Item::WoodenShovel, 2.0 as f32), - (crate::Item::StoneShovel, 4.0 as f32), - (crate::Item::DiamondShovel, 8.0 as f32), - (crate::Item::NetheriteShovel, 9.0 as f32), - (crate::Item::GoldenShovel, 12.0 as f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_web: &[(crate::Item, f32)] = &[ - (crate::Item::IronSword, 15.0 as f32), - (crate::Item::WoodenSword, 15.0 as f32), - (crate::Item::StoneSword, 15.0 as f32), - (crate::Item::DiamondSword, 15.0 as f32), - (crate::Item::GoldenSword, 15.0 as f32), - (crate::Item::NetheriteSword, 15.0 as f32), - (crate::Item::Shears, 15.0 as f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_wool: &[(crate::Item, f32)] = &[(crate::Item::Shears, 4.8 as f32)]; -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `dig_multipliers` property of this `BlockKind`. - pub fn dig_multipliers(&self) -> &'static [(crate::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::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::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::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 => DIG_MULTIPLIERS_rock, - BlockKind::DetectorRail => DIG_MULTIPLIERS_rock, - 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::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::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::Tnt => &[], - BlockKind::Bookshelf => DIG_MULTIPLIERS_wood, - BlockKind::MossyCobblestone => DIG_MULTIPLIERS_rock, - BlockKind::Obsidian => DIG_MULTIPLIERS_rock, - BlockKind::Torch => &[], - BlockKind::WallTorch => &[], - BlockKind::Fire => &[], - BlockKind::SoulFire => &[], - BlockKind::Spawner => DIG_MULTIPLIERS_rock, - BlockKind::OakStairs => DIG_MULTIPLIERS_wood, - BlockKind::Chest => DIG_MULTIPLIERS_wood, - 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::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::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::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::SoulTorch => &[], - BlockKind::SoulWallTorch => &[], - BlockKind::Glowstone => &[], - BlockKind::NetherPortal => &[], - BlockKind::CarvedPumpkin => DIG_MULTIPLIERS_plant, - BlockKind::JackOLantern => DIG_MULTIPLIERS_plant, - 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 => 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::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::EndPortal => &[], - BlockKind::EndPortalFrame => &[], - BlockKind::EndStone => DIG_MULTIPLIERS_rock, - 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::TripwireHook => &[], - BlockKind::Tripwire => &[], - BlockKind::EmeraldBlock => DIG_MULTIPLIERS_rock, - BlockKind::SpruceStairs => DIG_MULTIPLIERS_wood, - BlockKind::BirchStairs => DIG_MULTIPLIERS_wood, - BlockKind::JungleStairs => DIG_MULTIPLIERS_wood, - BlockKind::CommandBlock => &[], - BlockKind::Beacon => &[], - BlockKind::CobblestoneWall => DIG_MULTIPLIERS_rock, - BlockKind::MossyCobblestoneWall => DIG_MULTIPLIERS_rock, - BlockKind::FlowerPot => &[], - BlockKind::PottedOakSapling => &[], - BlockKind::PottedSpruceSapling => &[], - BlockKind::PottedBirchSapling => &[], - BlockKind::PottedJungleSapling => &[], - BlockKind::PottedAcaciaSapling => &[], - BlockKind::PottedDarkOakSapling => &[], - BlockKind::PottedFern => &[], - BlockKind::PottedDandelion => DIG_MULTIPLIERS_plant, - 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 => 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::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 => 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::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::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 => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakStairs => DIG_MULTIPLIERS_wood, - 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::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 => 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::EndRod => &[], - BlockKind::ChorusPlant => &[], - BlockKind::ChorusFlower => &[], - BlockKind::PurpurBlock => &[], - BlockKind::PurpurPillar => &[], - BlockKind::PurpurStairs => DIG_MULTIPLIERS_rock, - BlockKind::EndStoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::Beetroots => &[], - BlockKind::GrassPath => DIG_MULTIPLIERS_dirt, - 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 => 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::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::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 => DIG_MULTIPLIERS_rock, - 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::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::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::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::CrimsonFungus => &[], - BlockKind::Shroomlight => &[], - BlockKind::WeepingVines => &[], - BlockKind::WeepingVinesPlant => &[], - 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::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::StructureBlock => &[], - BlockKind::Jigsaw => &[], - BlockKind::Composter => DIG_MULTIPLIERS_wood, - BlockKind::Target => &[], - BlockKind::BeeNest => DIG_MULTIPLIERS_wood, - BlockKind::Beehive => DIG_MULTIPLIERS_wood, - 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::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::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::PolishedBlackstoneButton => &[], - BlockKind::PolishedBlackstoneWall => DIG_MULTIPLIERS_rock, - BlockKind::ChiseledNetherBricks => DIG_MULTIPLIERS_rock, - BlockKind::CrackedNetherBricks => DIG_MULTIPLIERS_rock, - BlockKind::QuartzBricks => DIG_MULTIPLIERS_rock, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `harvest_tools` property of this `BlockKind`. - pub fn harvest_tools(&self) -> Option<&'static [crate::Item]> { - match self { - BlockKind::Air => None, - BlockKind::Stone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Granite => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedGranite => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Diorite => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedDiorite => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Andesite => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedAndesite => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GrassBlock => None, - BlockKind::Dirt => None, - BlockKind::CoarseDirt => None, - BlockKind::Podzol => None, - BlockKind::Cobblestone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OakPlanks => None, - BlockKind::SprucePlanks => None, - BlockKind::BirchPlanks => None, - BlockKind::JunglePlanks => None, - BlockKind::AcaciaPlanks => None, - BlockKind::DarkOakPlanks => None, - BlockKind::OakSapling => None, - BlockKind::SpruceSapling => None, - BlockKind::BirchSapling => None, - BlockKind::JungleSapling => None, - BlockKind::AcaciaSapling => None, - BlockKind::DarkOakSapling => None, - BlockKind::Bedrock => None, - BlockKind::Water => None, - BlockKind::Lava => None, - BlockKind::Sand => None, - BlockKind::RedSand => None, - BlockKind::Gravel => None, - BlockKind::GoldOre => { - const TOOLS: &[crate::Item] = - &[crate::Item::IronPickaxe, crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::IronOre => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CoalOre => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherGoldOre => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OakLog => None, - BlockKind::SpruceLog => None, - BlockKind::BirchLog => None, - BlockKind::JungleLog => None, - BlockKind::AcaciaLog => None, - BlockKind::DarkOakLog => None, - BlockKind::StrippedSpruceLog => None, - BlockKind::StrippedBirchLog => None, - BlockKind::StrippedJungleLog => None, - BlockKind::StrippedAcaciaLog => None, - BlockKind::StrippedDarkOakLog => None, - BlockKind::StrippedOakLog => None, - BlockKind::OakWood => None, - BlockKind::SpruceWood => None, - BlockKind::BirchWood => None, - BlockKind::JungleWood => None, - BlockKind::AcaciaWood => None, - BlockKind::DarkOakWood => None, - BlockKind::StrippedOakWood => None, - BlockKind::StrippedSpruceWood => None, - BlockKind::StrippedBirchWood => None, - BlockKind::StrippedJungleWood => None, - BlockKind::StrippedAcaciaWood => None, - BlockKind::StrippedDarkOakWood => None, - BlockKind::OakLeaves => None, - BlockKind::SpruceLeaves => None, - BlockKind::BirchLeaves => None, - BlockKind::JungleLeaves => None, - BlockKind::AcaciaLeaves => None, - BlockKind::DarkOakLeaves => None, - BlockKind::Sponge => None, - BlockKind::WetSponge => None, - BlockKind::Glass => None, - BlockKind::LapisOre => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LapisBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Dispenser => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Sandstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledSandstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CutSandstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NoteBlock => None, - BlockKind::WhiteBed => None, - BlockKind::OrangeBed => None, - BlockKind::MagentaBed => None, - BlockKind::LightBlueBed => None, - BlockKind::YellowBed => None, - BlockKind::LimeBed => None, - BlockKind::PinkBed => None, - BlockKind::GrayBed => None, - BlockKind::LightGrayBed => None, - BlockKind::CyanBed => None, - BlockKind::PurpleBed => None, - BlockKind::BlueBed => None, - BlockKind::BrownBed => None, - BlockKind::GreenBed => None, - BlockKind::RedBed => None, - BlockKind::BlackBed => None, - BlockKind::PoweredRail => None, - BlockKind::DetectorRail => None, - BlockKind::StickyPiston => None, - BlockKind::Cobweb => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronSword, - crate::Item::WoodenSword, - crate::Item::StoneSword, - crate::Item::DiamondSword, - crate::Item::GoldenSword, - crate::Item::Shears, - ]; - Some(TOOLS) - } - BlockKind::Grass => None, - BlockKind::Fern => None, - BlockKind::DeadBush => None, - BlockKind::Seagrass => None, - BlockKind::TallSeagrass => None, - BlockKind::Piston => None, - BlockKind::PistonHead => None, - BlockKind::WhiteWool => None, - BlockKind::OrangeWool => None, - BlockKind::MagentaWool => None, - BlockKind::LightBlueWool => None, - BlockKind::YellowWool => None, - BlockKind::LimeWool => None, - BlockKind::PinkWool => None, - BlockKind::GrayWool => None, - BlockKind::LightGrayWool => None, - BlockKind::CyanWool => None, - BlockKind::PurpleWool => None, - BlockKind::BlueWool => None, - BlockKind::BrownWool => None, - BlockKind::GreenWool => None, - BlockKind::RedWool => None, - BlockKind::BlackWool => None, - BlockKind::MovingPiston => None, - BlockKind::Dandelion => None, - BlockKind::Poppy => None, - BlockKind::BlueOrchid => None, - BlockKind::Allium => None, - BlockKind::AzureBluet => None, - BlockKind::RedTulip => None, - BlockKind::OrangeTulip => None, - BlockKind::WhiteTulip => None, - BlockKind::PinkTulip => None, - BlockKind::OxeyeDaisy => None, - BlockKind::Cornflower => None, - BlockKind::WitherRose => None, - BlockKind::LilyOfTheValley => None, - BlockKind::BrownMushroom => None, - BlockKind::RedMushroom => None, - BlockKind::GoldBlock => { - const TOOLS: &[crate::Item] = - &[crate::Item::IronPickaxe, crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::IronBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Bricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Tnt => None, - BlockKind::Bookshelf => None, - BlockKind::MossyCobblestone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Obsidian => { - const TOOLS: &[crate::Item] = &[crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::Torch => None, - BlockKind::WallTorch => None, - BlockKind::Fire => None, - BlockKind::SoulFire => None, - BlockKind::Spawner => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OakStairs => None, - BlockKind::Chest => None, - BlockKind::RedstoneWire => None, - BlockKind::DiamondOre => { - const TOOLS: &[crate::Item] = - &[crate::Item::IronPickaxe, crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::DiamondBlock => { - const TOOLS: &[crate::Item] = - &[crate::Item::IronPickaxe, crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::CraftingTable => None, - BlockKind::Wheat => None, - BlockKind::Farmland => None, - BlockKind::Furnace => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OakSign => None, - BlockKind::SpruceSign => None, - BlockKind::BirchSign => None, - BlockKind::AcaciaSign => None, - BlockKind::JungleSign => None, - BlockKind::DarkOakSign => None, - BlockKind::OakDoor => None, - BlockKind::Ladder => None, - BlockKind::Rail => None, - BlockKind::CobblestoneStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OakWallSign => None, - BlockKind::SpruceWallSign => None, - BlockKind::BirchWallSign => None, - BlockKind::AcaciaWallSign => None, - BlockKind::JungleWallSign => None, - BlockKind::DarkOakWallSign => None, - BlockKind::Lever => None, - BlockKind::StonePressurePlate => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::IronDoor => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OakPressurePlate => None, - BlockKind::SprucePressurePlate => None, - BlockKind::BirchPressurePlate => None, - BlockKind::JunglePressurePlate => None, - BlockKind::AcaciaPressurePlate => None, - BlockKind::DarkOakPressurePlate => None, - BlockKind::RedstoneOre => { - const TOOLS: &[crate::Item] = - &[crate::Item::IronPickaxe, crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::RedstoneTorch => None, - BlockKind::RedstoneWallTorch => None, - BlockKind::StoneButton => None, - BlockKind::Snow => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronShovel, - crate::Item::WoodenShovel, - crate::Item::StoneShovel, - crate::Item::DiamondShovel, - crate::Item::GoldenShovel, - ]; - Some(TOOLS) - } - BlockKind::Ice => None, - BlockKind::SnowBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronShovel, - crate::Item::WoodenShovel, - crate::Item::StoneShovel, - crate::Item::DiamondShovel, - crate::Item::GoldenShovel, - ]; - Some(TOOLS) - } - BlockKind::Cactus => None, - BlockKind::Clay => None, - BlockKind::SugarCane => None, - BlockKind::Jukebox => None, - BlockKind::OakFence => None, - BlockKind::Pumpkin => None, - BlockKind::Netherrack => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SoulSand => None, - BlockKind::SoulSoil => None, - BlockKind::Basalt => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedBasalt => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SoulTorch => None, - BlockKind::SoulWallTorch => None, - BlockKind::Glowstone => None, - BlockKind::NetherPortal => None, - BlockKind::CarvedPumpkin => None, - BlockKind::JackOLantern => None, - BlockKind::Cake => None, - BlockKind::Repeater => None, - BlockKind::WhiteStainedGlass => None, - BlockKind::OrangeStainedGlass => None, - BlockKind::MagentaStainedGlass => None, - BlockKind::LightBlueStainedGlass => None, - BlockKind::YellowStainedGlass => None, - BlockKind::LimeStainedGlass => None, - BlockKind::PinkStainedGlass => None, - BlockKind::GrayStainedGlass => None, - BlockKind::LightGrayStainedGlass => None, - BlockKind::CyanStainedGlass => None, - BlockKind::PurpleStainedGlass => None, - BlockKind::BlueStainedGlass => None, - BlockKind::BrownStainedGlass => None, - BlockKind::GreenStainedGlass => None, - BlockKind::RedStainedGlass => None, - BlockKind::BlackStainedGlass => None, - BlockKind::OakTrapdoor => None, - BlockKind::SpruceTrapdoor => None, - BlockKind::BirchTrapdoor => None, - BlockKind::JungleTrapdoor => None, - BlockKind::AcaciaTrapdoor => None, - BlockKind::DarkOakTrapdoor => None, - BlockKind::StoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyStoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CrackedStoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledStoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedStone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedCobblestone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedStoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedMossyStoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedCrackedStoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedChiseledStoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrownMushroomBlock => None, - BlockKind::RedMushroomBlock => None, - BlockKind::MushroomStem => None, - BlockKind::IronBars => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Chain => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GlassPane => None, - BlockKind::Melon => None, - BlockKind::AttachedPumpkinStem => None, - BlockKind::AttachedMelonStem => None, - BlockKind::PumpkinStem => None, - BlockKind::MelonStem => None, - BlockKind::Vine => None, - BlockKind::OakFenceGate => None, - BlockKind::BrickStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::StoneBrickStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Mycelium => None, - BlockKind::LilyPad => None, - BlockKind::NetherBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherBrickFence => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherBrickStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherWart => None, - BlockKind::EnchantingTable => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrewingStand => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Cauldron => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EndPortal => None, - BlockKind::EndPortalFrame => None, - BlockKind::EndStone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DragonEgg => None, - BlockKind::RedstoneLamp => None, - BlockKind::Cocoa => None, - BlockKind::SandstoneStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EmeraldOre => { - const TOOLS: &[crate::Item] = - &[crate::Item::IronPickaxe, crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::EnderChest => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::TripwireHook => None, - BlockKind::Tripwire => None, - BlockKind::EmeraldBlock => { - const TOOLS: &[crate::Item] = - &[crate::Item::IronPickaxe, crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::SpruceStairs => None, - BlockKind::BirchStairs => None, - BlockKind::JungleStairs => None, - BlockKind::CommandBlock => None, - BlockKind::Beacon => None, - BlockKind::CobblestoneWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyCobblestoneWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::FlowerPot => None, - BlockKind::PottedOakSapling => None, - BlockKind::PottedSpruceSapling => None, - BlockKind::PottedBirchSapling => None, - BlockKind::PottedJungleSapling => None, - BlockKind::PottedAcaciaSapling => None, - BlockKind::PottedDarkOakSapling => None, - BlockKind::PottedFern => None, - BlockKind::PottedDandelion => None, - BlockKind::PottedPoppy => None, - BlockKind::PottedBlueOrchid => None, - BlockKind::PottedAllium => None, - BlockKind::PottedAzureBluet => None, - BlockKind::PottedRedTulip => None, - BlockKind::PottedOrangeTulip => None, - BlockKind::PottedWhiteTulip => None, - BlockKind::PottedPinkTulip => None, - BlockKind::PottedOxeyeDaisy => None, - BlockKind::PottedCornflower => None, - BlockKind::PottedLilyOfTheValley => None, - BlockKind::PottedWitherRose => None, - BlockKind::PottedRedMushroom => None, - BlockKind::PottedBrownMushroom => None, - BlockKind::PottedDeadBush => None, - BlockKind::PottedCactus => None, - BlockKind::Carrots => None, - BlockKind::Potatoes => None, - BlockKind::OakButton => None, - BlockKind::SpruceButton => None, - BlockKind::BirchButton => None, - BlockKind::JungleButton => None, - BlockKind::AcaciaButton => None, - BlockKind::DarkOakButton => None, - BlockKind::SkeletonSkull => None, - BlockKind::SkeletonWallSkull => None, - BlockKind::WitherSkeletonSkull => None, - BlockKind::WitherSkeletonWallSkull => None, - BlockKind::ZombieHead => None, - BlockKind::ZombieWallHead => None, - BlockKind::PlayerHead => None, - BlockKind::PlayerWallHead => None, - BlockKind::CreeperHead => None, - BlockKind::CreeperWallHead => None, - BlockKind::DragonHead => None, - BlockKind::DragonWallHead => None, - BlockKind::Anvil => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChippedAnvil => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DamagedAnvil => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::TrappedChest => None, - BlockKind::LightWeightedPressurePlate => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::HeavyWeightedPressurePlate => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Comparator => None, - BlockKind::DaylightDetector => None, - BlockKind::RedstoneBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherQuartzOre => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Hopper => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledQuartzBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzPillar => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ActivatorRail => None, - BlockKind::Dropper => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::WhiteTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OrangeTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MagentaTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightBlueTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::YellowTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LimeTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PinkTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GrayTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightGrayTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CyanTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpleTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlueTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrownTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GreenTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::WhiteStainedGlassPane => None, - BlockKind::OrangeStainedGlassPane => None, - BlockKind::MagentaStainedGlassPane => None, - BlockKind::LightBlueStainedGlassPane => None, - BlockKind::YellowStainedGlassPane => None, - BlockKind::LimeStainedGlassPane => None, - BlockKind::PinkStainedGlassPane => None, - BlockKind::GrayStainedGlassPane => None, - BlockKind::LightGrayStainedGlassPane => None, - BlockKind::CyanStainedGlassPane => None, - BlockKind::PurpleStainedGlassPane => None, - BlockKind::BlueStainedGlassPane => None, - BlockKind::BrownStainedGlassPane => None, - BlockKind::GreenStainedGlassPane => None, - BlockKind::RedStainedGlassPane => None, - BlockKind::BlackStainedGlassPane => None, - BlockKind::AcaciaStairs => None, - BlockKind::DarkOakStairs => None, - BlockKind::SlimeBlock => None, - BlockKind::Barrier => None, - BlockKind::IronTrapdoor => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Prismarine => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DarkPrismarine => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineBrickStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DarkPrismarineStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineBrickSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DarkPrismarineSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SeaLantern => None, - BlockKind::HayBlock => None, - BlockKind::WhiteCarpet => None, - BlockKind::OrangeCarpet => None, - BlockKind::MagentaCarpet => None, - BlockKind::LightBlueCarpet => None, - BlockKind::YellowCarpet => None, - BlockKind::LimeCarpet => None, - BlockKind::PinkCarpet => None, - BlockKind::GrayCarpet => None, - BlockKind::LightGrayCarpet => None, - BlockKind::CyanCarpet => None, - BlockKind::PurpleCarpet => None, - BlockKind::BlueCarpet => None, - BlockKind::BrownCarpet => None, - BlockKind::GreenCarpet => None, - BlockKind::RedCarpet => None, - BlockKind::BlackCarpet => None, - BlockKind::Terracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CoalBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PackedIce => None, - BlockKind::Sunflower => None, - BlockKind::Lilac => None, - BlockKind::RoseBush => None, - BlockKind::Peony => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::TallGrass => None, - BlockKind::LargeFern => None, - BlockKind::WhiteBanner => None, - BlockKind::OrangeBanner => None, - BlockKind::MagentaBanner => None, - BlockKind::LightBlueBanner => None, - BlockKind::YellowBanner => None, - BlockKind::LimeBanner => None, - BlockKind::PinkBanner => None, - BlockKind::GrayBanner => None, - BlockKind::LightGrayBanner => None, - BlockKind::CyanBanner => None, - BlockKind::PurpleBanner => None, - BlockKind::BlueBanner => None, - BlockKind::BrownBanner => None, - BlockKind::GreenBanner => None, - BlockKind::RedBanner => None, - BlockKind::BlackBanner => None, - BlockKind::WhiteWallBanner => None, - BlockKind::OrangeWallBanner => None, - BlockKind::MagentaWallBanner => None, - BlockKind::LightBlueWallBanner => None, - BlockKind::YellowWallBanner => None, - BlockKind::LimeWallBanner => None, - BlockKind::PinkWallBanner => None, - BlockKind::GrayWallBanner => None, - BlockKind::LightGrayWallBanner => None, - BlockKind::CyanWallBanner => None, - BlockKind::PurpleWallBanner => None, - BlockKind::BlueWallBanner => None, - BlockKind::BrownWallBanner => None, - BlockKind::GreenWallBanner => None, - BlockKind::RedWallBanner => None, - BlockKind::BlackWallBanner => None, - BlockKind::RedSandstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledRedSandstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CutRedSandstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedSandstoneStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OakSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SpruceSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BirchSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::JungleSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::AcaciaSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DarkOakSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::StoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothStoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SandstoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CutSandstoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PetrifiedOakSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CobblestoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrickSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::StoneBrickSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherBrickSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedSandstoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CutRedSandstoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpurSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothStone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothSandstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothQuartz => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothRedSandstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SpruceFenceGate => None, - BlockKind::BirchFenceGate => None, - BlockKind::JungleFenceGate => None, - BlockKind::AcaciaFenceGate => None, - BlockKind::DarkOakFenceGate => None, - BlockKind::SpruceFence => None, - BlockKind::BirchFence => None, - BlockKind::JungleFence => None, - BlockKind::AcaciaFence => None, - BlockKind::DarkOakFence => None, - BlockKind::SpruceDoor => None, - BlockKind::BirchDoor => None, - BlockKind::JungleDoor => None, - BlockKind::AcaciaDoor => None, - BlockKind::DarkOakDoor => None, - BlockKind::EndRod => None, - BlockKind::ChorusPlant => None, - BlockKind::ChorusFlower => None, - BlockKind::PurpurBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpurPillar => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpurStairs => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EndStoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Beetroots => None, - BlockKind::GrassPath => None, - BlockKind::EndGateway => None, - BlockKind::RepeatingCommandBlock => None, - BlockKind::ChainCommandBlock => None, - BlockKind::FrostedIce => None, - BlockKind::MagmaBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherWartBlock => None, - BlockKind::RedNetherBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BoneBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::StructureVoid => None, - BlockKind::Observer => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ShulkerBox => None, - BlockKind::WhiteShulkerBox => None, - BlockKind::OrangeShulkerBox => None, - BlockKind::MagentaShulkerBox => None, - BlockKind::LightBlueShulkerBox => None, - BlockKind::YellowShulkerBox => None, - BlockKind::LimeShulkerBox => None, - BlockKind::PinkShulkerBox => None, - BlockKind::GrayShulkerBox => None, - BlockKind::LightGrayShulkerBox => None, - BlockKind::CyanShulkerBox => None, - BlockKind::PurpleShulkerBox => None, - BlockKind::BlueShulkerBox => None, - BlockKind::BrownShulkerBox => None, - BlockKind::GreenShulkerBox => None, - BlockKind::RedShulkerBox => None, - BlockKind::BlackShulkerBox => None, - BlockKind::WhiteGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OrangeGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MagentaGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightBlueGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::YellowGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LimeGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PinkGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GrayGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightGrayGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CyanGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpleGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlueGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrownGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GreenGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackGlazedTerracotta => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::WhiteConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OrangeConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MagentaConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightBlueConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::YellowConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LimeConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PinkConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GrayConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightGrayConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CyanConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpleConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlueConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrownConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GreenConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackConcrete => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::WhiteConcretePowder => None, - BlockKind::OrangeConcretePowder => None, - BlockKind::MagentaConcretePowder => None, - BlockKind::LightBlueConcretePowder => None, - BlockKind::YellowConcretePowder => None, - BlockKind::LimeConcretePowder => None, - BlockKind::PinkConcretePowder => None, - BlockKind::GrayConcretePowder => None, - BlockKind::LightGrayConcretePowder => None, - BlockKind::CyanConcretePowder => None, - BlockKind::PurpleConcretePowder => None, - BlockKind::BlueConcretePowder => None, - BlockKind::BrownConcretePowder => None, - BlockKind::GreenConcretePowder => None, - BlockKind::RedConcretePowder => None, - BlockKind::BlackConcretePowder => None, - BlockKind::Kelp => None, - BlockKind::KelpPlant => None, - BlockKind::DriedKelpBlock => None, - BlockKind::TurtleEgg => None, - BlockKind::DeadTubeCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadBrainCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadBubbleCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadFireCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadHornCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::TubeCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrainCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BubbleCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::FireCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::HornCoralBlock => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadTubeCoral => None, - BlockKind::DeadBrainCoral => None, - BlockKind::DeadBubbleCoral => None, - BlockKind::DeadFireCoral => None, - BlockKind::DeadHornCoral => None, - 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::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::TubeCoralWallFan => None, - BlockKind::BrainCoralWallFan => None, - BlockKind::BubbleCoralWallFan => None, - BlockKind::FireCoralWallFan => None, - BlockKind::HornCoralWallFan => None, - BlockKind::SeaPickle => None, - BlockKind::BlueIce => None, - BlockKind::Conduit => None, - BlockKind::BambooSapling => None, - BlockKind::Bamboo => None, - BlockKind::PottedBamboo => None, - 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: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedAndesiteStairs => None, - BlockKind::DioriteStairs => None, - BlockKind::PolishedGraniteSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothRedSandstoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyStoneBrickSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedDioriteSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyCobblestoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EndStoneBrickSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothSandstoneSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothQuartzSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GraniteSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::AndesiteSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedNetherBrickSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedAndesiteSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DioriteSlab => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrickWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedSandstoneWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyStoneBrickWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GraniteWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::StoneBrickWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherBrickWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::AndesiteWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedNetherBrickWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SandstoneWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EndStoneBrickWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DioriteWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Scaffolding => None, - BlockKind::Loom => None, - BlockKind::Barrel => None, - BlockKind::Smoker => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlastFurnace => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CartographyTable => None, - BlockKind::FletchingTable => None, - BlockKind::Grindstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Lectern => None, - BlockKind::SmithingTable => None, - BlockKind::Stonecutter => None, - BlockKind::Bell => None, - BlockKind::Lantern => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SoulLantern => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Campfire => None, - BlockKind::SoulCampfire => None, - BlockKind::SweetBerryBush => None, - BlockKind::WarpedStem => None, - BlockKind::StrippedWarpedStem => None, - BlockKind::WarpedHyphae => None, - BlockKind::StrippedWarpedHyphae => None, - BlockKind::WarpedNylium => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::WarpedFungus => None, - BlockKind::WarpedWartBlock => None, - BlockKind::WarpedRoots => None, - BlockKind::NetherSprouts => None, - BlockKind::CrimsonStem => None, - BlockKind::StrippedCrimsonStem => None, - BlockKind::CrimsonHyphae => None, - BlockKind::StrippedCrimsonHyphae => None, - BlockKind::CrimsonNylium => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CrimsonFungus => None, - BlockKind::Shroomlight => None, - BlockKind::WeepingVines => None, - BlockKind::WeepingVinesPlant => None, - BlockKind::TwistingVines => None, - BlockKind::TwistingVinesPlant => None, - BlockKind::CrimsonRoots => None, - BlockKind::CrimsonPlanks => None, - BlockKind::WarpedPlanks => None, - BlockKind::CrimsonSlab => None, - BlockKind::WarpedSlab => None, - BlockKind::CrimsonPressurePlate => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::WarpedPressurePlate => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CrimsonFence => None, - BlockKind::WarpedFence => None, - BlockKind::CrimsonTrapdoor => None, - BlockKind::WarpedTrapdoor => None, - BlockKind::CrimsonFenceGate => None, - BlockKind::WarpedFenceGate => None, - BlockKind::CrimsonStairs => None, - BlockKind::WarpedStairs => None, - BlockKind::CrimsonButton => None, - BlockKind::WarpedButton => None, - BlockKind::CrimsonDoor => None, - BlockKind::WarpedDoor => None, - BlockKind::CrimsonSign => None, - BlockKind::WarpedSign => None, - BlockKind::CrimsonWallSign => None, - BlockKind::WarpedWallSign => None, - BlockKind::StructureBlock => None, - BlockKind::Jigsaw => None, - BlockKind::Composter => None, - BlockKind::Target => None, - BlockKind::BeeNest => None, - BlockKind::Beehive => None, - BlockKind::HoneyBlock => None, - BlockKind::HoneycombBlock => None, - BlockKind::NetheriteBlock => { - const TOOLS: &[crate::Item] = &[crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::AncientDebris => { - const TOOLS: &[crate::Item] = &[crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::CryingObsidian => { - const TOOLS: &[crate::Item] = &[crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::RespawnAnchor => { - const TOOLS: &[crate::Item] = &[crate::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::PottedCrimsonFungus => None, - BlockKind::PottedWarpedFungus => None, - BlockKind::PottedCrimsonRoots => None, - BlockKind::PottedWarpedRoots => None, - BlockKind::Lodestone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Blackstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackstoneStairs => None, - BlockKind::BlackstoneWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackstoneSlab => None, - BlockKind::PolishedBlackstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedBlackstoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CrackedPolishedBlackstoneBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledPolishedBlackstone => None, - BlockKind::PolishedBlackstoneBrickSlab => None, - BlockKind::PolishedBlackstoneBrickStairs => None, - BlockKind::PolishedBlackstoneBrickWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GildedBlackstone => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedBlackstoneStairs => None, - BlockKind::PolishedBlackstoneSlab => None, - BlockKind::PolishedBlackstonePressurePlate => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedBlackstoneButton => None, - BlockKind::PolishedBlackstoneWall => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledNetherBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CrackedNetherBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzBricks => { - const TOOLS: &[crate::Item] = &[ - crate::Item::IronPickaxe, - crate::Item::WoodenPickaxe, - crate::Item::StonePickaxe, - crate::Item::DiamondPickaxe, - crate::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - } - } -} diff --git a/feather/generated/src/entity.rs b/feather/generated/src/entity.rs deleted file mode 100644 index 0f16ee4ce..000000000 --- a/feather/generated/src/entity.rs +++ /dev/null @@ -1,1483 +0,0 @@ -// This file is @generated. Please do not edit. - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum EntityKind { - AreaEffectCloud, - ArmorStand, - Arrow, - 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, - Guardian, - Hoglin, - Horse, - Husk, - Illusioner, - IronGolem, - Item, - ItemFrame, - Fireball, - LeashKnot, - LightningBolt, - Llama, - LlamaSpit, - MagmaCube, - 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, -} - -#[allow(warnings)] -#[allow(clippy::all)] -impl EntityKind { - /// Returns the `id` property of this `EntityKind`. - 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, - } - } - - /// Gets a `EntityKind` by its `id`. - 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), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl EntityKind { - /// Returns the `internal_id` property of this `EntityKind`. - pub fn internal_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, - } - } - - /// 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, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl EntityKind { - /// Returns the `name` property of this `EntityKind`. - pub fn name(&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 => "chest_minecart", - EntityKind::CommandBlockMinecart => "command_block_minecart", - EntityKind::FurnaceMinecart => "furnace_minecart", - EntityKind::HopperMinecart => "hopper_minecart", - EntityKind::SpawnerMinecart => "spawner_minecart", - EntityKind::TntMinecart => "tnt_minecart", - 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 => "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 => "egg", - EntityKind::EnderPearl => "ender_pearl", - EntityKind::ExperienceBottle => "experience_bottle", - 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", - } - } - - /// Gets a `EntityKind` by its `name`. - pub fn from_name(name: &str) -> Option { - match 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), - "chest_minecart" => Some(EntityKind::ChestMinecart), - "command_block_minecart" => Some(EntityKind::CommandBlockMinecart), - "furnace_minecart" => Some(EntityKind::FurnaceMinecart), - "hopper_minecart" => Some(EntityKind::HopperMinecart), - "spawner_minecart" => Some(EntityKind::SpawnerMinecart), - "tnt_minecart" => 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), - "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), - "egg" => Some(EntityKind::Egg), - "ender_pearl" => Some(EntityKind::EnderPearl), - "experience_bottle" => 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), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl EntityKind { - /// Returns the `display_name` property of this `EntityKind`. - pub fn display_name(&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", - } - } - - /// 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), - _ => 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), - }, - } - } -} diff --git a/feather/generated/src/item.rs b/feather/generated/src/item.rs deleted file mode 100644 index 10ee6cef2..000000000 --- a/feather/generated/src/item.rs +++ /dev/null @@ -1,8856 +0,0 @@ -// This file is @generated. Please do not edit. - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum Item { - Air, - Stone, - Granite, - PolishedGranite, - Diorite, - PolishedDiorite, - Andesite, - PolishedAndesite, - GrassBlock, - Dirt, - CoarseDirt, - Podzol, - CrimsonNylium, - WarpedNylium, - Cobblestone, - OakPlanks, - SprucePlanks, - BirchPlanks, - JunglePlanks, - AcaciaPlanks, - DarkOakPlanks, - CrimsonPlanks, - WarpedPlanks, - OakSapling, - SpruceSapling, - BirchSapling, - JungleSapling, - AcaciaSapling, - DarkOakSapling, - Bedrock, - Sand, - RedSand, - Gravel, - GoldOre, - IronOre, - CoalOre, - NetherGoldOre, - 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, - Sponge, - WetSponge, - Glass, - LapisOre, - LapisBlock, - Dispenser, - Sandstone, - ChiseledSandstone, - CutSandstone, - NoteBlock, - PoweredRail, - DetectorRail, - StickyPiston, - Cobweb, - Grass, - Fern, - DeadBush, - Seagrass, - SeaPickle, - Piston, - 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, - BrownMushroom, - RedMushroom, - CrimsonFungus, - WarpedFungus, - CrimsonRoots, - WarpedRoots, - NetherSprouts, - WeepingVines, - TwistingVines, - SugarCane, - Kelp, - Bamboo, - GoldBlock, - IronBlock, - 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, - Tnt, - Bookshelf, - MossyCobblestone, - Obsidian, - Torch, - EndRod, - ChorusPlant, - ChorusFlower, - PurpurBlock, - PurpurPillar, - PurpurStairs, - 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, - Cactus, - Clay, - Jukebox, - OakFence, - SpruceFence, - BirchFence, - JungleFence, - AcaciaFence, - DarkOakFence, - CrimsonFence, - WarpedFence, - Pumpkin, - CarvedPumpkin, - Netherrack, - SoulSand, - SoulSoil, - Basalt, - PolishedBasalt, - SoulTorch, - Glowstone, - JackOLantern, - OakTrapdoor, - SpruceTrapdoor, - BirchTrapdoor, - JungleTrapdoor, - AcaciaTrapdoor, - DarkOakTrapdoor, - CrimsonTrapdoor, - WarpedTrapdoor, - InfestedStone, - InfestedCobblestone, - InfestedStoneBricks, - InfestedMossyStoneBricks, - InfestedCrackedStoneBricks, - InfestedChiseledStoneBricks, - StoneBricks, - MossyStoneBricks, - CrackedStoneBricks, - ChiseledStoneBricks, - BrownMushroomBlock, - RedMushroomBlock, - MushroomStem, - IronBars, - Chain, - GlassPane, - Melon, - Vine, - OakFenceGate, - SpruceFenceGate, - BirchFenceGate, - JungleFenceGate, - AcaciaFenceGate, - DarkOakFenceGate, - CrimsonFenceGate, - WarpedFenceGate, - BrickStairs, - StoneBrickStairs, - Mycelium, - LilyPad, - NetherBricks, - CrackedNetherBricks, - ChiseledNetherBricks, - NetherBrickFence, - NetherBrickStairs, - EnchantingTable, - EndPortalFrame, - EndStone, - EndStoneBricks, - DragonEgg, - RedstoneLamp, - SandstoneStairs, - EmeraldOre, - EnderChest, - TripwireHook, - 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, - StoneButton, - OakButton, - SpruceButton, - BirchButton, - JungleButton, - AcaciaButton, - DarkOakButton, - CrimsonButton, - WarpedButton, - PolishedBlackstoneButton, - Anvil, - ChippedAnvil, - DamagedAnvil, - TrappedChest, - LightWeightedPressurePlate, - HeavyWeightedPressurePlate, - DaylightDetector, - RedstoneBlock, - NetherQuartzOre, - Hopper, - ChiseledQuartzBlock, - QuartzBlock, - QuartzBricks, - QuartzPillar, - QuartzStairs, - ActivatorRail, - Dropper, - WhiteTerracotta, - OrangeTerracotta, - MagentaTerracotta, - LightBlueTerracotta, - YellowTerracotta, - LimeTerracotta, - PinkTerracotta, - GrayTerracotta, - LightGrayTerracotta, - CyanTerracotta, - PurpleTerracotta, - BlueTerracotta, - BrownTerracotta, - GreenTerracotta, - RedTerracotta, - BlackTerracotta, - Barrier, - IronTrapdoor, - HayBlock, - WhiteCarpet, - OrangeCarpet, - MagentaCarpet, - LightBlueCarpet, - YellowCarpet, - LimeCarpet, - PinkCarpet, - GrayCarpet, - LightGrayCarpet, - CyanCarpet, - PurpleCarpet, - BlueCarpet, - BrownCarpet, - GreenCarpet, - RedCarpet, - BlackCarpet, - Terracotta, - CoalBlock, - PackedIce, - AcaciaStairs, - DarkOakStairs, - SlimeBlock, - GrassPath, - 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, - 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, - 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, - PolishedGraniteSlab, - SmoothRedSandstoneSlab, - MossyStoneBrickSlab, - PolishedDioriteSlab, - MossyCobblestoneSlab, - EndStoneBrickSlab, - SmoothSandstoneSlab, - SmoothQuartzSlab, - GraniteSlab, - AndesiteSlab, - RedNetherBrickSlab, - PolishedAndesiteSlab, - DioriteSlab, - Scaffolding, - IronDoor, - OakDoor, - SpruceDoor, - BirchDoor, - JungleDoor, - AcaciaDoor, - DarkOakDoor, - CrimsonDoor, - WarpedDoor, - Repeater, - Comparator, - StructureBlock, - Jigsaw, - TurtleHelmet, - Scute, - FlintAndSteel, - Apple, - Bow, - Arrow, - Coal, - Charcoal, - Diamond, - IronIngot, - 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, - Minecart, - Saddle, - Redstone, - Snowball, - OakBoat, - Leather, - MilkBucket, - PufferfishBucket, - SalmonBucket, - CodBucket, - TropicalFishBucket, - Brick, - ClayBall, - DriedKelpBlock, - Paper, - Book, - SlimeBall, - ChestMinecart, - FurnaceMinecart, - Egg, - Compass, - FishingRod, - Clock, - GlowstoneDust, - Cod, - Salmon, - TropicalFish, - Pufferfish, - CookedCod, - CookedSalmon, - InkSac, - CocoaBeans, - LapisLazuli, - 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, - BatSpawnEgg, - BeeSpawnEgg, - BlazeSpawnEgg, - CatSpawnEgg, - CaveSpiderSpawnEgg, - ChickenSpawnEgg, - CodSpawnEgg, - CowSpawnEgg, - CreeperSpawnEgg, - DolphinSpawnEgg, - DonkeySpawnEgg, - DrownedSpawnEgg, - ElderGuardianSpawnEgg, - EndermanSpawnEgg, - EndermiteSpawnEgg, - EvokerSpawnEgg, - FoxSpawnEgg, - GhastSpawnEgg, - 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, - Emerald, - ItemFrame, - FlowerPot, - Carrot, - Potato, - BakedPotato, - PoisonousPotato, - Map, - GoldenCarrot, - SkeletonSkull, - WitherSkeletonSkull, - PlayerHead, - ZombieHead, - CreeperHead, - DragonHead, - CarrotOnAStick, - WarpedFungusOnAStick, - NetherStar, - PumpkinPie, - FireworkRocket, - FireworkStar, - EnchantedBook, - NetherBrick, - Quartz, - TntMinecart, - HopperMinecart, - 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, - Elytra, - SpruceBoat, - BirchBoat, - JungleBoat, - AcaciaBoat, - DarkOakBoat, - TotemOfUndying, - ShulkerShell, - IronNugget, - KnowledgeBook, - DebugStick, - MusicDisc13, - MusicDiscCat, - MusicDiscBlocks, - MusicDiscChirp, - MusicDiscFar, - MusicDiscMall, - MusicDiscMellohi, - MusicDiscStal, - MusicDiscStrad, - MusicDiscWard, - MusicDisc11, - MusicDiscWait, - MusicDiscPigstep, - Trident, - PhantomMembrane, - NautilusShell, - HeartOfTheSea, - Crossbow, - SuspiciousStew, - Loom, - FlowerBannerPattern, - CreeperBannerPattern, - SkullBannerPattern, - MojangBannerPattern, - GlobeBannerPattern, - PiglinBannerPattern, - Composter, - Barrel, - Smoker, - BlastFurnace, - CartographyTable, - FletchingTable, - Grindstone, - Lectern, - SmithingTable, - Stonecutter, - Bell, - Lantern, - SoulLantern, - SweetBerries, - Campfire, - SoulCampfire, - Shroomlight, - Honeycomb, - BeeNest, - Beehive, - HoneyBottle, - HoneyBlock, - HoneycombBlock, - Lodestone, - NetheriteBlock, - AncientDebris, - Target, - CryingObsidian, - Blackstone, - BlackstoneSlab, - BlackstoneStairs, - GildedBlackstone, - PolishedBlackstone, - PolishedBlackstoneSlab, - PolishedBlackstoneStairs, - ChiseledPolishedBlackstone, - PolishedBlackstoneBricks, - PolishedBlackstoneBrickSlab, - PolishedBlackstoneBrickStairs, - CrackedPolishedBlackstoneBricks, - RespawnAnchor, -} - -#[allow(warnings)] -#[allow(clippy::all)] -impl Item { - /// Returns the `id` property of this `Item`. - 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, - } - } - - /// Gets a `Item` by its `id`. - 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), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Item { - /// Returns the `name` property of this `Item`. - pub fn name(&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_ore", - 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::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 => "gold_block", - Item::IronBlock => "iron_block", - 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", - 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 => "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", - 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 => "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::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 => "emerald_block", - 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 => "redstone_block", - Item::NetherQuartzOre => "nether_quartz_ore", - Item::Hopper => "hopper", - 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", - 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_block", - 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 => "coal_block", - 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 => "repeater", - Item::Comparator => "comparator", - Item::StructureBlock => "structure_block", - Item::Jigsaw => "jigsaw", - Item::TurtleHelmet => "turtle_helmet", - 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_helmet", - Item::LeatherChestplate => "leather_chestplate", - Item::LeatherLeggings => "leather_leggings", - 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 => "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", - 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::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::FishingRod => "fishing_rod", - Item::Clock => "clock", - Item::GlowstoneDust => "glowstone_dust", - Item::Cod => "cod", - Item::Salmon => "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 => "filled_map", - Item::Shears => "shears", - Item::MelonSlice => "melon_slice", - Item::DriedKelp => "dried_kelp", - Item::PumpkinSeeds => "pumpkin_seeds", - Item::MelonSeeds => "melon_seeds", - Item::Beef => "beef", - Item::CookedBeef => "cooked_beef", - Item::Chicken => "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 => "ender_eye", - 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 => "experience_bottle", - Item::FireCharge => "fire_charge", - Item::WritableBook => "writable_book", - 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 => "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 => "quartz", - Item::TntMinecart => "tnt_minecart", - Item::HopperMinecart => "hopper_minecart", - Item::PrismarineShard => "prismarine_shard", - Item::PrismarineCrystals => "prismarine_crystals", - Item::Rabbit => "rabbit", - Item::CookedRabbit => "cooked_rabbit", - Item::RabbitStew => "rabbit_stew", - Item::RabbitFoot => "rabbit_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 => "command_block_minecart", - Item::Mutton => "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_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 => "music_disc_13", - Item::MusicDiscCat => "music_disc_cat", - Item::MusicDiscBlocks => "music_disc_blocks", - Item::MusicDiscChirp => "music_disc_chirp", - Item::MusicDiscFar => "music_disc_far", - Item::MusicDiscMall => "music_disc_mall", - Item::MusicDiscMellohi => "music_disc_mellohi", - Item::MusicDiscStal => "music_disc_stal", - Item::MusicDiscStrad => "music_disc_strad", - Item::MusicDiscWard => "music_disc_ward", - Item::MusicDisc11 => "music_disc_11", - Item::MusicDiscWait => "music_disc_wait", - Item::MusicDiscPigstep => "music_disc_pigstep", - 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 => "flower_banner_pattern", - Item::CreeperBannerPattern => "creeper_banner_pattern", - Item::SkullBannerPattern => "skull_banner_pattern", - Item::MojangBannerPattern => "mojang_banner_pattern", - Item::GlobeBannerPattern => "globe_banner_pattern", - Item::PiglinBannerPattern => "piglin_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 => "netherite_block", - 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", - } - } - - /// Gets a `Item` by its `name`. - 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), - "diorite" => Some(Item::Diorite), - "polished_diorite" => Some(Item::PolishedDiorite), - "andesite" => Some(Item::Andesite), - "polished_andesite" => Some(Item::PolishedAndesite), - "grass_block" => Some(Item::GrassBlock), - "dirt" => Some(Item::Dirt), - "coarse_dirt" => Some(Item::CoarseDirt), - "podzol" => Some(Item::Podzol), - "crimson_nylium" => Some(Item::CrimsonNylium), - "warped_nylium" => Some(Item::WarpedNylium), - "cobblestone" => Some(Item::Cobblestone), - "oak_planks" => Some(Item::OakPlanks), - "spruce_planks" => Some(Item::SprucePlanks), - "birch_planks" => Some(Item::BirchPlanks), - "jungle_planks" => Some(Item::JunglePlanks), - "acacia_planks" => Some(Item::AcaciaPlanks), - "dark_oak_planks" => Some(Item::DarkOakPlanks), - "crimson_planks" => Some(Item::CrimsonPlanks), - "warped_planks" => Some(Item::WarpedPlanks), - "oak_sapling" => Some(Item::OakSapling), - "spruce_sapling" => Some(Item::SpruceSapling), - "birch_sapling" => Some(Item::BirchSapling), - "jungle_sapling" => Some(Item::JungleSapling), - "acacia_sapling" => Some(Item::AcaciaSapling), - "dark_oak_sapling" => Some(Item::DarkOakSapling), - "bedrock" => Some(Item::Bedrock), - "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), - "nether_gold_ore" => Some(Item::NetherGoldOre), - "oak_log" => Some(Item::OakLog), - "spruce_log" => Some(Item::SpruceLog), - "birch_log" => Some(Item::BirchLog), - "jungle_log" => Some(Item::JungleLog), - "acacia_log" => Some(Item::AcaciaLog), - "dark_oak_log" => Some(Item::DarkOakLog), - "crimson_stem" => Some(Item::CrimsonStem), - "warped_stem" => Some(Item::WarpedStem), - "stripped_oak_log" => Some(Item::StrippedOakLog), - "stripped_spruce_log" => Some(Item::StrippedSpruceLog), - "stripped_birch_log" => Some(Item::StrippedBirchLog), - "stripped_jungle_log" => Some(Item::StrippedJungleLog), - "stripped_acacia_log" => Some(Item::StrippedAcaciaLog), - "stripped_dark_oak_log" => Some(Item::StrippedDarkOakLog), - "stripped_crimson_stem" => Some(Item::StrippedCrimsonStem), - "stripped_warped_stem" => Some(Item::StrippedWarpedStem), - "stripped_oak_wood" => Some(Item::StrippedOakWood), - "stripped_spruce_wood" => Some(Item::StrippedSpruceWood), - "stripped_birch_wood" => Some(Item::StrippedBirchWood), - "stripped_jungle_wood" => Some(Item::StrippedJungleWood), - "stripped_acacia_wood" => Some(Item::StrippedAcaciaWood), - "stripped_dark_oak_wood" => Some(Item::StrippedDarkOakWood), - "stripped_crimson_hyphae" => Some(Item::StrippedCrimsonHyphae), - "stripped_warped_hyphae" => Some(Item::StrippedWarpedHyphae), - "oak_wood" => Some(Item::OakWood), - "spruce_wood" => Some(Item::SpruceWood), - "birch_wood" => Some(Item::BirchWood), - "jungle_wood" => Some(Item::JungleWood), - "acacia_wood" => Some(Item::AcaciaWood), - "dark_oak_wood" => Some(Item::DarkOakWood), - "crimson_hyphae" => Some(Item::CrimsonHyphae), - "warped_hyphae" => Some(Item::WarpedHyphae), - "oak_leaves" => Some(Item::OakLeaves), - "spruce_leaves" => Some(Item::SpruceLeaves), - "birch_leaves" => Some(Item::BirchLeaves), - "jungle_leaves" => Some(Item::JungleLeaves), - "acacia_leaves" => Some(Item::AcaciaLeaves), - "dark_oak_leaves" => Some(Item::DarkOakLeaves), - "sponge" => Some(Item::Sponge), - "wet_sponge" => Some(Item::WetSponge), - "glass" => Some(Item::Glass), - "lapis_ore" => Some(Item::LapisOre), - "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), - "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), - "light_blue_wool" => Some(Item::LightBlueWool), - "yellow_wool" => Some(Item::YellowWool), - "lime_wool" => Some(Item::LimeWool), - "pink_wool" => Some(Item::PinkWool), - "gray_wool" => Some(Item::GrayWool), - "light_gray_wool" => Some(Item::LightGrayWool), - "cyan_wool" => Some(Item::CyanWool), - "purple_wool" => Some(Item::PurpleWool), - "blue_wool" => Some(Item::BlueWool), - "brown_wool" => Some(Item::BrownWool), - "green_wool" => Some(Item::GreenWool), - "red_wool" => Some(Item::RedWool), - "black_wool" => Some(Item::BlackWool), - "dandelion" => Some(Item::Dandelion), - "poppy" => Some(Item::Poppy), - "blue_orchid" => Some(Item::BlueOrchid), - "allium" => Some(Item::Allium), - "azure_bluet" => Some(Item::AzureBluet), - "red_tulip" => Some(Item::RedTulip), - "orange_tulip" => Some(Item::OrangeTulip), - "white_tulip" => Some(Item::WhiteTulip), - "pink_tulip" => Some(Item::PinkTulip), - "oxeye_daisy" => Some(Item::OxeyeDaisy), - "cornflower" => Some(Item::Cornflower), - "lily_of_the_valley" => Some(Item::LilyOfTheValley), - "wither_rose" => Some(Item::WitherRose), - "brown_mushroom" => Some(Item::BrownMushroom), - "red_mushroom" => Some(Item::RedMushroom), - "crimson_fungus" => Some(Item::CrimsonFungus), - "warped_fungus" => Some(Item::WarpedFungus), - "crimson_roots" => Some(Item::CrimsonRoots), - "warped_roots" => Some(Item::WarpedRoots), - "nether_sprouts" => Some(Item::NetherSprouts), - "weeping_vines" => Some(Item::WeepingVines), - "twisting_vines" => Some(Item::TwistingVines), - "sugar_cane" => Some(Item::SugarCane), - "kelp" => Some(Item::Kelp), - "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), - "jungle_slab" => Some(Item::JungleSlab), - "acacia_slab" => Some(Item::AcaciaSlab), - "dark_oak_slab" => Some(Item::DarkOakSlab), - "crimson_slab" => Some(Item::CrimsonSlab), - "warped_slab" => Some(Item::WarpedSlab), - "stone_slab" => Some(Item::StoneSlab), - "smooth_stone_slab" => Some(Item::SmoothStoneSlab), - "sandstone_slab" => Some(Item::SandstoneSlab), - "cut_sandstone_slab" => Some(Item::CutSandstoneSlab), - "petrified_oak_slab" => Some(Item::PetrifiedOakSlab), - "cobblestone_slab" => Some(Item::CobblestoneSlab), - "brick_slab" => Some(Item::BrickSlab), - "stone_brick_slab" => Some(Item::StoneBrickSlab), - "nether_brick_slab" => Some(Item::NetherBrickSlab), - "quartz_slab" => Some(Item::QuartzSlab), - "red_sandstone_slab" => Some(Item::RedSandstoneSlab), - "cut_red_sandstone_slab" => Some(Item::CutRedSandstoneSlab), - "purpur_slab" => Some(Item::PurpurSlab), - "prismarine_slab" => Some(Item::PrismarineSlab), - "prismarine_brick_slab" => Some(Item::PrismarineBrickSlab), - "dark_prismarine_slab" => Some(Item::DarkPrismarineSlab), - "smooth_quartz" => Some(Item::SmoothQuartz), - "smooth_red_sandstone" => Some(Item::SmoothRedSandstone), - "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), - "torch" => Some(Item::Torch), - "end_rod" => Some(Item::EndRod), - "chorus_plant" => Some(Item::ChorusPlant), - "chorus_flower" => Some(Item::ChorusFlower), - "purpur_block" => Some(Item::PurpurBlock), - "purpur_pillar" => Some(Item::PurpurPillar), - "purpur_stairs" => Some(Item::PurpurStairs), - "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), - "cactus" => Some(Item::Cactus), - "clay" => Some(Item::Clay), - "jukebox" => Some(Item::Jukebox), - "oak_fence" => Some(Item::OakFence), - "spruce_fence" => Some(Item::SpruceFence), - "birch_fence" => Some(Item::BirchFence), - "jungle_fence" => Some(Item::JungleFence), - "acacia_fence" => Some(Item::AcaciaFence), - "dark_oak_fence" => Some(Item::DarkOakFence), - "crimson_fence" => Some(Item::CrimsonFence), - "warped_fence" => Some(Item::WarpedFence), - "pumpkin" => Some(Item::Pumpkin), - "carved_pumpkin" => Some(Item::CarvedPumpkin), - "netherrack" => Some(Item::Netherrack), - "soul_sand" => Some(Item::SoulSand), - "soul_soil" => Some(Item::SoulSoil), - "basalt" => Some(Item::Basalt), - "polished_basalt" => Some(Item::PolishedBasalt), - "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), - "stone_bricks" => Some(Item::StoneBricks), - "mossy_stone_bricks" => Some(Item::MossyStoneBricks), - "cracked_stone_bricks" => Some(Item::CrackedStoneBricks), - "chiseled_stone_bricks" => Some(Item::ChiseledStoneBricks), - "brown_mushroom_block" => Some(Item::BrownMushroomBlock), - "red_mushroom_block" => Some(Item::RedMushroomBlock), - "mushroom_stem" => Some(Item::MushroomStem), - "iron_bars" => Some(Item::IronBars), - "chain" => Some(Item::Chain), - "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), - "brick_stairs" => Some(Item::BrickStairs), - "stone_brick_stairs" => Some(Item::StoneBrickStairs), - "mycelium" => Some(Item::Mycelium), - "lily_pad" => Some(Item::LilyPad), - "nether_bricks" => Some(Item::NetherBricks), - "cracked_nether_bricks" => Some(Item::CrackedNetherBricks), - "chiseled_nether_bricks" => Some(Item::ChiseledNetherBricks), - "nether_brick_fence" => Some(Item::NetherBrickFence), - "nether_brick_stairs" => Some(Item::NetherBrickStairs), - "enchanting_table" => Some(Item::EnchantingTable), - "end_portal_frame" => Some(Item::EndPortalFrame), - "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), - "jungle_stairs" => Some(Item::JungleStairs), - "crimson_stairs" => Some(Item::CrimsonStairs), - "warped_stairs" => Some(Item::WarpedStairs), - "command_block" => Some(Item::CommandBlock), - "beacon" => Some(Item::Beacon), - "cobblestone_wall" => Some(Item::CobblestoneWall), - "mossy_cobblestone_wall" => Some(Item::MossyCobblestoneWall), - "brick_wall" => Some(Item::BrickWall), - "prismarine_wall" => Some(Item::PrismarineWall), - "red_sandstone_wall" => Some(Item::RedSandstoneWall), - "mossy_stone_brick_wall" => Some(Item::MossyStoneBrickWall), - "granite_wall" => Some(Item::GraniteWall), - "stone_brick_wall" => Some(Item::StoneBrickWall), - "nether_brick_wall" => Some(Item::NetherBrickWall), - "andesite_wall" => Some(Item::AndesiteWall), - "red_nether_brick_wall" => Some(Item::RedNetherBrickWall), - "sandstone_wall" => Some(Item::SandstoneWall), - "end_stone_brick_wall" => Some(Item::EndStoneBrickWall), - "diorite_wall" => Some(Item::DioriteWall), - "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), - "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), - "light_blue_terracotta" => Some(Item::LightBlueTerracotta), - "yellow_terracotta" => Some(Item::YellowTerracotta), - "lime_terracotta" => Some(Item::LimeTerracotta), - "pink_terracotta" => Some(Item::PinkTerracotta), - "gray_terracotta" => Some(Item::GrayTerracotta), - "light_gray_terracotta" => Some(Item::LightGrayTerracotta), - "cyan_terracotta" => Some(Item::CyanTerracotta), - "purple_terracotta" => Some(Item::PurpleTerracotta), - "blue_terracotta" => Some(Item::BlueTerracotta), - "brown_terracotta" => Some(Item::BrownTerracotta), - "green_terracotta" => Some(Item::GreenTerracotta), - "red_terracotta" => Some(Item::RedTerracotta), - "black_terracotta" => Some(Item::BlackTerracotta), - "barrier" => Some(Item::Barrier), - "iron_trapdoor" => Some(Item::IronTrapdoor), - "hay_block" => Some(Item::HayBlock), - "white_carpet" => Some(Item::WhiteCarpet), - "orange_carpet" => Some(Item::OrangeCarpet), - "magenta_carpet" => Some(Item::MagentaCarpet), - "light_blue_carpet" => Some(Item::LightBlueCarpet), - "yellow_carpet" => Some(Item::YellowCarpet), - "lime_carpet" => Some(Item::LimeCarpet), - "pink_carpet" => Some(Item::PinkCarpet), - "gray_carpet" => Some(Item::GrayCarpet), - "light_gray_carpet" => Some(Item::LightGrayCarpet), - "cyan_carpet" => Some(Item::CyanCarpet), - "purple_carpet" => Some(Item::PurpleCarpet), - "blue_carpet" => Some(Item::BlueCarpet), - "brown_carpet" => Some(Item::BrownCarpet), - "green_carpet" => Some(Item::GreenCarpet), - "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), - "sunflower" => Some(Item::Sunflower), - "lilac" => Some(Item::Lilac), - "rose_bush" => Some(Item::RoseBush), - "peony" => Some(Item::Peony), - "tall_grass" => Some(Item::TallGrass), - "large_fern" => Some(Item::LargeFern), - "white_stained_glass" => Some(Item::WhiteStainedGlass), - "orange_stained_glass" => Some(Item::OrangeStainedGlass), - "magenta_stained_glass" => Some(Item::MagentaStainedGlass), - "light_blue_stained_glass" => Some(Item::LightBlueStainedGlass), - "yellow_stained_glass" => Some(Item::YellowStainedGlass), - "lime_stained_glass" => Some(Item::LimeStainedGlass), - "pink_stained_glass" => Some(Item::PinkStainedGlass), - "gray_stained_glass" => Some(Item::GrayStainedGlass), - "light_gray_stained_glass" => Some(Item::LightGrayStainedGlass), - "cyan_stained_glass" => Some(Item::CyanStainedGlass), - "purple_stained_glass" => Some(Item::PurpleStainedGlass), - "blue_stained_glass" => Some(Item::BlueStainedGlass), - "brown_stained_glass" => Some(Item::BrownStainedGlass), - "green_stained_glass" => Some(Item::GreenStainedGlass), - "red_stained_glass" => Some(Item::RedStainedGlass), - "black_stained_glass" => Some(Item::BlackStainedGlass), - "white_stained_glass_pane" => Some(Item::WhiteStainedGlassPane), - "orange_stained_glass_pane" => Some(Item::OrangeStainedGlassPane), - "magenta_stained_glass_pane" => Some(Item::MagentaStainedGlassPane), - "light_blue_stained_glass_pane" => Some(Item::LightBlueStainedGlassPane), - "yellow_stained_glass_pane" => Some(Item::YellowStainedGlassPane), - "lime_stained_glass_pane" => Some(Item::LimeStainedGlassPane), - "pink_stained_glass_pane" => Some(Item::PinkStainedGlassPane), - "gray_stained_glass_pane" => Some(Item::GrayStainedGlassPane), - "light_gray_stained_glass_pane" => Some(Item::LightGrayStainedGlassPane), - "cyan_stained_glass_pane" => Some(Item::CyanStainedGlassPane), - "purple_stained_glass_pane" => Some(Item::PurpleStainedGlassPane), - "blue_stained_glass_pane" => Some(Item::BlueStainedGlassPane), - "brown_stained_glass_pane" => Some(Item::BrownStainedGlassPane), - "green_stained_glass_pane" => Some(Item::GreenStainedGlassPane), - "red_stained_glass_pane" => Some(Item::RedStainedGlassPane), - "black_stained_glass_pane" => Some(Item::BlackStainedGlassPane), - "prismarine" => Some(Item::Prismarine), - "prismarine_bricks" => Some(Item::PrismarineBricks), - "dark_prismarine" => Some(Item::DarkPrismarine), - "prismarine_stairs" => Some(Item::PrismarineStairs), - "prismarine_brick_stairs" => Some(Item::PrismarineBrickStairs), - "dark_prismarine_stairs" => Some(Item::DarkPrismarineStairs), - "sea_lantern" => Some(Item::SeaLantern), - "red_sandstone" => Some(Item::RedSandstone), - "chiseled_red_sandstone" => Some(Item::ChiseledRedSandstone), - "cut_red_sandstone" => Some(Item::CutRedSandstone), - "red_sandstone_stairs" => Some(Item::RedSandstoneStairs), - "repeating_command_block" => Some(Item::RepeatingCommandBlock), - "chain_command_block" => Some(Item::ChainCommandBlock), - "magma_block" => Some(Item::MagmaBlock), - "nether_wart_block" => Some(Item::NetherWartBlock), - "warped_wart_block" => Some(Item::WarpedWartBlock), - "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), - "magenta_shulker_box" => Some(Item::MagentaShulkerBox), - "light_blue_shulker_box" => Some(Item::LightBlueShulkerBox), - "yellow_shulker_box" => Some(Item::YellowShulkerBox), - "lime_shulker_box" => Some(Item::LimeShulkerBox), - "pink_shulker_box" => Some(Item::PinkShulkerBox), - "gray_shulker_box" => Some(Item::GrayShulkerBox), - "light_gray_shulker_box" => Some(Item::LightGrayShulkerBox), - "cyan_shulker_box" => Some(Item::CyanShulkerBox), - "purple_shulker_box" => Some(Item::PurpleShulkerBox), - "blue_shulker_box" => Some(Item::BlueShulkerBox), - "brown_shulker_box" => Some(Item::BrownShulkerBox), - "green_shulker_box" => Some(Item::GreenShulkerBox), - "red_shulker_box" => Some(Item::RedShulkerBox), - "black_shulker_box" => Some(Item::BlackShulkerBox), - "white_glazed_terracotta" => Some(Item::WhiteGlazedTerracotta), - "orange_glazed_terracotta" => Some(Item::OrangeGlazedTerracotta), - "magenta_glazed_terracotta" => Some(Item::MagentaGlazedTerracotta), - "light_blue_glazed_terracotta" => Some(Item::LightBlueGlazedTerracotta), - "yellow_glazed_terracotta" => Some(Item::YellowGlazedTerracotta), - "lime_glazed_terracotta" => Some(Item::LimeGlazedTerracotta), - "pink_glazed_terracotta" => Some(Item::PinkGlazedTerracotta), - "gray_glazed_terracotta" => Some(Item::GrayGlazedTerracotta), - "light_gray_glazed_terracotta" => Some(Item::LightGrayGlazedTerracotta), - "cyan_glazed_terracotta" => Some(Item::CyanGlazedTerracotta), - "purple_glazed_terracotta" => Some(Item::PurpleGlazedTerracotta), - "blue_glazed_terracotta" => Some(Item::BlueGlazedTerracotta), - "brown_glazed_terracotta" => Some(Item::BrownGlazedTerracotta), - "green_glazed_terracotta" => Some(Item::GreenGlazedTerracotta), - "red_glazed_terracotta" => Some(Item::RedGlazedTerracotta), - "black_glazed_terracotta" => Some(Item::BlackGlazedTerracotta), - "white_concrete" => Some(Item::WhiteConcrete), - "orange_concrete" => Some(Item::OrangeConcrete), - "magenta_concrete" => Some(Item::MagentaConcrete), - "light_blue_concrete" => Some(Item::LightBlueConcrete), - "yellow_concrete" => Some(Item::YellowConcrete), - "lime_concrete" => Some(Item::LimeConcrete), - "pink_concrete" => Some(Item::PinkConcrete), - "gray_concrete" => Some(Item::GrayConcrete), - "light_gray_concrete" => Some(Item::LightGrayConcrete), - "cyan_concrete" => Some(Item::CyanConcrete), - "purple_concrete" => Some(Item::PurpleConcrete), - "blue_concrete" => Some(Item::BlueConcrete), - "brown_concrete" => Some(Item::BrownConcrete), - "green_concrete" => Some(Item::GreenConcrete), - "red_concrete" => Some(Item::RedConcrete), - "black_concrete" => Some(Item::BlackConcrete), - "white_concrete_powder" => Some(Item::WhiteConcretePowder), - "orange_concrete_powder" => Some(Item::OrangeConcretePowder), - "magenta_concrete_powder" => Some(Item::MagentaConcretePowder), - "light_blue_concrete_powder" => Some(Item::LightBlueConcretePowder), - "yellow_concrete_powder" => Some(Item::YellowConcretePowder), - "lime_concrete_powder" => Some(Item::LimeConcretePowder), - "pink_concrete_powder" => Some(Item::PinkConcretePowder), - "gray_concrete_powder" => Some(Item::GrayConcretePowder), - "light_gray_concrete_powder" => Some(Item::LightGrayConcretePowder), - "cyan_concrete_powder" => Some(Item::CyanConcretePowder), - "purple_concrete_powder" => Some(Item::PurpleConcretePowder), - "blue_concrete_powder" => Some(Item::BlueConcretePowder), - "brown_concrete_powder" => Some(Item::BrownConcretePowder), - "green_concrete_powder" => Some(Item::GreenConcretePowder), - "red_concrete_powder" => Some(Item::RedConcretePowder), - "black_concrete_powder" => Some(Item::BlackConcretePowder), - "turtle_egg" => Some(Item::TurtleEgg), - "dead_tube_coral_block" => Some(Item::DeadTubeCoralBlock), - "dead_brain_coral_block" => Some(Item::DeadBrainCoralBlock), - "dead_bubble_coral_block" => Some(Item::DeadBubbleCoralBlock), - "dead_fire_coral_block" => Some(Item::DeadFireCoralBlock), - "dead_horn_coral_block" => Some(Item::DeadHornCoralBlock), - "tube_coral_block" => Some(Item::TubeCoralBlock), - "brain_coral_block" => Some(Item::BrainCoralBlock), - "bubble_coral_block" => Some(Item::BubbleCoralBlock), - "fire_coral_block" => Some(Item::FireCoralBlock), - "horn_coral_block" => Some(Item::HornCoralBlock), - "tube_coral" => Some(Item::TubeCoral), - "brain_coral" => Some(Item::BrainCoral), - "bubble_coral" => Some(Item::BubbleCoral), - "fire_coral" => Some(Item::FireCoral), - "horn_coral" => Some(Item::HornCoral), - "dead_brain_coral" => Some(Item::DeadBrainCoral), - "dead_bubble_coral" => Some(Item::DeadBubbleCoral), - "dead_fire_coral" => Some(Item::DeadFireCoral), - "dead_horn_coral" => Some(Item::DeadHornCoral), - "dead_tube_coral" => Some(Item::DeadTubeCoral), - "tube_coral_fan" => Some(Item::TubeCoralFan), - "brain_coral_fan" => Some(Item::BrainCoralFan), - "bubble_coral_fan" => Some(Item::BubbleCoralFan), - "fire_coral_fan" => Some(Item::FireCoralFan), - "horn_coral_fan" => Some(Item::HornCoralFan), - "dead_tube_coral_fan" => Some(Item::DeadTubeCoralFan), - "dead_brain_coral_fan" => Some(Item::DeadBrainCoralFan), - "dead_bubble_coral_fan" => Some(Item::DeadBubbleCoralFan), - "dead_fire_coral_fan" => Some(Item::DeadFireCoralFan), - "dead_horn_coral_fan" => Some(Item::DeadHornCoralFan), - "blue_ice" => Some(Item::BlueIce), - "conduit" => Some(Item::Conduit), - "polished_granite_stairs" => Some(Item::PolishedGraniteStairs), - "smooth_red_sandstone_stairs" => Some(Item::SmoothRedSandstoneStairs), - "mossy_stone_brick_stairs" => Some(Item::MossyStoneBrickStairs), - "polished_diorite_stairs" => Some(Item::PolishedDioriteStairs), - "mossy_cobblestone_stairs" => Some(Item::MossyCobblestoneStairs), - "end_stone_brick_stairs" => Some(Item::EndStoneBrickStairs), - "stone_stairs" => Some(Item::StoneStairs), - "smooth_sandstone_stairs" => Some(Item::SmoothSandstoneStairs), - "smooth_quartz_stairs" => Some(Item::SmoothQuartzStairs), - "granite_stairs" => Some(Item::GraniteStairs), - "andesite_stairs" => Some(Item::AndesiteStairs), - "red_nether_brick_stairs" => Some(Item::RedNetherBrickStairs), - "polished_andesite_stairs" => Some(Item::PolishedAndesiteStairs), - "diorite_stairs" => Some(Item::DioriteStairs), - "polished_granite_slab" => Some(Item::PolishedGraniteSlab), - "smooth_red_sandstone_slab" => Some(Item::SmoothRedSandstoneSlab), - "mossy_stone_brick_slab" => Some(Item::MossyStoneBrickSlab), - "polished_diorite_slab" => Some(Item::PolishedDioriteSlab), - "mossy_cobblestone_slab" => Some(Item::MossyCobblestoneSlab), - "end_stone_brick_slab" => Some(Item::EndStoneBrickSlab), - "smooth_sandstone_slab" => Some(Item::SmoothSandstoneSlab), - "smooth_quartz_slab" => Some(Item::SmoothQuartzSlab), - "granite_slab" => Some(Item::GraniteSlab), - "andesite_slab" => Some(Item::AndesiteSlab), - "red_nether_brick_slab" => Some(Item::RedNetherBrickSlab), - "polished_andesite_slab" => Some(Item::PolishedAndesiteSlab), - "diorite_slab" => Some(Item::DioriteSlab), - "scaffolding" => Some(Item::Scaffolding), - "iron_door" => Some(Item::IronDoor), - "oak_door" => Some(Item::OakDoor), - "spruce_door" => Some(Item::SpruceDoor), - "birch_door" => Some(Item::BirchDoor), - "jungle_door" => Some(Item::JungleDoor), - "acacia_door" => Some(Item::AcaciaDoor), - "dark_oak_door" => Some(Item::DarkOakDoor), - "crimson_door" => Some(Item::CrimsonDoor), - "warped_door" => Some(Item::WarpedDoor), - "repeater" => Some(Item::Repeater), - "comparator" => Some(Item::Comparator), - "structure_block" => Some(Item::StructureBlock), - "jigsaw" => Some(Item::Jigsaw), - "turtle_helmet" => Some(Item::TurtleHelmet), - "scute" => Some(Item::Scute), - "flint_and_steel" => Some(Item::FlintAndSteel), - "apple" => Some(Item::Apple), - "bow" => Some(Item::Bow), - "arrow" => Some(Item::Arrow), - "coal" => Some(Item::Coal), - "charcoal" => Some(Item::Charcoal), - "diamond" => Some(Item::Diamond), - "iron_ingot" => Some(Item::IronIngot), - "gold_ingot" => Some(Item::GoldIngot), - "netherite_ingot" => Some(Item::NetheriteIngot), - "netherite_scrap" => Some(Item::NetheriteScrap), - "wooden_sword" => Some(Item::WoodenSword), - "wooden_shovel" => Some(Item::WoodenShovel), - "wooden_pickaxe" => Some(Item::WoodenPickaxe), - "wooden_axe" => Some(Item::WoodenAxe), - "wooden_hoe" => Some(Item::WoodenHoe), - "stone_sword" => Some(Item::StoneSword), - "stone_shovel" => Some(Item::StoneShovel), - "stone_pickaxe" => Some(Item::StonePickaxe), - "stone_axe" => Some(Item::StoneAxe), - "stone_hoe" => Some(Item::StoneHoe), - "golden_sword" => Some(Item::GoldenSword), - "golden_shovel" => Some(Item::GoldenShovel), - "golden_pickaxe" => Some(Item::GoldenPickaxe), - "golden_axe" => Some(Item::GoldenAxe), - "golden_hoe" => Some(Item::GoldenHoe), - "iron_sword" => Some(Item::IronSword), - "iron_shovel" => Some(Item::IronShovel), - "iron_pickaxe" => Some(Item::IronPickaxe), - "iron_axe" => Some(Item::IronAxe), - "iron_hoe" => Some(Item::IronHoe), - "diamond_sword" => Some(Item::DiamondSword), - "diamond_shovel" => Some(Item::DiamondShovel), - "diamond_pickaxe" => Some(Item::DiamondPickaxe), - "diamond_axe" => Some(Item::DiamondAxe), - "diamond_hoe" => Some(Item::DiamondHoe), - "netherite_sword" => Some(Item::NetheriteSword), - "netherite_shovel" => Some(Item::NetheriteShovel), - "netherite_pickaxe" => Some(Item::NetheritePickaxe), - "netherite_axe" => Some(Item::NetheriteAxe), - "netherite_hoe" => Some(Item::NetheriteHoe), - "stick" => Some(Item::Stick), - "bowl" => Some(Item::Bowl), - "mushroom_stew" => Some(Item::MushroomStew), - "string" => Some(Item::String), - "feather" => Some(Item::Feather), - "gunpowder" => Some(Item::Gunpowder), - "wheat_seeds" => Some(Item::WheatSeeds), - "wheat" => Some(Item::Wheat), - "bread" => Some(Item::Bread), - "leather_helmet" => Some(Item::LeatherHelmet), - "leather_chestplate" => Some(Item::LeatherChestplate), - "leather_leggings" => Some(Item::LeatherLeggings), - "leather_boots" => Some(Item::LeatherBoots), - "chainmail_helmet" => Some(Item::ChainmailHelmet), - "chainmail_chestplate" => Some(Item::ChainmailChestplate), - "chainmail_leggings" => Some(Item::ChainmailLeggings), - "chainmail_boots" => Some(Item::ChainmailBoots), - "iron_helmet" => Some(Item::IronHelmet), - "iron_chestplate" => Some(Item::IronChestplate), - "iron_leggings" => Some(Item::IronLeggings), - "iron_boots" => Some(Item::IronBoots), - "diamond_helmet" => Some(Item::DiamondHelmet), - "diamond_chestplate" => Some(Item::DiamondChestplate), - "diamond_leggings" => Some(Item::DiamondLeggings), - "diamond_boots" => Some(Item::DiamondBoots), - "golden_helmet" => Some(Item::GoldenHelmet), - "golden_chestplate" => Some(Item::GoldenChestplate), - "golden_leggings" => Some(Item::GoldenLeggings), - "golden_boots" => Some(Item::GoldenBoots), - "netherite_helmet" => Some(Item::NetheriteHelmet), - "netherite_chestplate" => Some(Item::NetheriteChestplate), - "netherite_leggings" => Some(Item::NetheriteLeggings), - "netherite_boots" => Some(Item::NetheriteBoots), - "flint" => Some(Item::Flint), - "porkchop" => Some(Item::Porkchop), - "cooked_porkchop" => Some(Item::CookedPorkchop), - "painting" => Some(Item::Painting), - "golden_apple" => Some(Item::GoldenApple), - "enchanted_golden_apple" => Some(Item::EnchantedGoldenApple), - "oak_sign" => Some(Item::OakSign), - "spruce_sign" => Some(Item::SpruceSign), - "birch_sign" => Some(Item::BirchSign), - "jungle_sign" => Some(Item::JungleSign), - "acacia_sign" => Some(Item::AcaciaSign), - "dark_oak_sign" => Some(Item::DarkOakSign), - "crimson_sign" => Some(Item::CrimsonSign), - "warped_sign" => Some(Item::WarpedSign), - "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), - "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), - "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), - "fishing_rod" => Some(Item::FishingRod), - "clock" => Some(Item::Clock), - "glowstone_dust" => Some(Item::GlowstoneDust), - "cod" => Some(Item::Cod), - "salmon" => Some(Item::Salmon), - "tropical_fish" => Some(Item::TropicalFish), - "pufferfish" => Some(Item::Pufferfish), - "cooked_cod" => Some(Item::CookedCod), - "cooked_salmon" => Some(Item::CookedSalmon), - "ink_sac" => Some(Item::InkSac), - "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), - "light_blue_dye" => Some(Item::LightBlueDye), - "yellow_dye" => Some(Item::YellowDye), - "lime_dye" => Some(Item::LimeDye), - "pink_dye" => Some(Item::PinkDye), - "gray_dye" => Some(Item::GrayDye), - "light_gray_dye" => Some(Item::LightGrayDye), - "cyan_dye" => Some(Item::CyanDye), - "purple_dye" => Some(Item::PurpleDye), - "blue_dye" => Some(Item::BlueDye), - "brown_dye" => Some(Item::BrownDye), - "green_dye" => Some(Item::GreenDye), - "red_dye" => Some(Item::RedDye), - "black_dye" => Some(Item::BlackDye), - "bone_meal" => Some(Item::BoneMeal), - "bone" => Some(Item::Bone), - "sugar" => Some(Item::Sugar), - "cake" => Some(Item::Cake), - "white_bed" => Some(Item::WhiteBed), - "orange_bed" => Some(Item::OrangeBed), - "magenta_bed" => Some(Item::MagentaBed), - "light_blue_bed" => Some(Item::LightBlueBed), - "yellow_bed" => Some(Item::YellowBed), - "lime_bed" => Some(Item::LimeBed), - "pink_bed" => Some(Item::PinkBed), - "gray_bed" => Some(Item::GrayBed), - "light_gray_bed" => Some(Item::LightGrayBed), - "cyan_bed" => Some(Item::CyanBed), - "purple_bed" => Some(Item::PurpleBed), - "blue_bed" => Some(Item::BlueBed), - "brown_bed" => Some(Item::BrownBed), - "green_bed" => Some(Item::GreenBed), - "red_bed" => Some(Item::RedBed), - "black_bed" => Some(Item::BlackBed), - "cookie" => Some(Item::Cookie), - "filled_map" => Some(Item::FilledMap), - "shears" => Some(Item::Shears), - "melon_slice" => Some(Item::MelonSlice), - "dried_kelp" => Some(Item::DriedKelp), - "pumpkin_seeds" => Some(Item::PumpkinSeeds), - "melon_seeds" => Some(Item::MelonSeeds), - "beef" => Some(Item::Beef), - "cooked_beef" => Some(Item::CookedBeef), - "chicken" => Some(Item::Chicken), - "cooked_chicken" => Some(Item::CookedChicken), - "rotten_flesh" => Some(Item::RottenFlesh), - "ender_pearl" => Some(Item::EnderPearl), - "blaze_rod" => Some(Item::BlazeRod), - "ghast_tear" => Some(Item::GhastTear), - "gold_nugget" => Some(Item::GoldNugget), - "nether_wart" => Some(Item::NetherWart), - "potion" => Some(Item::Potion), - "glass_bottle" => Some(Item::GlassBottle), - "spider_eye" => Some(Item::SpiderEye), - "fermented_spider_eye" => Some(Item::FermentedSpiderEye), - "blaze_powder" => Some(Item::BlazePowder), - "magma_cream" => Some(Item::MagmaCream), - "brewing_stand" => Some(Item::BrewingStand), - "cauldron" => Some(Item::Cauldron), - "ender_eye" => Some(Item::EnderEye), - "glistering_melon_slice" => Some(Item::GlisteringMelonSlice), - "bat_spawn_egg" => Some(Item::BatSpawnEgg), - "bee_spawn_egg" => Some(Item::BeeSpawnEgg), - "blaze_spawn_egg" => Some(Item::BlazeSpawnEgg), - "cat_spawn_egg" => Some(Item::CatSpawnEgg), - "cave_spider_spawn_egg" => Some(Item::CaveSpiderSpawnEgg), - "chicken_spawn_egg" => Some(Item::ChickenSpawnEgg), - "cod_spawn_egg" => Some(Item::CodSpawnEgg), - "cow_spawn_egg" => Some(Item::CowSpawnEgg), - "creeper_spawn_egg" => Some(Item::CreeperSpawnEgg), - "dolphin_spawn_egg" => Some(Item::DolphinSpawnEgg), - "donkey_spawn_egg" => Some(Item::DonkeySpawnEgg), - "drowned_spawn_egg" => Some(Item::DrownedSpawnEgg), - "elder_guardian_spawn_egg" => Some(Item::ElderGuardianSpawnEgg), - "enderman_spawn_egg" => Some(Item::EndermanSpawnEgg), - "endermite_spawn_egg" => Some(Item::EndermiteSpawnEgg), - "evoker_spawn_egg" => Some(Item::EvokerSpawnEgg), - "fox_spawn_egg" => Some(Item::FoxSpawnEgg), - "ghast_spawn_egg" => Some(Item::GhastSpawnEgg), - "guardian_spawn_egg" => Some(Item::GuardianSpawnEgg), - "hoglin_spawn_egg" => Some(Item::HoglinSpawnEgg), - "horse_spawn_egg" => Some(Item::HorseSpawnEgg), - "husk_spawn_egg" => Some(Item::HuskSpawnEgg), - "llama_spawn_egg" => Some(Item::LlamaSpawnEgg), - "magma_cube_spawn_egg" => Some(Item::MagmaCubeSpawnEgg), - "mooshroom_spawn_egg" => Some(Item::MooshroomSpawnEgg), - "mule_spawn_egg" => Some(Item::MuleSpawnEgg), - "ocelot_spawn_egg" => Some(Item::OcelotSpawnEgg), - "panda_spawn_egg" => Some(Item::PandaSpawnEgg), - "parrot_spawn_egg" => Some(Item::ParrotSpawnEgg), - "phantom_spawn_egg" => Some(Item::PhantomSpawnEgg), - "pig_spawn_egg" => Some(Item::PigSpawnEgg), - "piglin_spawn_egg" => Some(Item::PiglinSpawnEgg), - "piglin_brute_spawn_egg" => Some(Item::PiglinBruteSpawnEgg), - "pillager_spawn_egg" => Some(Item::PillagerSpawnEgg), - "polar_bear_spawn_egg" => Some(Item::PolarBearSpawnEgg), - "pufferfish_spawn_egg" => Some(Item::PufferfishSpawnEgg), - "rabbit_spawn_egg" => Some(Item::RabbitSpawnEgg), - "ravager_spawn_egg" => Some(Item::RavagerSpawnEgg), - "salmon_spawn_egg" => Some(Item::SalmonSpawnEgg), - "sheep_spawn_egg" => Some(Item::SheepSpawnEgg), - "shulker_spawn_egg" => Some(Item::ShulkerSpawnEgg), - "silverfish_spawn_egg" => Some(Item::SilverfishSpawnEgg), - "skeleton_spawn_egg" => Some(Item::SkeletonSpawnEgg), - "skeleton_horse_spawn_egg" => Some(Item::SkeletonHorseSpawnEgg), - "slime_spawn_egg" => Some(Item::SlimeSpawnEgg), - "spider_spawn_egg" => Some(Item::SpiderSpawnEgg), - "squid_spawn_egg" => Some(Item::SquidSpawnEgg), - "stray_spawn_egg" => Some(Item::StraySpawnEgg), - "strider_spawn_egg" => Some(Item::StriderSpawnEgg), - "trader_llama_spawn_egg" => Some(Item::TraderLlamaSpawnEgg), - "tropical_fish_spawn_egg" => Some(Item::TropicalFishSpawnEgg), - "turtle_spawn_egg" => Some(Item::TurtleSpawnEgg), - "vex_spawn_egg" => Some(Item::VexSpawnEgg), - "villager_spawn_egg" => Some(Item::VillagerSpawnEgg), - "vindicator_spawn_egg" => Some(Item::VindicatorSpawnEgg), - "wandering_trader_spawn_egg" => Some(Item::WanderingTraderSpawnEgg), - "witch_spawn_egg" => Some(Item::WitchSpawnEgg), - "wither_skeleton_spawn_egg" => Some(Item::WitherSkeletonSpawnEgg), - "wolf_spawn_egg" => Some(Item::WolfSpawnEgg), - "zoglin_spawn_egg" => Some(Item::ZoglinSpawnEgg), - "zombie_spawn_egg" => Some(Item::ZombieSpawnEgg), - "zombie_horse_spawn_egg" => Some(Item::ZombieHorseSpawnEgg), - "zombie_villager_spawn_egg" => Some(Item::ZombieVillagerSpawnEgg), - "zombified_piglin_spawn_egg" => Some(Item::ZombifiedPiglinSpawnEgg), - "experience_bottle" => Some(Item::ExperienceBottle), - "fire_charge" => Some(Item::FireCharge), - "writable_book" => Some(Item::WritableBook), - "written_book" => Some(Item::WrittenBook), - "emerald" => Some(Item::Emerald), - "item_frame" => Some(Item::ItemFrame), - "flower_pot" => Some(Item::FlowerPot), - "carrot" => Some(Item::Carrot), - "potato" => Some(Item::Potato), - "baked_potato" => Some(Item::BakedPotato), - "poisonous_potato" => Some(Item::PoisonousPotato), - "map" => Some(Item::Map), - "golden_carrot" => Some(Item::GoldenCarrot), - "skeleton_skull" => Some(Item::SkeletonSkull), - "wither_skeleton_skull" => Some(Item::WitherSkeletonSkull), - "player_head" => Some(Item::PlayerHead), - "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), - "cooked_rabbit" => Some(Item::CookedRabbit), - "rabbit_stew" => Some(Item::RabbitStew), - "rabbit_foot" => Some(Item::RabbitFoot), - "rabbit_hide" => Some(Item::RabbitHide), - "armor_stand" => Some(Item::ArmorStand), - "iron_horse_armor" => Some(Item::IronHorseArmor), - "golden_horse_armor" => Some(Item::GoldenHorseArmor), - "diamond_horse_armor" => Some(Item::DiamondHorseArmor), - "leather_horse_armor" => Some(Item::LeatherHorseArmor), - "lead" => Some(Item::Lead), - "name_tag" => Some(Item::NameTag), - "command_block_minecart" => Some(Item::CommandBlockMinecart), - "mutton" => Some(Item::Mutton), - "cooked_mutton" => Some(Item::CookedMutton), - "white_banner" => Some(Item::WhiteBanner), - "orange_banner" => Some(Item::OrangeBanner), - "magenta_banner" => Some(Item::MagentaBanner), - "light_blue_banner" => Some(Item::LightBlueBanner), - "yellow_banner" => Some(Item::YellowBanner), - "lime_banner" => Some(Item::LimeBanner), - "pink_banner" => Some(Item::PinkBanner), - "gray_banner" => Some(Item::GrayBanner), - "light_gray_banner" => Some(Item::LightGrayBanner), - "cyan_banner" => Some(Item::CyanBanner), - "purple_banner" => Some(Item::PurpleBanner), - "blue_banner" => Some(Item::BlueBanner), - "brown_banner" => Some(Item::BrownBanner), - "green_banner" => Some(Item::GreenBanner), - "red_banner" => Some(Item::RedBanner), - "black_banner" => Some(Item::BlackBanner), - "end_crystal" => Some(Item::EndCrystal), - "chorus_fruit" => Some(Item::ChorusFruit), - "popped_chorus_fruit" => Some(Item::PoppedChorusFruit), - "beetroot" => Some(Item::Beetroot), - "beetroot_seeds" => Some(Item::BeetrootSeeds), - "beetroot_soup" => Some(Item::BeetrootSoup), - "dragon_breath" => Some(Item::DragonBreath), - "splash_potion" => Some(Item::SplashPotion), - "spectral_arrow" => Some(Item::SpectralArrow), - "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), - "knowledge_book" => Some(Item::KnowledgeBook), - "debug_stick" => Some(Item::DebugStick), - "music_disc_13" => Some(Item::MusicDisc13), - "music_disc_cat" => Some(Item::MusicDiscCat), - "music_disc_blocks" => Some(Item::MusicDiscBlocks), - "music_disc_chirp" => Some(Item::MusicDiscChirp), - "music_disc_far" => Some(Item::MusicDiscFar), - "music_disc_mall" => Some(Item::MusicDiscMall), - "music_disc_mellohi" => Some(Item::MusicDiscMellohi), - "music_disc_stal" => Some(Item::MusicDiscStal), - "music_disc_strad" => Some(Item::MusicDiscStrad), - "music_disc_ward" => Some(Item::MusicDiscWard), - "music_disc_11" => Some(Item::MusicDisc11), - "music_disc_wait" => Some(Item::MusicDiscWait), - "music_disc_pigstep" => Some(Item::MusicDiscPigstep), - "trident" => Some(Item::Trident), - "phantom_membrane" => Some(Item::PhantomMembrane), - "nautilus_shell" => Some(Item::NautilusShell), - "heart_of_the_sea" => Some(Item::HeartOfTheSea), - "crossbow" => Some(Item::Crossbow), - "suspicious_stew" => Some(Item::SuspiciousStew), - "loom" => Some(Item::Loom), - "flower_banner_pattern" => Some(Item::FlowerBannerPattern), - "creeper_banner_pattern" => Some(Item::CreeperBannerPattern), - "skull_banner_pattern" => Some(Item::SkullBannerPattern), - "mojang_banner_pattern" => Some(Item::MojangBannerPattern), - "globe_banner_pattern" => Some(Item::GlobeBannerPattern), - "piglin_banner_pattern" => Some(Item::PiglinBannerPattern), - "composter" => Some(Item::Composter), - "barrel" => Some(Item::Barrel), - "smoker" => Some(Item::Smoker), - "blast_furnace" => Some(Item::BlastFurnace), - "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), - "campfire" => Some(Item::Campfire), - "soul_campfire" => Some(Item::SoulCampfire), - "shroomlight" => Some(Item::Shroomlight), - "honeycomb" => Some(Item::Honeycomb), - "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), - "blackstone_stairs" => Some(Item::BlackstoneStairs), - "gilded_blackstone" => Some(Item::GildedBlackstone), - "polished_blackstone" => Some(Item::PolishedBlackstone), - "polished_blackstone_slab" => Some(Item::PolishedBlackstoneSlab), - "polished_blackstone_stairs" => Some(Item::PolishedBlackstoneStairs), - "chiseled_polished_blackstone" => Some(Item::ChiseledPolishedBlackstone), - "polished_blackstone_bricks" => Some(Item::PolishedBlackstoneBricks), - "polished_blackstone_brick_slab" => Some(Item::PolishedBlackstoneBrickSlab), - "polished_blackstone_brick_stairs" => Some(Item::PolishedBlackstoneBrickStairs), - "cracked_polished_blackstone_bricks" => Some(Item::CrackedPolishedBlackstoneBricks), - "respawn_anchor" => Some(Item::RespawnAnchor), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Item { - /// Returns the `display_name` property of this `Item`. - pub fn display_name(&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", - } - } - - /// Gets a `Item` by its `display_name`. - pub fn from_display_name(display_name: &str) -> Option { - match display_name { - "Air" => Some(Item::Air), - "Stone" => Some(Item::Stone), - "Granite" => Some(Item::Granite), - "Polished Granite" => Some(Item::PolishedGranite), - "Diorite" => Some(Item::Diorite), - "Polished Diorite" => Some(Item::PolishedDiorite), - "Andesite" => Some(Item::Andesite), - "Polished Andesite" => Some(Item::PolishedAndesite), - "Grass Block" => Some(Item::GrassBlock), - "Dirt" => Some(Item::Dirt), - "Coarse Dirt" => Some(Item::CoarseDirt), - "Podzol" => Some(Item::Podzol), - "Crimson Nylium" => Some(Item::CrimsonNylium), - "Warped Nylium" => Some(Item::WarpedNylium), - "Cobblestone" => Some(Item::Cobblestone), - "Oak Planks" => Some(Item::OakPlanks), - "Spruce Planks" => Some(Item::SprucePlanks), - "Birch Planks" => Some(Item::BirchPlanks), - "Jungle Planks" => Some(Item::JunglePlanks), - "Acacia Planks" => Some(Item::AcaciaPlanks), - "Dark Oak Planks" => Some(Item::DarkOakPlanks), - "Crimson Planks" => Some(Item::CrimsonPlanks), - "Warped Planks" => Some(Item::WarpedPlanks), - "Oak Sapling" => Some(Item::OakSapling), - "Spruce Sapling" => Some(Item::SpruceSapling), - "Birch Sapling" => Some(Item::BirchSapling), - "Jungle Sapling" => Some(Item::JungleSapling), - "Acacia Sapling" => Some(Item::AcaciaSapling), - "Dark Oak Sapling" => Some(Item::DarkOakSapling), - "Bedrock" => Some(Item::Bedrock), - "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), - "Nether Gold Ore" => Some(Item::NetherGoldOre), - "Oak Log" => Some(Item::OakLog), - "Spruce Log" => Some(Item::SpruceLog), - "Birch Log" => Some(Item::BirchLog), - "Jungle Log" => Some(Item::JungleLog), - "Acacia Log" => Some(Item::AcaciaLog), - "Dark Oak Log" => Some(Item::DarkOakLog), - "Crimson Stem" => Some(Item::CrimsonStem), - "Warped Stem" => Some(Item::WarpedStem), - "Stripped Oak Log" => Some(Item::StrippedOakLog), - "Stripped Spruce Log" => Some(Item::StrippedSpruceLog), - "Stripped Birch Log" => Some(Item::StrippedBirchLog), - "Stripped Jungle Log" => Some(Item::StrippedJungleLog), - "Stripped Acacia Log" => Some(Item::StrippedAcaciaLog), - "Stripped Dark Oak Log" => Some(Item::StrippedDarkOakLog), - "Stripped Crimson Stem" => Some(Item::StrippedCrimsonStem), - "Stripped Warped Stem" => Some(Item::StrippedWarpedStem), - "Stripped Oak Wood" => Some(Item::StrippedOakWood), - "Stripped Spruce Wood" => Some(Item::StrippedSpruceWood), - "Stripped Birch Wood" => Some(Item::StrippedBirchWood), - "Stripped Jungle Wood" => Some(Item::StrippedJungleWood), - "Stripped Acacia Wood" => Some(Item::StrippedAcaciaWood), - "Stripped Dark Oak Wood" => Some(Item::StrippedDarkOakWood), - "Stripped Crimson Hyphae" => Some(Item::StrippedCrimsonHyphae), - "Stripped Warped Hyphae" => Some(Item::StrippedWarpedHyphae), - "Oak Wood" => Some(Item::OakWood), - "Spruce Wood" => Some(Item::SpruceWood), - "Birch Wood" => Some(Item::BirchWood), - "Jungle Wood" => Some(Item::JungleWood), - "Acacia Wood" => Some(Item::AcaciaWood), - "Dark Oak Wood" => Some(Item::DarkOakWood), - "Crimson Hyphae" => Some(Item::CrimsonHyphae), - "Warped Hyphae" => Some(Item::WarpedHyphae), - "Oak Leaves" => Some(Item::OakLeaves), - "Spruce Leaves" => Some(Item::SpruceLeaves), - "Birch Leaves" => Some(Item::BirchLeaves), - "Jungle Leaves" => Some(Item::JungleLeaves), - "Acacia Leaves" => Some(Item::AcaciaLeaves), - "Dark Oak Leaves" => Some(Item::DarkOakLeaves), - "Sponge" => Some(Item::Sponge), - "Wet Sponge" => Some(Item::WetSponge), - "Glass" => Some(Item::Glass), - "Lapis Lazuli Ore" => Some(Item::LapisOre), - "Lapis Lazuli 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), - "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), - "Light Blue Wool" => Some(Item::LightBlueWool), - "Yellow Wool" => Some(Item::YellowWool), - "Lime Wool" => Some(Item::LimeWool), - "Pink Wool" => Some(Item::PinkWool), - "Gray Wool" => Some(Item::GrayWool), - "Light Gray Wool" => Some(Item::LightGrayWool), - "Cyan Wool" => Some(Item::CyanWool), - "Purple Wool" => Some(Item::PurpleWool), - "Blue Wool" => Some(Item::BlueWool), - "Brown Wool" => Some(Item::BrownWool), - "Green Wool" => Some(Item::GreenWool), - "Red Wool" => Some(Item::RedWool), - "Black Wool" => Some(Item::BlackWool), - "Dandelion" => Some(Item::Dandelion), - "Poppy" => Some(Item::Poppy), - "Blue Orchid" => Some(Item::BlueOrchid), - "Allium" => Some(Item::Allium), - "Azure Bluet" => Some(Item::AzureBluet), - "Red Tulip" => Some(Item::RedTulip), - "Orange Tulip" => Some(Item::OrangeTulip), - "White Tulip" => Some(Item::WhiteTulip), - "Pink Tulip" => Some(Item::PinkTulip), - "Oxeye Daisy" => Some(Item::OxeyeDaisy), - "Cornflower" => Some(Item::Cornflower), - "Lily of the Valley" => Some(Item::LilyOfTheValley), - "Wither Rose" => Some(Item::WitherRose), - "Brown Mushroom" => Some(Item::BrownMushroom), - "Red Mushroom" => Some(Item::RedMushroom), - "Crimson Fungus" => Some(Item::CrimsonFungus), - "Warped Fungus" => Some(Item::WarpedFungus), - "Crimson Roots" => Some(Item::CrimsonRoots), - "Warped Roots" => Some(Item::WarpedRoots), - "Nether Sprouts" => Some(Item::NetherSprouts), - "Weeping Vines" => Some(Item::WeepingVines), - "Twisting Vines" => Some(Item::TwistingVines), - "Sugar Cane" => Some(Item::SugarCane), - "Kelp" => Some(Item::Kelp), - "Bamboo" => Some(Item::Bamboo), - "Block of Gold" => Some(Item::GoldBlock), - "Block of Iron" => Some(Item::IronBlock), - "Oak Slab" => Some(Item::OakSlab), - "Spruce Slab" => Some(Item::SpruceSlab), - "Birch Slab" => Some(Item::BirchSlab), - "Jungle Slab" => Some(Item::JungleSlab), - "Acacia Slab" => Some(Item::AcaciaSlab), - "Dark Oak Slab" => Some(Item::DarkOakSlab), - "Crimson Slab" => Some(Item::CrimsonSlab), - "Warped Slab" => Some(Item::WarpedSlab), - "Stone Slab" => Some(Item::StoneSlab), - "Smooth Stone Slab" => Some(Item::SmoothStoneSlab), - "Sandstone Slab" => Some(Item::SandstoneSlab), - "Cut Sandstone Slab" => Some(Item::CutSandstoneSlab), - "Petrified Oak Slab" => Some(Item::PetrifiedOakSlab), - "Cobblestone Slab" => Some(Item::CobblestoneSlab), - "Brick Slab" => Some(Item::BrickSlab), - "Stone Brick Slab" => Some(Item::StoneBrickSlab), - "Nether Brick Slab" => Some(Item::NetherBrickSlab), - "Quartz Slab" => Some(Item::QuartzSlab), - "Red Sandstone Slab" => Some(Item::RedSandstoneSlab), - "Cut Red Sandstone Slab" => Some(Item::CutRedSandstoneSlab), - "Purpur Slab" => Some(Item::PurpurSlab), - "Prismarine Slab" => Some(Item::PrismarineSlab), - "Prismarine Brick Slab" => Some(Item::PrismarineBrickSlab), - "Dark Prismarine Slab" => Some(Item::DarkPrismarineSlab), - "Smooth Quartz Block" => Some(Item::SmoothQuartz), - "Smooth Red Sandstone" => Some(Item::SmoothRedSandstone), - "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), - "Torch" => Some(Item::Torch), - "End Rod" => Some(Item::EndRod), - "Chorus Plant" => Some(Item::ChorusPlant), - "Chorus Flower" => Some(Item::ChorusFlower), - "Purpur Block" => Some(Item::PurpurBlock), - "Purpur Pillar" => Some(Item::PurpurPillar), - "Purpur Stairs" => Some(Item::PurpurStairs), - "Spawner" => Some(Item::Spawner), - "Oak Stairs" => Some(Item::OakStairs), - "Chest" => Some(Item::Chest), - "Diamond Ore" => Some(Item::DiamondOre), - "Block of Diamond" => 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), - "Cactus" => Some(Item::Cactus), - "Clay" => Some(Item::Clay), - "Jukebox" => Some(Item::Jukebox), - "Oak Fence" => Some(Item::OakFence), - "Spruce Fence" => Some(Item::SpruceFence), - "Birch Fence" => Some(Item::BirchFence), - "Jungle Fence" => Some(Item::JungleFence), - "Acacia Fence" => Some(Item::AcaciaFence), - "Dark Oak Fence" => Some(Item::DarkOakFence), - "Crimson Fence" => Some(Item::CrimsonFence), - "Warped Fence" => Some(Item::WarpedFence), - "Pumpkin" => Some(Item::Pumpkin), - "Carved Pumpkin" => Some(Item::CarvedPumpkin), - "Netherrack" => Some(Item::Netherrack), - "Soul Sand" => Some(Item::SoulSand), - "Soul Soil" => Some(Item::SoulSoil), - "Basalt" => Some(Item::Basalt), - "Polished Basalt" => Some(Item::PolishedBasalt), - "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), - "Stone Bricks" => Some(Item::StoneBricks), - "Mossy Stone Bricks" => Some(Item::MossyStoneBricks), - "Cracked Stone Bricks" => Some(Item::CrackedStoneBricks), - "Chiseled Stone Bricks" => Some(Item::ChiseledStoneBricks), - "Brown Mushroom Block" => Some(Item::BrownMushroomBlock), - "Red Mushroom Block" => Some(Item::RedMushroomBlock), - "Mushroom Stem" => Some(Item::MushroomStem), - "Iron Bars" => Some(Item::IronBars), - "Chain" => Some(Item::Chain), - "Glass Pane" => Some(Item::GlassPane), - "Melon" => Some(Item::Melon), - "Vines" => 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), - "Brick Stairs" => Some(Item::BrickStairs), - "Stone Brick Stairs" => Some(Item::StoneBrickStairs), - "Mycelium" => Some(Item::Mycelium), - "Lily Pad" => Some(Item::LilyPad), - "Nether Bricks" => Some(Item::NetherBricks), - "Cracked Nether Bricks" => Some(Item::CrackedNetherBricks), - "Chiseled Nether Bricks" => Some(Item::ChiseledNetherBricks), - "Nether Brick Fence" => Some(Item::NetherBrickFence), - "Nether Brick Stairs" => Some(Item::NetherBrickStairs), - "Enchanting Table" => Some(Item::EnchantingTable), - "End Portal Frame" => Some(Item::EndPortalFrame), - "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), - "Block of Emerald" => Some(Item::EmeraldBlock), - "Spruce Stairs" => Some(Item::SpruceStairs), - "Birch Stairs" => Some(Item::BirchStairs), - "Jungle Stairs" => Some(Item::JungleStairs), - "Crimson Stairs" => Some(Item::CrimsonStairs), - "Warped Stairs" => Some(Item::WarpedStairs), - "Command Block" => Some(Item::CommandBlock), - "Beacon" => Some(Item::Beacon), - "Cobblestone Wall" => Some(Item::CobblestoneWall), - "Mossy Cobblestone Wall" => Some(Item::MossyCobblestoneWall), - "Brick Wall" => Some(Item::BrickWall), - "Prismarine Wall" => Some(Item::PrismarineWall), - "Red Sandstone Wall" => Some(Item::RedSandstoneWall), - "Mossy Stone Brick Wall" => Some(Item::MossyStoneBrickWall), - "Granite Wall" => Some(Item::GraniteWall), - "Stone Brick Wall" => Some(Item::StoneBrickWall), - "Nether Brick Wall" => Some(Item::NetherBrickWall), - "Andesite Wall" => Some(Item::AndesiteWall), - "Red Nether Brick Wall" => Some(Item::RedNetherBrickWall), - "Sandstone Wall" => Some(Item::SandstoneWall), - "End Stone Brick Wall" => Some(Item::EndStoneBrickWall), - "Diorite Wall" => Some(Item::DioriteWall), - "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), - "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), - "Block of Redstone" => Some(Item::RedstoneBlock), - "Nether Quartz Ore" => Some(Item::NetherQuartzOre), - "Hopper" => Some(Item::Hopper), - "Chiseled Quartz Block" => Some(Item::ChiseledQuartzBlock), - "Block of Quartz" => 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), - "Light Blue Terracotta" => Some(Item::LightBlueTerracotta), - "Yellow Terracotta" => Some(Item::YellowTerracotta), - "Lime Terracotta" => Some(Item::LimeTerracotta), - "Pink Terracotta" => Some(Item::PinkTerracotta), - "Gray Terracotta" => Some(Item::GrayTerracotta), - "Light Gray Terracotta" => Some(Item::LightGrayTerracotta), - "Cyan Terracotta" => Some(Item::CyanTerracotta), - "Purple Terracotta" => Some(Item::PurpleTerracotta), - "Blue Terracotta" => Some(Item::BlueTerracotta), - "Brown Terracotta" => Some(Item::BrownTerracotta), - "Green Terracotta" => Some(Item::GreenTerracotta), - "Red Terracotta" => Some(Item::RedTerracotta), - "Black Terracotta" => Some(Item::BlackTerracotta), - "Barrier" => Some(Item::Barrier), - "Iron Trapdoor" => Some(Item::IronTrapdoor), - "Hay Bale" => Some(Item::HayBlock), - "White Carpet" => Some(Item::WhiteCarpet), - "Orange Carpet" => Some(Item::OrangeCarpet), - "Magenta Carpet" => Some(Item::MagentaCarpet), - "Light Blue Carpet" => Some(Item::LightBlueCarpet), - "Yellow Carpet" => Some(Item::YellowCarpet), - "Lime Carpet" => Some(Item::LimeCarpet), - "Pink Carpet" => Some(Item::PinkCarpet), - "Gray Carpet" => Some(Item::GrayCarpet), - "Light Gray Carpet" => Some(Item::LightGrayCarpet), - "Cyan Carpet" => Some(Item::CyanCarpet), - "Purple Carpet" => Some(Item::PurpleCarpet), - "Blue Carpet" => Some(Item::BlueCarpet), - "Brown Carpet" => Some(Item::BrownCarpet), - "Green Carpet" => Some(Item::GreenCarpet), - "Red Carpet" => Some(Item::RedCarpet), - "Black Carpet" => Some(Item::BlackCarpet), - "Terracotta" => Some(Item::Terracotta), - "Block of Coal" => 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), - "Sunflower" => Some(Item::Sunflower), - "Lilac" => Some(Item::Lilac), - "Rose Bush" => Some(Item::RoseBush), - "Peony" => Some(Item::Peony), - "Tall Grass" => Some(Item::TallGrass), - "Large Fern" => Some(Item::LargeFern), - "White Stained Glass" => Some(Item::WhiteStainedGlass), - "Orange Stained Glass" => Some(Item::OrangeStainedGlass), - "Magenta Stained Glass" => Some(Item::MagentaStainedGlass), - "Light Blue Stained Glass" => Some(Item::LightBlueStainedGlass), - "Yellow Stained Glass" => Some(Item::YellowStainedGlass), - "Lime Stained Glass" => Some(Item::LimeStainedGlass), - "Pink Stained Glass" => Some(Item::PinkStainedGlass), - "Gray Stained Glass" => Some(Item::GrayStainedGlass), - "Light Gray Stained Glass" => Some(Item::LightGrayStainedGlass), - "Cyan Stained Glass" => Some(Item::CyanStainedGlass), - "Purple Stained Glass" => Some(Item::PurpleStainedGlass), - "Blue Stained Glass" => Some(Item::BlueStainedGlass), - "Brown Stained Glass" => Some(Item::BrownStainedGlass), - "Green Stained Glass" => Some(Item::GreenStainedGlass), - "Red Stained Glass" => Some(Item::RedStainedGlass), - "Black Stained Glass" => Some(Item::BlackStainedGlass), - "White Stained Glass Pane" => Some(Item::WhiteStainedGlassPane), - "Orange Stained Glass Pane" => Some(Item::OrangeStainedGlassPane), - "Magenta Stained Glass Pane" => Some(Item::MagentaStainedGlassPane), - "Light Blue Stained Glass Pane" => Some(Item::LightBlueStainedGlassPane), - "Yellow Stained Glass Pane" => Some(Item::YellowStainedGlassPane), - "Lime Stained Glass Pane" => Some(Item::LimeStainedGlassPane), - "Pink Stained Glass Pane" => Some(Item::PinkStainedGlassPane), - "Gray Stained Glass Pane" => Some(Item::GrayStainedGlassPane), - "Light Gray Stained Glass Pane" => Some(Item::LightGrayStainedGlassPane), - "Cyan Stained Glass Pane" => Some(Item::CyanStainedGlassPane), - "Purple Stained Glass Pane" => Some(Item::PurpleStainedGlassPane), - "Blue Stained Glass Pane" => Some(Item::BlueStainedGlassPane), - "Brown Stained Glass Pane" => Some(Item::BrownStainedGlassPane), - "Green Stained Glass Pane" => Some(Item::GreenStainedGlassPane), - "Red Stained Glass Pane" => Some(Item::RedStainedGlassPane), - "Black Stained Glass Pane" => Some(Item::BlackStainedGlassPane), - "Prismarine" => Some(Item::Prismarine), - "Prismarine Bricks" => Some(Item::PrismarineBricks), - "Dark Prismarine" => Some(Item::DarkPrismarine), - "Prismarine Stairs" => Some(Item::PrismarineStairs), - "Prismarine Brick Stairs" => Some(Item::PrismarineBrickStairs), - "Dark Prismarine Stairs" => Some(Item::DarkPrismarineStairs), - "Sea Lantern" => Some(Item::SeaLantern), - "Red Sandstone" => Some(Item::RedSandstone), - "Chiseled Red Sandstone" => Some(Item::ChiseledRedSandstone), - "Cut Red Sandstone" => Some(Item::CutRedSandstone), - "Red Sandstone Stairs" => Some(Item::RedSandstoneStairs), - "Repeating Command Block" => Some(Item::RepeatingCommandBlock), - "Chain Command Block" => Some(Item::ChainCommandBlock), - "Magma Block" => Some(Item::MagmaBlock), - "Nether Wart Block" => Some(Item::NetherWartBlock), - "Warped Wart Block" => Some(Item::WarpedWartBlock), - "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), - "Magenta Shulker Box" => Some(Item::MagentaShulkerBox), - "Light Blue Shulker Box" => Some(Item::LightBlueShulkerBox), - "Yellow Shulker Box" => Some(Item::YellowShulkerBox), - "Lime Shulker Box" => Some(Item::LimeShulkerBox), - "Pink Shulker Box" => Some(Item::PinkShulkerBox), - "Gray Shulker Box" => Some(Item::GrayShulkerBox), - "Light Gray Shulker Box" => Some(Item::LightGrayShulkerBox), - "Cyan Shulker Box" => Some(Item::CyanShulkerBox), - "Purple Shulker Box" => Some(Item::PurpleShulkerBox), - "Blue Shulker Box" => Some(Item::BlueShulkerBox), - "Brown Shulker Box" => Some(Item::BrownShulkerBox), - "Green Shulker Box" => Some(Item::GreenShulkerBox), - "Red Shulker Box" => Some(Item::RedShulkerBox), - "Black Shulker Box" => Some(Item::BlackShulkerBox), - "White Glazed Terracotta" => Some(Item::WhiteGlazedTerracotta), - "Orange Glazed Terracotta" => Some(Item::OrangeGlazedTerracotta), - "Magenta Glazed Terracotta" => Some(Item::MagentaGlazedTerracotta), - "Light Blue Glazed Terracotta" => Some(Item::LightBlueGlazedTerracotta), - "Yellow Glazed Terracotta" => Some(Item::YellowGlazedTerracotta), - "Lime Glazed Terracotta" => Some(Item::LimeGlazedTerracotta), - "Pink Glazed Terracotta" => Some(Item::PinkGlazedTerracotta), - "Gray Glazed Terracotta" => Some(Item::GrayGlazedTerracotta), - "Light Gray Glazed Terracotta" => Some(Item::LightGrayGlazedTerracotta), - "Cyan Glazed Terracotta" => Some(Item::CyanGlazedTerracotta), - "Purple Glazed Terracotta" => Some(Item::PurpleGlazedTerracotta), - "Blue Glazed Terracotta" => Some(Item::BlueGlazedTerracotta), - "Brown Glazed Terracotta" => Some(Item::BrownGlazedTerracotta), - "Green Glazed Terracotta" => Some(Item::GreenGlazedTerracotta), - "Red Glazed Terracotta" => Some(Item::RedGlazedTerracotta), - "Black Glazed Terracotta" => Some(Item::BlackGlazedTerracotta), - "White Concrete" => Some(Item::WhiteConcrete), - "Orange Concrete" => Some(Item::OrangeConcrete), - "Magenta Concrete" => Some(Item::MagentaConcrete), - "Light Blue Concrete" => Some(Item::LightBlueConcrete), - "Yellow Concrete" => Some(Item::YellowConcrete), - "Lime Concrete" => Some(Item::LimeConcrete), - "Pink Concrete" => Some(Item::PinkConcrete), - "Gray Concrete" => Some(Item::GrayConcrete), - "Light Gray Concrete" => Some(Item::LightGrayConcrete), - "Cyan Concrete" => Some(Item::CyanConcrete), - "Purple Concrete" => Some(Item::PurpleConcrete), - "Blue Concrete" => Some(Item::BlueConcrete), - "Brown Concrete" => Some(Item::BrownConcrete), - "Green Concrete" => Some(Item::GreenConcrete), - "Red Concrete" => Some(Item::RedConcrete), - "Black Concrete" => Some(Item::BlackConcrete), - "White Concrete Powder" => Some(Item::WhiteConcretePowder), - "Orange Concrete Powder" => Some(Item::OrangeConcretePowder), - "Magenta Concrete Powder" => Some(Item::MagentaConcretePowder), - "Light Blue Concrete Powder" => Some(Item::LightBlueConcretePowder), - "Yellow Concrete Powder" => Some(Item::YellowConcretePowder), - "Lime Concrete Powder" => Some(Item::LimeConcretePowder), - "Pink Concrete Powder" => Some(Item::PinkConcretePowder), - "Gray Concrete Powder" => Some(Item::GrayConcretePowder), - "Light Gray Concrete Powder" => Some(Item::LightGrayConcretePowder), - "Cyan Concrete Powder" => Some(Item::CyanConcretePowder), - "Purple Concrete Powder" => Some(Item::PurpleConcretePowder), - "Blue Concrete Powder" => Some(Item::BlueConcretePowder), - "Brown Concrete Powder" => Some(Item::BrownConcretePowder), - "Green Concrete Powder" => Some(Item::GreenConcretePowder), - "Red Concrete Powder" => Some(Item::RedConcretePowder), - "Black Concrete Powder" => Some(Item::BlackConcretePowder), - "Turtle Egg" => Some(Item::TurtleEgg), - "Dead Tube Coral Block" => Some(Item::DeadTubeCoralBlock), - "Dead Brain Coral Block" => Some(Item::DeadBrainCoralBlock), - "Dead Bubble Coral Block" => Some(Item::DeadBubbleCoralBlock), - "Dead Fire Coral Block" => Some(Item::DeadFireCoralBlock), - "Dead Horn Coral Block" => Some(Item::DeadHornCoralBlock), - "Tube Coral Block" => Some(Item::TubeCoralBlock), - "Brain Coral Block" => Some(Item::BrainCoralBlock), - "Bubble Coral Block" => Some(Item::BubbleCoralBlock), - "Fire Coral Block" => Some(Item::FireCoralBlock), - "Horn Coral Block" => Some(Item::HornCoralBlock), - "Tube Coral" => Some(Item::TubeCoral), - "Brain Coral" => Some(Item::BrainCoral), - "Bubble Coral" => Some(Item::BubbleCoral), - "Fire Coral" => Some(Item::FireCoral), - "Horn Coral" => Some(Item::HornCoral), - "Dead Brain Coral" => Some(Item::DeadBrainCoral), - "Dead Bubble Coral" => Some(Item::DeadBubbleCoral), - "Dead Fire Coral" => Some(Item::DeadFireCoral), - "Dead Horn Coral" => Some(Item::DeadHornCoral), - "Dead Tube Coral" => Some(Item::DeadTubeCoral), - "Tube Coral Fan" => Some(Item::TubeCoralFan), - "Brain Coral Fan" => Some(Item::BrainCoralFan), - "Bubble Coral Fan" => Some(Item::BubbleCoralFan), - "Fire Coral Fan" => Some(Item::FireCoralFan), - "Horn Coral Fan" => Some(Item::HornCoralFan), - "Dead Tube Coral Fan" => Some(Item::DeadTubeCoralFan), - "Dead Brain Coral Fan" => Some(Item::DeadBrainCoralFan), - "Dead Bubble Coral Fan" => Some(Item::DeadBubbleCoralFan), - "Dead Fire Coral Fan" => Some(Item::DeadFireCoralFan), - "Dead Horn Coral Fan" => Some(Item::DeadHornCoralFan), - "Blue Ice" => Some(Item::BlueIce), - "Conduit" => Some(Item::Conduit), - "Polished Granite Stairs" => Some(Item::PolishedGraniteStairs), - "Smooth Red Sandstone Stairs" => Some(Item::SmoothRedSandstoneStairs), - "Mossy Stone Brick Stairs" => Some(Item::MossyStoneBrickStairs), - "Polished Diorite Stairs" => Some(Item::PolishedDioriteStairs), - "Mossy Cobblestone Stairs" => Some(Item::MossyCobblestoneStairs), - "End Stone Brick Stairs" => Some(Item::EndStoneBrickStairs), - "Stone Stairs" => Some(Item::StoneStairs), - "Smooth Sandstone Stairs" => Some(Item::SmoothSandstoneStairs), - "Smooth Quartz Stairs" => Some(Item::SmoothQuartzStairs), - "Granite Stairs" => Some(Item::GraniteStairs), - "Andesite Stairs" => Some(Item::AndesiteStairs), - "Red Nether Brick Stairs" => Some(Item::RedNetherBrickStairs), - "Polished Andesite Stairs" => Some(Item::PolishedAndesiteStairs), - "Diorite Stairs" => Some(Item::DioriteStairs), - "Polished Granite Slab" => Some(Item::PolishedGraniteSlab), - "Smooth Red Sandstone Slab" => Some(Item::SmoothRedSandstoneSlab), - "Mossy Stone Brick Slab" => Some(Item::MossyStoneBrickSlab), - "Polished Diorite Slab" => Some(Item::PolishedDioriteSlab), - "Mossy Cobblestone Slab" => Some(Item::MossyCobblestoneSlab), - "End Stone Brick Slab" => Some(Item::EndStoneBrickSlab), - "Smooth Sandstone Slab" => Some(Item::SmoothSandstoneSlab), - "Smooth Quartz Slab" => Some(Item::SmoothQuartzSlab), - "Granite Slab" => Some(Item::GraniteSlab), - "Andesite Slab" => Some(Item::AndesiteSlab), - "Red Nether Brick Slab" => Some(Item::RedNetherBrickSlab), - "Polished Andesite Slab" => Some(Item::PolishedAndesiteSlab), - "Diorite Slab" => Some(Item::DioriteSlab), - "Scaffolding" => Some(Item::Scaffolding), - "Iron Door" => Some(Item::IronDoor), - "Oak Door" => Some(Item::OakDoor), - "Spruce Door" => Some(Item::SpruceDoor), - "Birch Door" => Some(Item::BirchDoor), - "Jungle Door" => Some(Item::JungleDoor), - "Acacia Door" => Some(Item::AcaciaDoor), - "Dark Oak Door" => Some(Item::DarkOakDoor), - "Crimson Door" => Some(Item::CrimsonDoor), - "Warped Door" => Some(Item::WarpedDoor), - "Redstone Repeater" => Some(Item::Repeater), - "Redstone Comparator" => Some(Item::Comparator), - "Structure Block" => Some(Item::StructureBlock), - "Jigsaw Block" => Some(Item::Jigsaw), - "Turtle Shell" => Some(Item::TurtleHelmet), - "Scute" => Some(Item::Scute), - "Flint and Steel" => Some(Item::FlintAndSteel), - "Apple" => Some(Item::Apple), - "Bow" => Some(Item::Bow), - "Arrow" => Some(Item::Arrow), - "Coal" => Some(Item::Coal), - "Charcoal" => Some(Item::Charcoal), - "Diamond" => Some(Item::Diamond), - "Iron Ingot" => Some(Item::IronIngot), - "Gold Ingot" => Some(Item::GoldIngot), - "Netherite Ingot" => Some(Item::NetheriteIngot), - "Netherite Scrap" => Some(Item::NetheriteScrap), - "Wooden Sword" => Some(Item::WoodenSword), - "Wooden Shovel" => Some(Item::WoodenShovel), - "Wooden Pickaxe" => Some(Item::WoodenPickaxe), - "Wooden Axe" => Some(Item::WoodenAxe), - "Wooden Hoe" => Some(Item::WoodenHoe), - "Stone Sword" => Some(Item::StoneSword), - "Stone Shovel" => Some(Item::StoneShovel), - "Stone Pickaxe" => Some(Item::StonePickaxe), - "Stone Axe" => Some(Item::StoneAxe), - "Stone Hoe" => Some(Item::StoneHoe), - "Golden Sword" => Some(Item::GoldenSword), - "Golden Shovel" => Some(Item::GoldenShovel), - "Golden Pickaxe" => Some(Item::GoldenPickaxe), - "Golden Axe" => Some(Item::GoldenAxe), - "Golden Hoe" => Some(Item::GoldenHoe), - "Iron Sword" => Some(Item::IronSword), - "Iron Shovel" => Some(Item::IronShovel), - "Iron Pickaxe" => Some(Item::IronPickaxe), - "Iron Axe" => Some(Item::IronAxe), - "Iron Hoe" => Some(Item::IronHoe), - "Diamond Sword" => Some(Item::DiamondSword), - "Diamond Shovel" => Some(Item::DiamondShovel), - "Diamond Pickaxe" => Some(Item::DiamondPickaxe), - "Diamond Axe" => Some(Item::DiamondAxe), - "Diamond Hoe" => Some(Item::DiamondHoe), - "Netherite Sword" => Some(Item::NetheriteSword), - "Netherite Shovel" => Some(Item::NetheriteShovel), - "Netherite Pickaxe" => Some(Item::NetheritePickaxe), - "Netherite Axe" => Some(Item::NetheriteAxe), - "Netherite Hoe" => Some(Item::NetheriteHoe), - "Stick" => Some(Item::Stick), - "Bowl" => Some(Item::Bowl), - "Mushroom Stew" => Some(Item::MushroomStew), - "String" => Some(Item::String), - "Feather" => Some(Item::Feather), - "Gunpowder" => Some(Item::Gunpowder), - "Wheat Seeds" => Some(Item::WheatSeeds), - "Wheat" => Some(Item::Wheat), - "Bread" => Some(Item::Bread), - "Leather Cap" => Some(Item::LeatherHelmet), - "Leather Tunic" => Some(Item::LeatherChestplate), - "Leather Pants" => Some(Item::LeatherLeggings), - "Leather Boots" => Some(Item::LeatherBoots), - "Chainmail Helmet" => Some(Item::ChainmailHelmet), - "Chainmail Chestplate" => Some(Item::ChainmailChestplate), - "Chainmail Leggings" => Some(Item::ChainmailLeggings), - "Chainmail Boots" => Some(Item::ChainmailBoots), - "Iron Helmet" => Some(Item::IronHelmet), - "Iron Chestplate" => Some(Item::IronChestplate), - "Iron Leggings" => Some(Item::IronLeggings), - "Iron Boots" => Some(Item::IronBoots), - "Diamond Helmet" => Some(Item::DiamondHelmet), - "Diamond Chestplate" => Some(Item::DiamondChestplate), - "Diamond Leggings" => Some(Item::DiamondLeggings), - "Diamond Boots" => Some(Item::DiamondBoots), - "Golden Helmet" => Some(Item::GoldenHelmet), - "Golden Chestplate" => Some(Item::GoldenChestplate), - "Golden Leggings" => Some(Item::GoldenLeggings), - "Golden Boots" => Some(Item::GoldenBoots), - "Netherite Helmet" => Some(Item::NetheriteHelmet), - "Netherite Chestplate" => Some(Item::NetheriteChestplate), - "Netherite Leggings" => Some(Item::NetheriteLeggings), - "Netherite Boots" => Some(Item::NetheriteBoots), - "Flint" => Some(Item::Flint), - "Raw Porkchop" => Some(Item::Porkchop), - "Cooked Porkchop" => Some(Item::CookedPorkchop), - "Painting" => Some(Item::Painting), - "Golden Apple" => Some(Item::GoldenApple), - "Enchanted Golden Apple" => Some(Item::EnchantedGoldenApple), - "Oak Sign" => Some(Item::OakSign), - "Spruce Sign" => Some(Item::SpruceSign), - "Birch Sign" => Some(Item::BirchSign), - "Jungle Sign" => Some(Item::JungleSign), - "Acacia Sign" => Some(Item::AcaciaSign), - "Dark Oak Sign" => Some(Item::DarkOakSign), - "Crimson Sign" => Some(Item::CrimsonSign), - "Warped Sign" => Some(Item::WarpedSign), - "Bucket" => Some(Item::Bucket), - "Water Bucket" => Some(Item::WaterBucket), - "Lava Bucket" => Some(Item::LavaBucket), - "Minecart" => Some(Item::Minecart), - "Saddle" => Some(Item::Saddle), - "Redstone Dust" => Some(Item::Redstone), - "Snowball" => Some(Item::Snowball), - "Oak Boat" => Some(Item::OakBoat), - "Leather" => Some(Item::Leather), - "Milk Bucket" => Some(Item::MilkBucket), - "Bucket of Pufferfish" => Some(Item::PufferfishBucket), - "Bucket of Salmon" => Some(Item::SalmonBucket), - "Bucket of Cod" => Some(Item::CodBucket), - "Bucket of Tropical Fish" => Some(Item::TropicalFishBucket), - "Brick" => Some(Item::Brick), - "Clay Ball" => Some(Item::ClayBall), - "Dried Kelp Block" => Some(Item::DriedKelpBlock), - "Paper" => Some(Item::Paper), - "Book" => Some(Item::Book), - "Slimeball" => Some(Item::SlimeBall), - "Minecart with Chest" => Some(Item::ChestMinecart), - "Minecart with Furnace" => Some(Item::FurnaceMinecart), - "Egg" => Some(Item::Egg), - "Compass" => Some(Item::Compass), - "Fishing Rod" => Some(Item::FishingRod), - "Clock" => Some(Item::Clock), - "Glowstone Dust" => Some(Item::GlowstoneDust), - "Raw Cod" => Some(Item::Cod), - "Raw Salmon" => Some(Item::Salmon), - "Tropical Fish" => Some(Item::TropicalFish), - "Pufferfish" => Some(Item::Pufferfish), - "Cooked Cod" => Some(Item::CookedCod), - "Cooked Salmon" => Some(Item::CookedSalmon), - "Ink Sac" => Some(Item::InkSac), - "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), - "Light Blue Dye" => Some(Item::LightBlueDye), - "Yellow Dye" => Some(Item::YellowDye), - "Lime Dye" => Some(Item::LimeDye), - "Pink Dye" => Some(Item::PinkDye), - "Gray Dye" => Some(Item::GrayDye), - "Light Gray Dye" => Some(Item::LightGrayDye), - "Cyan Dye" => Some(Item::CyanDye), - "Purple Dye" => Some(Item::PurpleDye), - "Blue Dye" => Some(Item::BlueDye), - "Brown Dye" => Some(Item::BrownDye), - "Green Dye" => Some(Item::GreenDye), - "Red Dye" => Some(Item::RedDye), - "Black Dye" => Some(Item::BlackDye), - "Bone Meal" => Some(Item::BoneMeal), - "Bone" => Some(Item::Bone), - "Sugar" => Some(Item::Sugar), - "Cake" => Some(Item::Cake), - "White Bed" => Some(Item::WhiteBed), - "Orange Bed" => Some(Item::OrangeBed), - "Magenta Bed" => Some(Item::MagentaBed), - "Light Blue Bed" => Some(Item::LightBlueBed), - "Yellow Bed" => Some(Item::YellowBed), - "Lime Bed" => Some(Item::LimeBed), - "Pink Bed" => Some(Item::PinkBed), - "Gray Bed" => Some(Item::GrayBed), - "Light Gray Bed" => Some(Item::LightGrayBed), - "Cyan Bed" => Some(Item::CyanBed), - "Purple Bed" => Some(Item::PurpleBed), - "Blue Bed" => Some(Item::BlueBed), - "Brown Bed" => Some(Item::BrownBed), - "Green Bed" => Some(Item::GreenBed), - "Red Bed" => Some(Item::RedBed), - "Black Bed" => Some(Item::BlackBed), - "Cookie" => Some(Item::Cookie), - "Map" => Some(Item::FilledMap), - "Shears" => Some(Item::Shears), - "Melon Slice" => Some(Item::MelonSlice), - "Dried Kelp" => Some(Item::DriedKelp), - "Pumpkin Seeds" => Some(Item::PumpkinSeeds), - "Melon Seeds" => Some(Item::MelonSeeds), - "Raw Beef" => Some(Item::Beef), - "Steak" => Some(Item::CookedBeef), - "Raw Chicken" => Some(Item::Chicken), - "Cooked Chicken" => Some(Item::CookedChicken), - "Rotten Flesh" => Some(Item::RottenFlesh), - "Ender Pearl" => Some(Item::EnderPearl), - "Blaze Rod" => Some(Item::BlazeRod), - "Ghast Tear" => Some(Item::GhastTear), - "Gold Nugget" => Some(Item::GoldNugget), - "Nether Wart" => Some(Item::NetherWart), - "Potion" => Some(Item::Potion), - "Glass Bottle" => Some(Item::GlassBottle), - "Spider Eye" => Some(Item::SpiderEye), - "Fermented Spider Eye" => Some(Item::FermentedSpiderEye), - "Blaze Powder" => Some(Item::BlazePowder), - "Magma Cream" => Some(Item::MagmaCream), - "Brewing Stand" => Some(Item::BrewingStand), - "Cauldron" => Some(Item::Cauldron), - "Eye of Ender" => Some(Item::EnderEye), - "Glistering Melon Slice" => Some(Item::GlisteringMelonSlice), - "Bat Spawn Egg" => Some(Item::BatSpawnEgg), - "Bee Spawn Egg" => Some(Item::BeeSpawnEgg), - "Blaze Spawn Egg" => Some(Item::BlazeSpawnEgg), - "Cat Spawn Egg" => Some(Item::CatSpawnEgg), - "Cave Spider Spawn Egg" => Some(Item::CaveSpiderSpawnEgg), - "Chicken Spawn Egg" => Some(Item::ChickenSpawnEgg), - "Cod Spawn Egg" => Some(Item::CodSpawnEgg), - "Cow Spawn Egg" => Some(Item::CowSpawnEgg), - "Creeper Spawn Egg" => Some(Item::CreeperSpawnEgg), - "Dolphin Spawn Egg" => Some(Item::DolphinSpawnEgg), - "Donkey Spawn Egg" => Some(Item::DonkeySpawnEgg), - "Drowned Spawn Egg" => Some(Item::DrownedSpawnEgg), - "Elder Guardian Spawn Egg" => Some(Item::ElderGuardianSpawnEgg), - "Enderman Spawn Egg" => Some(Item::EndermanSpawnEgg), - "Endermite Spawn Egg" => Some(Item::EndermiteSpawnEgg), - "Evoker Spawn Egg" => Some(Item::EvokerSpawnEgg), - "Fox Spawn Egg" => Some(Item::FoxSpawnEgg), - "Ghast Spawn Egg" => Some(Item::GhastSpawnEgg), - "Guardian Spawn Egg" => Some(Item::GuardianSpawnEgg), - "Hoglin Spawn Egg" => Some(Item::HoglinSpawnEgg), - "Horse Spawn Egg" => Some(Item::HorseSpawnEgg), - "Husk Spawn Egg" => Some(Item::HuskSpawnEgg), - "Llama Spawn Egg" => Some(Item::LlamaSpawnEgg), - "Magma Cube Spawn Egg" => Some(Item::MagmaCubeSpawnEgg), - "Mooshroom Spawn Egg" => Some(Item::MooshroomSpawnEgg), - "Mule Spawn Egg" => Some(Item::MuleSpawnEgg), - "Ocelot Spawn Egg" => Some(Item::OcelotSpawnEgg), - "Panda Spawn Egg" => Some(Item::PandaSpawnEgg), - "Parrot Spawn Egg" => Some(Item::ParrotSpawnEgg), - "Phantom Spawn Egg" => Some(Item::PhantomSpawnEgg), - "Pig Spawn Egg" => Some(Item::PigSpawnEgg), - "Piglin Spawn Egg" => Some(Item::PiglinSpawnEgg), - "Piglin Brute Spawn Egg" => Some(Item::PiglinBruteSpawnEgg), - "Pillager Spawn Egg" => Some(Item::PillagerSpawnEgg), - "Polar Bear Spawn Egg" => Some(Item::PolarBearSpawnEgg), - "Pufferfish Spawn Egg" => Some(Item::PufferfishSpawnEgg), - "Rabbit Spawn Egg" => Some(Item::RabbitSpawnEgg), - "Ravager Spawn Egg" => Some(Item::RavagerSpawnEgg), - "Salmon Spawn Egg" => Some(Item::SalmonSpawnEgg), - "Sheep Spawn Egg" => Some(Item::SheepSpawnEgg), - "Shulker Spawn Egg" => Some(Item::ShulkerSpawnEgg), - "Silverfish Spawn Egg" => Some(Item::SilverfishSpawnEgg), - "Skeleton Spawn Egg" => Some(Item::SkeletonSpawnEgg), - "Skeleton Horse Spawn Egg" => Some(Item::SkeletonHorseSpawnEgg), - "Slime Spawn Egg" => Some(Item::SlimeSpawnEgg), - "Spider Spawn Egg" => Some(Item::SpiderSpawnEgg), - "Squid Spawn Egg" => Some(Item::SquidSpawnEgg), - "Stray Spawn Egg" => Some(Item::StraySpawnEgg), - "Strider Spawn Egg" => Some(Item::StriderSpawnEgg), - "Trader Llama Spawn Egg" => Some(Item::TraderLlamaSpawnEgg), - "Tropical Fish Spawn Egg" => Some(Item::TropicalFishSpawnEgg), - "Turtle Spawn Egg" => Some(Item::TurtleSpawnEgg), - "Vex Spawn Egg" => Some(Item::VexSpawnEgg), - "Villager Spawn Egg" => Some(Item::VillagerSpawnEgg), - "Vindicator Spawn Egg" => Some(Item::VindicatorSpawnEgg), - "Wandering Trader Spawn Egg" => Some(Item::WanderingTraderSpawnEgg), - "Witch Spawn Egg" => Some(Item::WitchSpawnEgg), - "Wither Skeleton Spawn Egg" => Some(Item::WitherSkeletonSpawnEgg), - "Wolf Spawn Egg" => Some(Item::WolfSpawnEgg), - "Zoglin Spawn Egg" => Some(Item::ZoglinSpawnEgg), - "Zombie Spawn Egg" => Some(Item::ZombieSpawnEgg), - "Zombie Horse Spawn Egg" => Some(Item::ZombieHorseSpawnEgg), - "Zombie Villager Spawn Egg" => Some(Item::ZombieVillagerSpawnEgg), - "Zombified Piglin Spawn Egg" => Some(Item::ZombifiedPiglinSpawnEgg), - "Bottle o' Enchanting" => Some(Item::ExperienceBottle), - "Fire Charge" => Some(Item::FireCharge), - "Book and Quill" => Some(Item::WritableBook), - "Written Book" => Some(Item::WrittenBook), - "Emerald" => Some(Item::Emerald), - "Item Frame" => Some(Item::ItemFrame), - "Flower Pot" => Some(Item::FlowerPot), - "Carrot" => Some(Item::Carrot), - "Potato" => Some(Item::Potato), - "Baked Potato" => Some(Item::BakedPotato), - "Poisonous Potato" => Some(Item::PoisonousPotato), - "Empty Map" => Some(Item::Map), - "Golden Carrot" => Some(Item::GoldenCarrot), - "Skeleton Skull" => Some(Item::SkeletonSkull), - "Wither Skeleton Skull" => Some(Item::WitherSkeletonSkull), - "Player Head" => Some(Item::PlayerHead), - "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), - "Nether Quartz" => Some(Item::Quartz), - "Minecart with TNT" => Some(Item::TntMinecart), - "Minecart with Hopper" => Some(Item::HopperMinecart), - "Prismarine Shard" => Some(Item::PrismarineShard), - "Prismarine Crystals" => Some(Item::PrismarineCrystals), - "Raw Rabbit" => Some(Item::Rabbit), - "Cooked Rabbit" => Some(Item::CookedRabbit), - "Rabbit Stew" => Some(Item::RabbitStew), - "Rabbit's Foot" => Some(Item::RabbitFoot), - "Rabbit Hide" => Some(Item::RabbitHide), - "Armor Stand" => Some(Item::ArmorStand), - "Iron Horse Armor" => Some(Item::IronHorseArmor), - "Golden Horse Armor" => Some(Item::GoldenHorseArmor), - "Diamond Horse Armor" => Some(Item::DiamondHorseArmor), - "Leather Horse Armor" => Some(Item::LeatherHorseArmor), - "Lead" => Some(Item::Lead), - "Name Tag" => Some(Item::NameTag), - "Minecart with Command Block" => Some(Item::CommandBlockMinecart), - "Raw Mutton" => Some(Item::Mutton), - "Cooked Mutton" => Some(Item::CookedMutton), - "White Banner" => Some(Item::WhiteBanner), - "Orange Banner" => Some(Item::OrangeBanner), - "Magenta Banner" => Some(Item::MagentaBanner), - "Light Blue Banner" => Some(Item::LightBlueBanner), - "Yellow Banner" => Some(Item::YellowBanner), - "Lime Banner" => Some(Item::LimeBanner), - "Pink Banner" => Some(Item::PinkBanner), - "Gray Banner" => Some(Item::GrayBanner), - "Light Gray Banner" => Some(Item::LightGrayBanner), - "Cyan Banner" => Some(Item::CyanBanner), - "Purple Banner" => Some(Item::PurpleBanner), - "Blue Banner" => Some(Item::BlueBanner), - "Brown Banner" => Some(Item::BrownBanner), - "Green Banner" => Some(Item::GreenBanner), - "Red Banner" => Some(Item::RedBanner), - "Black Banner" => Some(Item::BlackBanner), - "End Crystal" => Some(Item::EndCrystal), - "Chorus Fruit" => Some(Item::ChorusFruit), - "Popped Chorus Fruit" => Some(Item::PoppedChorusFruit), - "Beetroot" => Some(Item::Beetroot), - "Beetroot Seeds" => Some(Item::BeetrootSeeds), - "Beetroot Soup" => Some(Item::BeetrootSoup), - "Dragon's Breath" => Some(Item::DragonBreath), - "Splash Potion" => Some(Item::SplashPotion), - "Spectral Arrow" => Some(Item::SpectralArrow), - "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), - "Knowledge Book" => Some(Item::KnowledgeBook), - "Debug Stick" => Some(Item::DebugStick), - "13 Disc" => Some(Item::MusicDisc13), - "Cat Disc" => Some(Item::MusicDiscCat), - "Blocks Disc" => Some(Item::MusicDiscBlocks), - "Chirp Disc" => Some(Item::MusicDiscChirp), - "Far Disc" => Some(Item::MusicDiscFar), - "Mall Disc" => Some(Item::MusicDiscMall), - "Mellohi Disc" => Some(Item::MusicDiscMellohi), - "Stal Disc" => Some(Item::MusicDiscStal), - "Strad Disc" => Some(Item::MusicDiscStrad), - "Ward Disc" => Some(Item::MusicDiscWard), - "11 Disc" => Some(Item::MusicDisc11), - "Wait Disc" => Some(Item::MusicDiscWait), - "Music Disc" => Some(Item::MusicDiscPigstep), - "Trident" => Some(Item::Trident), - "Phantom Membrane" => Some(Item::PhantomMembrane), - "Nautilus Shell" => Some(Item::NautilusShell), - "Heart of the Sea" => Some(Item::HeartOfTheSea), - "Crossbow" => Some(Item::Crossbow), - "Suspicious Stew" => Some(Item::SuspiciousStew), - "Loom" => Some(Item::Loom), - "Banner Pattern" => Some(Item::FlowerBannerPattern), - "Banner Pattern" => Some(Item::CreeperBannerPattern), - "Banner Pattern" => Some(Item::SkullBannerPattern), - "Banner Pattern" => Some(Item::MojangBannerPattern), - "Banner Pattern" => Some(Item::GlobeBannerPattern), - "Banner Pattern" => Some(Item::PiglinBannerPattern), - "Composter" => Some(Item::Composter), - "Barrel" => Some(Item::Barrel), - "Smoker" => Some(Item::Smoker), - "Blast Furnace" => Some(Item::BlastFurnace), - "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), - "Campfire" => Some(Item::Campfire), - "Soul Campfire" => Some(Item::SoulCampfire), - "Shroomlight" => Some(Item::Shroomlight), - "Honeycomb" => Some(Item::Honeycomb), - "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), - "Block of Netherite" => 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), - "Blackstone Stairs" => Some(Item::BlackstoneStairs), - "Gilded Blackstone" => Some(Item::GildedBlackstone), - "Polished Blackstone" => Some(Item::PolishedBlackstone), - "Polished Blackstone Slab" => Some(Item::PolishedBlackstoneSlab), - "Polished Blackstone Stairs" => Some(Item::PolishedBlackstoneStairs), - "Chiseled Polished Blackstone" => Some(Item::ChiseledPolishedBlackstone), - "Polished Blackstone Bricks" => Some(Item::PolishedBlackstoneBricks), - "Polished Blackstone Brick Slab" => Some(Item::PolishedBlackstoneBrickSlab), - "Polished Blackstone Brick Stairs" => Some(Item::PolishedBlackstoneBrickStairs), - "Cracked Polished Blackstone Bricks" => Some(Item::CrackedPolishedBlackstoneBricks), - "Respawn Anchor" => Some(Item::RespawnAnchor), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Item { - /// Returns the `stack_size` property of this `Item`. - 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, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Item { - /// Returns the `durability` property of this `Item`. - pub fn durability(&self) -> Option { - match self { - Item::Air => None, - Item::Stone => None, - Item::Granite => None, - Item::PolishedGranite => None, - Item::Diorite => None, - Item::PolishedDiorite => None, - Item::Andesite => None, - Item::PolishedAndesite => None, - Item::GrassBlock => None, - Item::Dirt => None, - Item::CoarseDirt => None, - Item::Podzol => None, - Item::CrimsonNylium => None, - Item::WarpedNylium => None, - Item::Cobblestone => None, - Item::OakPlanks => None, - Item::SprucePlanks => None, - Item::BirchPlanks => None, - Item::JunglePlanks => None, - Item::AcaciaPlanks => None, - Item::DarkOakPlanks => None, - Item::CrimsonPlanks => None, - Item::WarpedPlanks => None, - Item::OakSapling => None, - Item::SpruceSapling => None, - Item::BirchSapling => None, - Item::JungleSapling => None, - Item::AcaciaSapling => None, - Item::DarkOakSapling => None, - Item::Bedrock => None, - Item::Sand => None, - Item::RedSand => None, - Item::Gravel => None, - Item::GoldOre => None, - Item::IronOre => None, - Item::CoalOre => None, - Item::NetherGoldOre => None, - Item::OakLog => None, - Item::SpruceLog => None, - Item::BirchLog => None, - Item::JungleLog => None, - Item::AcaciaLog => None, - Item::DarkOakLog => None, - Item::CrimsonStem => None, - Item::WarpedStem => None, - Item::StrippedOakLog => None, - Item::StrippedSpruceLog => None, - Item::StrippedBirchLog => None, - Item::StrippedJungleLog => None, - Item::StrippedAcaciaLog => None, - Item::StrippedDarkOakLog => None, - Item::StrippedCrimsonStem => None, - Item::StrippedWarpedStem => None, - Item::StrippedOakWood => None, - Item::StrippedSpruceWood => None, - Item::StrippedBirchWood => None, - Item::StrippedJungleWood => None, - Item::StrippedAcaciaWood => None, - Item::StrippedDarkOakWood => None, - Item::StrippedCrimsonHyphae => None, - Item::StrippedWarpedHyphae => None, - Item::OakWood => None, - Item::SpruceWood => None, - Item::BirchWood => None, - Item::JungleWood => None, - Item::AcaciaWood => None, - Item::DarkOakWood => None, - Item::CrimsonHyphae => None, - Item::WarpedHyphae => None, - Item::OakLeaves => None, - Item::SpruceLeaves => None, - Item::BirchLeaves => None, - Item::JungleLeaves => None, - Item::AcaciaLeaves => None, - Item::DarkOakLeaves => None, - Item::Sponge => None, - Item::WetSponge => None, - Item::Glass => None, - Item::LapisOre => 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::DeadBush => None, - Item::Seagrass => None, - Item::SeaPickle => None, - Item::Piston => None, - Item::WhiteWool => None, - Item::OrangeWool => None, - Item::MagentaWool => None, - Item::LightBlueWool => None, - Item::YellowWool => None, - Item::LimeWool => None, - Item::PinkWool => None, - Item::GrayWool => None, - Item::LightGrayWool => None, - Item::CyanWool => None, - Item::PurpleWool => None, - Item::BlueWool => None, - Item::BrownWool => None, - Item::GreenWool => None, - Item::RedWool => None, - Item::BlackWool => None, - Item::Dandelion => None, - Item::Poppy => None, - Item::BlueOrchid => None, - Item::Allium => None, - Item::AzureBluet => None, - Item::RedTulip => None, - Item::OrangeTulip => None, - Item::WhiteTulip => None, - Item::PinkTulip => None, - Item::OxeyeDaisy => None, - Item::Cornflower => None, - Item::LilyOfTheValley => None, - Item::WitherRose => None, - Item::BrownMushroom => None, - Item::RedMushroom => None, - Item::CrimsonFungus => None, - Item::WarpedFungus => None, - Item::CrimsonRoots => None, - Item::WarpedRoots => None, - Item::NetherSprouts => None, - Item::WeepingVines => None, - Item::TwistingVines => None, - Item::SugarCane => None, - Item::Kelp => None, - Item::Bamboo => None, - Item::GoldBlock => None, - Item::IronBlock => None, - Item::OakSlab => None, - Item::SpruceSlab => None, - Item::BirchSlab => None, - Item::JungleSlab => None, - Item::AcaciaSlab => None, - Item::DarkOakSlab => None, - Item::CrimsonSlab => None, - Item::WarpedSlab => None, - Item::StoneSlab => None, - Item::SmoothStoneSlab => None, - Item::SandstoneSlab => None, - Item::CutSandstoneSlab => None, - Item::PetrifiedOakSlab => None, - Item::CobblestoneSlab => None, - Item::BrickSlab => None, - Item::StoneBrickSlab => None, - Item::NetherBrickSlab => None, - Item::QuartzSlab => None, - Item::RedSandstoneSlab => None, - Item::CutRedSandstoneSlab => None, - Item::PurpurSlab => None, - Item::PrismarineSlab => None, - Item::PrismarineBrickSlab => None, - Item::DarkPrismarineSlab => None, - Item::SmoothQuartz => None, - Item::SmoothRedSandstone => None, - Item::SmoothSandstone => None, - Item::SmoothStone => None, - Item::Bricks => None, - Item::Tnt => None, - Item::Bookshelf => None, - Item::MossyCobblestone => None, - Item::Obsidian => None, - Item::Torch => None, - Item::EndRod => None, - Item::ChorusPlant => None, - Item::ChorusFlower => None, - Item::PurpurBlock => None, - Item::PurpurPillar => None, - Item::PurpurStairs => None, - 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, - Item::Cactus => None, - Item::Clay => None, - Item::Jukebox => None, - Item::OakFence => None, - Item::SpruceFence => None, - Item::BirchFence => None, - Item::JungleFence => None, - Item::AcaciaFence => None, - Item::DarkOakFence => None, - Item::CrimsonFence => None, - Item::WarpedFence => None, - Item::Pumpkin => None, - Item::CarvedPumpkin => None, - Item::Netherrack => None, - Item::SoulSand => None, - Item::SoulSoil => None, - Item::Basalt => None, - Item::PolishedBasalt => 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::StoneBricks => None, - Item::MossyStoneBricks => None, - Item::CrackedStoneBricks => None, - Item::ChiseledStoneBricks => None, - Item::BrownMushroomBlock => None, - Item::RedMushroomBlock => None, - Item::MushroomStem => None, - Item::IronBars => None, - Item::Chain => None, - 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::BrickStairs => None, - Item::StoneBrickStairs => None, - Item::Mycelium => None, - Item::LilyPad => None, - Item::NetherBricks => None, - Item::CrackedNetherBricks => None, - Item::ChiseledNetherBricks => None, - Item::NetherBrickFence => None, - Item::NetherBrickStairs => None, - Item::EnchantingTable => None, - Item::EndPortalFrame => None, - 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, - Item::JungleStairs => None, - Item::CrimsonStairs => None, - Item::WarpedStairs => None, - Item::CommandBlock => None, - Item::Beacon => None, - Item::CobblestoneWall => None, - Item::MossyCobblestoneWall => None, - Item::BrickWall => None, - Item::PrismarineWall => None, - Item::RedSandstoneWall => None, - Item::MossyStoneBrickWall => None, - Item::GraniteWall => None, - Item::StoneBrickWall => None, - Item::NetherBrickWall => None, - Item::AndesiteWall => None, - Item::RedNetherBrickWall => None, - Item::SandstoneWall => None, - Item::EndStoneBrickWall => None, - Item::DioriteWall => None, - 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::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, - Item::LightBlueTerracotta => None, - Item::YellowTerracotta => None, - Item::LimeTerracotta => None, - Item::PinkTerracotta => None, - Item::GrayTerracotta => None, - Item::LightGrayTerracotta => None, - Item::CyanTerracotta => None, - Item::PurpleTerracotta => None, - Item::BlueTerracotta => None, - Item::BrownTerracotta => None, - Item::GreenTerracotta => None, - Item::RedTerracotta => None, - Item::BlackTerracotta => None, - Item::Barrier => None, - Item::IronTrapdoor => None, - Item::HayBlock => None, - Item::WhiteCarpet => None, - Item::OrangeCarpet => None, - Item::MagentaCarpet => None, - Item::LightBlueCarpet => None, - Item::YellowCarpet => None, - Item::LimeCarpet => None, - Item::PinkCarpet => None, - Item::GrayCarpet => None, - Item::LightGrayCarpet => None, - Item::CyanCarpet => None, - Item::PurpleCarpet => None, - Item::BlueCarpet => None, - Item::BrownCarpet => None, - Item::GreenCarpet => None, - 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::Sunflower => None, - Item::Lilac => None, - Item::RoseBush => None, - Item::Peony => None, - Item::TallGrass => None, - Item::LargeFern => None, - Item::WhiteStainedGlass => None, - Item::OrangeStainedGlass => None, - Item::MagentaStainedGlass => None, - Item::LightBlueStainedGlass => None, - Item::YellowStainedGlass => None, - Item::LimeStainedGlass => None, - Item::PinkStainedGlass => None, - Item::GrayStainedGlass => None, - Item::LightGrayStainedGlass => None, - Item::CyanStainedGlass => None, - Item::PurpleStainedGlass => None, - Item::BlueStainedGlass => None, - Item::BrownStainedGlass => None, - Item::GreenStainedGlass => None, - Item::RedStainedGlass => None, - Item::BlackStainedGlass => None, - Item::WhiteStainedGlassPane => None, - Item::OrangeStainedGlassPane => None, - Item::MagentaStainedGlassPane => None, - Item::LightBlueStainedGlassPane => None, - Item::YellowStainedGlassPane => None, - Item::LimeStainedGlassPane => None, - Item::PinkStainedGlassPane => None, - Item::GrayStainedGlassPane => None, - Item::LightGrayStainedGlassPane => None, - Item::CyanStainedGlassPane => None, - Item::PurpleStainedGlassPane => None, - Item::BlueStainedGlassPane => None, - Item::BrownStainedGlassPane => None, - Item::GreenStainedGlassPane => None, - Item::RedStainedGlassPane => None, - Item::BlackStainedGlassPane => None, - Item::Prismarine => None, - Item::PrismarineBricks => None, - Item::DarkPrismarine => None, - Item::PrismarineStairs => None, - Item::PrismarineBrickStairs => None, - Item::DarkPrismarineStairs => None, - Item::SeaLantern => None, - Item::RedSandstone => None, - Item::ChiseledRedSandstone => None, - Item::CutRedSandstone => None, - Item::RedSandstoneStairs => None, - Item::RepeatingCommandBlock => None, - Item::ChainCommandBlock => None, - Item::MagmaBlock => None, - Item::NetherWartBlock => None, - Item::WarpedWartBlock => None, - Item::RedNetherBricks => None, - Item::BoneBlock => None, - Item::StructureVoid => None, - Item::Observer => None, - Item::ShulkerBox => None, - Item::WhiteShulkerBox => None, - Item::OrangeShulkerBox => None, - Item::MagentaShulkerBox => None, - Item::LightBlueShulkerBox => None, - Item::YellowShulkerBox => None, - Item::LimeShulkerBox => None, - Item::PinkShulkerBox => None, - Item::GrayShulkerBox => None, - Item::LightGrayShulkerBox => None, - Item::CyanShulkerBox => None, - Item::PurpleShulkerBox => None, - Item::BlueShulkerBox => None, - Item::BrownShulkerBox => None, - Item::GreenShulkerBox => None, - Item::RedShulkerBox => None, - Item::BlackShulkerBox => None, - Item::WhiteGlazedTerracotta => None, - Item::OrangeGlazedTerracotta => None, - Item::MagentaGlazedTerracotta => None, - Item::LightBlueGlazedTerracotta => None, - Item::YellowGlazedTerracotta => None, - Item::LimeGlazedTerracotta => None, - Item::PinkGlazedTerracotta => None, - Item::GrayGlazedTerracotta => None, - Item::LightGrayGlazedTerracotta => None, - Item::CyanGlazedTerracotta => None, - Item::PurpleGlazedTerracotta => None, - Item::BlueGlazedTerracotta => None, - Item::BrownGlazedTerracotta => None, - Item::GreenGlazedTerracotta => None, - Item::RedGlazedTerracotta => None, - Item::BlackGlazedTerracotta => None, - Item::WhiteConcrete => None, - Item::OrangeConcrete => None, - Item::MagentaConcrete => None, - Item::LightBlueConcrete => None, - Item::YellowConcrete => None, - Item::LimeConcrete => None, - Item::PinkConcrete => None, - Item::GrayConcrete => None, - Item::LightGrayConcrete => None, - Item::CyanConcrete => None, - Item::PurpleConcrete => None, - Item::BlueConcrete => None, - Item::BrownConcrete => None, - Item::GreenConcrete => None, - Item::RedConcrete => None, - Item::BlackConcrete => None, - Item::WhiteConcretePowder => None, - Item::OrangeConcretePowder => None, - Item::MagentaConcretePowder => None, - Item::LightBlueConcretePowder => None, - Item::YellowConcretePowder => None, - Item::LimeConcretePowder => None, - Item::PinkConcretePowder => None, - Item::GrayConcretePowder => None, - Item::LightGrayConcretePowder => None, - Item::CyanConcretePowder => None, - Item::PurpleConcretePowder => None, - Item::BlueConcretePowder => None, - Item::BrownConcretePowder => None, - Item::GreenConcretePowder => None, - Item::RedConcretePowder => None, - Item::BlackConcretePowder => None, - Item::TurtleEgg => None, - Item::DeadTubeCoralBlock => None, - Item::DeadBrainCoralBlock => None, - Item::DeadBubbleCoralBlock => None, - Item::DeadFireCoralBlock => None, - Item::DeadHornCoralBlock => None, - Item::TubeCoralBlock => None, - Item::BrainCoralBlock => None, - Item::BubbleCoralBlock => None, - Item::FireCoralBlock => None, - Item::HornCoralBlock => None, - Item::TubeCoral => None, - Item::BrainCoral => None, - Item::BubbleCoral => None, - Item::FireCoral => None, - Item::HornCoral => None, - Item::DeadBrainCoral => None, - Item::DeadBubbleCoral => None, - Item::DeadFireCoral => None, - Item::DeadHornCoral => None, - Item::DeadTubeCoral => None, - Item::TubeCoralFan => None, - Item::BrainCoralFan => None, - Item::BubbleCoralFan => None, - Item::FireCoralFan => None, - Item::HornCoralFan => None, - Item::DeadTubeCoralFan => None, - Item::DeadBrainCoralFan => None, - Item::DeadBubbleCoralFan => None, - Item::DeadFireCoralFan => None, - Item::DeadHornCoralFan => None, - Item::BlueIce => None, - Item::Conduit => None, - Item::PolishedGraniteStairs => None, - Item::SmoothRedSandstoneStairs => None, - Item::MossyStoneBrickStairs => None, - Item::PolishedDioriteStairs => None, - Item::MossyCobblestoneStairs => None, - Item::EndStoneBrickStairs => None, - Item::StoneStairs => None, - Item::SmoothSandstoneStairs => None, - Item::SmoothQuartzStairs => None, - Item::GraniteStairs => None, - Item::AndesiteStairs => None, - Item::RedNetherBrickStairs => None, - Item::PolishedAndesiteStairs => None, - Item::DioriteStairs => None, - Item::PolishedGraniteSlab => None, - Item::SmoothRedSandstoneSlab => None, - Item::MossyStoneBrickSlab => None, - Item::PolishedDioriteSlab => None, - Item::MossyCobblestoneSlab => None, - Item::EndStoneBrickSlab => None, - Item::SmoothSandstoneSlab => None, - Item::SmoothQuartzSlab => None, - Item::GraniteSlab => None, - Item::AndesiteSlab => None, - Item::RedNetherBrickSlab => None, - Item::PolishedAndesiteSlab => None, - Item::DioriteSlab => None, - Item::Scaffolding => None, - Item::IronDoor => None, - Item::OakDoor => None, - Item::SpruceDoor => None, - Item::BirchDoor => None, - Item::JungleDoor => None, - Item::AcaciaDoor => None, - Item::DarkOakDoor => None, - Item::CrimsonDoor => None, - Item::WarpedDoor => None, - Item::Repeater => None, - Item::Comparator => None, - Item::StructureBlock => None, - Item::Jigsaw => None, - Item::TurtleHelmet => None, - Item::Scute => None, - Item::FlintAndSteel => None, - Item::Apple => None, - Item::Bow => None, - Item::Arrow => None, - Item::Coal => None, - Item::Charcoal => None, - Item::Diamond => None, - Item::IronIngot => 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::Stick => None, - Item::Bowl => None, - Item::MushroomStew => None, - Item::String => None, - Item::Feather => None, - Item::Gunpowder => None, - 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::Flint => None, - Item::Porkchop => None, - Item::CookedPorkchop => None, - Item::Painting => None, - Item::GoldenApple => None, - Item::EnchantedGoldenApple => None, - Item::OakSign => None, - Item::SpruceSign => None, - Item::BirchSign => None, - Item::JungleSign => None, - Item::AcaciaSign => None, - Item::DarkOakSign => None, - Item::CrimsonSign => None, - Item::WarpedSign => None, - Item::Bucket => None, - Item::WaterBucket => None, - Item::LavaBucket => None, - Item::Minecart => None, - Item::Saddle => None, - Item::Redstone => 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::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::Clock => None, - Item::GlowstoneDust => None, - Item::Cod => None, - Item::Salmon => None, - Item::TropicalFish => None, - Item::Pufferfish => None, - Item::CookedCod => None, - Item::CookedSalmon => None, - Item::InkSac => None, - Item::CocoaBeans => None, - Item::LapisLazuli => None, - Item::WhiteDye => None, - Item::OrangeDye => None, - Item::MagentaDye => None, - Item::LightBlueDye => None, - Item::YellowDye => None, - Item::LimeDye => None, - Item::PinkDye => None, - Item::GrayDye => None, - Item::LightGrayDye => None, - Item::CyanDye => None, - Item::PurpleDye => None, - Item::BlueDye => None, - Item::BrownDye => None, - Item::GreenDye => None, - Item::RedDye => None, - Item::BlackDye => None, - Item::BoneMeal => None, - Item::Bone => None, - Item::Sugar => None, - Item::Cake => None, - Item::WhiteBed => None, - Item::OrangeBed => None, - Item::MagentaBed => None, - Item::LightBlueBed => None, - Item::YellowBed => None, - Item::LimeBed => None, - Item::PinkBed => None, - Item::GrayBed => None, - Item::LightGrayBed => None, - Item::CyanBed => None, - Item::PurpleBed => None, - Item::BlueBed => None, - Item::BrownBed => None, - Item::GreenBed => None, - Item::RedBed => None, - Item::BlackBed => None, - Item::Cookie => None, - Item::FilledMap => None, - Item::Shears => None, - Item::MelonSlice => None, - Item::DriedKelp => None, - Item::PumpkinSeeds => None, - Item::MelonSeeds => None, - Item::Beef => None, - Item::CookedBeef => None, - Item::Chicken => None, - Item::CookedChicken => None, - Item::RottenFlesh => None, - Item::EnderPearl => None, - Item::BlazeRod => None, - Item::GhastTear => None, - Item::GoldNugget => None, - Item::NetherWart => None, - Item::Potion => None, - Item::GlassBottle => None, - Item::SpiderEye => None, - Item::FermentedSpiderEye => None, - Item::BlazePowder => None, - Item::MagmaCream => None, - Item::BrewingStand => None, - Item::Cauldron => None, - Item::EnderEye => None, - Item::GlisteringMelonSlice => None, - Item::BatSpawnEgg => None, - Item::BeeSpawnEgg => None, - Item::BlazeSpawnEgg => None, - Item::CatSpawnEgg => None, - Item::CaveSpiderSpawnEgg => None, - Item::ChickenSpawnEgg => None, - Item::CodSpawnEgg => None, - Item::CowSpawnEgg => None, - Item::CreeperSpawnEgg => None, - Item::DolphinSpawnEgg => None, - Item::DonkeySpawnEgg => None, - Item::DrownedSpawnEgg => None, - Item::ElderGuardianSpawnEgg => None, - Item::EndermanSpawnEgg => None, - Item::EndermiteSpawnEgg => None, - Item::EvokerSpawnEgg => None, - Item::FoxSpawnEgg => None, - Item::GhastSpawnEgg => None, - Item::GuardianSpawnEgg => None, - Item::HoglinSpawnEgg => None, - Item::HorseSpawnEgg => None, - Item::HuskSpawnEgg => None, - Item::LlamaSpawnEgg => None, - Item::MagmaCubeSpawnEgg => None, - Item::MooshroomSpawnEgg => None, - Item::MuleSpawnEgg => None, - Item::OcelotSpawnEgg => None, - Item::PandaSpawnEgg => None, - Item::ParrotSpawnEgg => None, - Item::PhantomSpawnEgg => None, - Item::PigSpawnEgg => None, - Item::PiglinSpawnEgg => None, - Item::PiglinBruteSpawnEgg => None, - Item::PillagerSpawnEgg => None, - Item::PolarBearSpawnEgg => None, - Item::PufferfishSpawnEgg => None, - Item::RabbitSpawnEgg => None, - Item::RavagerSpawnEgg => None, - Item::SalmonSpawnEgg => None, - Item::SheepSpawnEgg => None, - Item::ShulkerSpawnEgg => None, - Item::SilverfishSpawnEgg => None, - Item::SkeletonSpawnEgg => None, - Item::SkeletonHorseSpawnEgg => None, - Item::SlimeSpawnEgg => None, - Item::SpiderSpawnEgg => None, - Item::SquidSpawnEgg => None, - Item::StraySpawnEgg => None, - Item::StriderSpawnEgg => None, - Item::TraderLlamaSpawnEgg => None, - Item::TropicalFishSpawnEgg => None, - Item::TurtleSpawnEgg => None, - Item::VexSpawnEgg => None, - Item::VillagerSpawnEgg => None, - Item::VindicatorSpawnEgg => None, - Item::WanderingTraderSpawnEgg => None, - Item::WitchSpawnEgg => None, - Item::WitherSkeletonSpawnEgg => None, - Item::WolfSpawnEgg => None, - Item::ZoglinSpawnEgg => None, - Item::ZombieSpawnEgg => None, - Item::ZombieHorseSpawnEgg => None, - Item::ZombieVillagerSpawnEgg => None, - Item::ZombifiedPiglinSpawnEgg => None, - Item::ExperienceBottle => None, - Item::FireCharge => None, - Item::WritableBook => None, - Item::WrittenBook => None, - Item::Emerald => None, - Item::ItemFrame => None, - Item::FlowerPot => None, - Item::Carrot => None, - Item::Potato => None, - Item::BakedPotato => None, - Item::PoisonousPotato => None, - Item::Map => None, - Item::GoldenCarrot => None, - Item::SkeletonSkull => None, - Item::WitherSkeletonSkull => None, - Item::PlayerHead => None, - 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, - Item::CookedRabbit => None, - Item::RabbitStew => None, - Item::RabbitFoot => None, - Item::RabbitHide => None, - Item::ArmorStand => None, - Item::IronHorseArmor => None, - Item::GoldenHorseArmor => None, - Item::DiamondHorseArmor => None, - Item::LeatherHorseArmor => None, - Item::Lead => None, - Item::NameTag => None, - Item::CommandBlockMinecart => None, - Item::Mutton => None, - Item::CookedMutton => None, - Item::WhiteBanner => None, - Item::OrangeBanner => None, - Item::MagentaBanner => None, - Item::LightBlueBanner => None, - Item::YellowBanner => None, - Item::LimeBanner => None, - Item::PinkBanner => None, - Item::GrayBanner => None, - Item::LightGrayBanner => None, - Item::CyanBanner => None, - Item::PurpleBanner => None, - Item::BlueBanner => None, - Item::BrownBanner => None, - Item::GreenBanner => None, - Item::RedBanner => None, - Item::BlackBanner => None, - Item::EndCrystal => None, - Item::ChorusFruit => None, - Item::PoppedChorusFruit => None, - Item::Beetroot => None, - Item::BeetrootSeeds => None, - Item::BeetrootSoup => None, - Item::DragonBreath => None, - Item::SplashPotion => None, - 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::TotemOfUndying => None, - Item::ShulkerShell => None, - Item::IronNugget => None, - Item::KnowledgeBook => None, - Item::DebugStick => None, - Item::MusicDisc13 => None, - Item::MusicDiscCat => None, - Item::MusicDiscBlocks => None, - Item::MusicDiscChirp => None, - Item::MusicDiscFar => None, - Item::MusicDiscMall => None, - Item::MusicDiscMellohi => None, - Item::MusicDiscStal => None, - Item::MusicDiscStrad => None, - Item::MusicDiscWard => None, - Item::MusicDisc11 => None, - Item::MusicDiscWait => None, - Item::MusicDiscPigstep => None, - Item::Trident => None, - Item::PhantomMembrane => None, - Item::NautilusShell => None, - Item::HeartOfTheSea => None, - Item::Crossbow => None, - Item::SuspiciousStew => None, - Item::Loom => None, - Item::FlowerBannerPattern => None, - Item::CreeperBannerPattern => None, - Item::SkullBannerPattern => None, - Item::MojangBannerPattern => None, - Item::GlobeBannerPattern => None, - Item::PiglinBannerPattern => None, - Item::Composter => None, - Item::Barrel => None, - Item::Smoker => None, - Item::BlastFurnace => None, - 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::Campfire => None, - Item::SoulCampfire => None, - Item::Shroomlight => None, - Item::Honeycomb => None, - 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, - Item::BlackstoneStairs => None, - Item::GildedBlackstone => None, - Item::PolishedBlackstone => None, - Item::PolishedBlackstoneSlab => None, - Item::PolishedBlackstoneStairs => None, - Item::ChiseledPolishedBlackstone => None, - Item::PolishedBlackstoneBricks => None, - Item::PolishedBlackstoneBrickSlab => None, - Item::PolishedBlackstoneBrickStairs => None, - Item::CrackedPolishedBlackstoneBricks => None, - Item::RespawnAnchor => None, - } - } -} diff --git a/feather/generated/src/lib.rs b/feather/generated/src/lib.rs deleted file mode 100644 index ba9575b0a..000000000 --- a/feather/generated/src/lib.rs +++ /dev/null @@ -1,240 +0,0 @@ -use parking_lot::{Mutex, MutexGuard}; -use std::sync::Arc; - -#[allow(clippy::all)] -mod biome; -#[allow(clippy::all)] -mod block; -#[allow(clippy::all)] -mod entity; -#[allow(clippy::all)] -mod inventory; -#[allow(clippy::all)] -mod item; -#[allow(clippy::all)] -mod particle; -#[allow(clippy::all)] -mod simplified_block; - -pub use biome::Biome; -pub use block::BlockKind; -pub use entity::EntityKind; -pub use inventory::{Area, InventoryBacking, Window}; -pub use item::Item; -pub use particle::Particle; -pub use simplified_block::SimplifiedBlockKind; - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct ItemStack { - pub item: Item, - pub count: u32, - - /// Damage to the item, if it's damageable. - pub damage: Option, -} - -impl ItemStack { - /// Creates a new `ItemStack`. - pub fn new(item: Item, count: u32) -> Self { - Self { - item, - count, - damage: item.durability().map(|_| 0), - } - } - - /// Returns whether the given item stack has - /// the same type as (but not necessarily the same - /// amount as) `self`. - pub fn has_same_type(&self, other: &ItemStack) -> bool { - other.item == self.item && other.damage == self.damage - } - - /// Returns the item type for this `ItemStack`. - pub fn item(&self) -> Item { - self.item - } - - /// Returns the number of items in this `ItemStack`. - pub fn count(&self) -> u32 { - self.count - } - - /// Adds more items to this ItemStack. Returns the new count. - pub fn add(&mut self, count: u32) -> u32 { - self.count += count; - self.count - } - - /// Removes some items from this ItemStack. Returns whether there - /// were enough items to be removed. - pub fn remove(&mut self, count: u32) -> bool { - self.count = match self.count.checked_sub(count) { - Some(count) => count, - None => return false, - }; - true - } - - /// Sets the item for this `ItemStack`. - pub fn set_item(&mut self, item: Item) { - self.item = item; - } - - /// Sets the count for this `ItemStack`. - pub fn set_count(&mut self, count: u32) { - self.count = count; - } - - /// Splits this `ItemStack` in half, returning the - /// second item stack. If the amount is odd, `self` - /// will be left with the least items. - pub fn take_half(&mut self) -> ItemStack { - let count_left = self.count / 2; - let other_half = ItemStack { - count: self.count - count_left, - ..self.clone() - }; - self.count = count_left; - other_half - } - - /// Splits this `ItemStack`. - pub fn take(&mut self, amount: u32) -> ItemStack { - let count_left = self.count.saturating_sub(amount); - let count_lost = self.count - count_left; - self.count = count_left; - ItemStack { - count: count_lost, - ..self.clone() - } - } - - /// Merges another `ItemStack` with this one. - pub fn merge_with(&mut self, other: &mut ItemStack) { - if !self.has_same_type(other) { - return; - } - let new_count = (self.count + other.count).min(self.item.stack_size()); - let amount_added = new_count - self.count; - self.count = new_count; - other.count -= amount_added; - } - - /// Transfers up to `n` items to `other`. - pub fn transfer_to(&mut self, n: u32, other: &mut ItemStack) { - let max_transfer = other.item.stack_size().saturating_sub(other.count); - let transfer = max_transfer.min(self.count).min(n); - self.count -= transfer; - other.count += transfer; - } - - /// Damages the item by the specified amount. - /// If this returns `true`, then the item is broken. - pub fn damage(&mut self, amount: u32) -> bool { - match &mut self.damage { - Some(damage) => { - *damage += amount; - if let Some(durability) = self.item.durability() { - *damage >= durability - } else { - false - } - } - None => false, - } - } -} - -type Slot = Mutex>; - -/// A handle to an inventory. -/// -/// An inventory is composed of one or more _areas_, each -/// if which contains one or more item stacks stored in an array. Areas are defined -/// 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 -/// it is cheap and creates a new handle to the same inventory. Interior mutability -/// is used to make this safe. -#[derive(Debug, Clone)] -pub struct Inventory { - backing: Arc>, -} - -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) - } - - /// 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) - } - - /// Gets all the items in this inventory. - pub fn to_vec(&self) -> Vec> { - let mut vec = Vec::new(); - for area in self.backing.areas() { - for item in self.backing.area_slice(*area).unwrap() { - vec.push(item.lock().clone()); - } - } - vec - } - - /// Creates a new handle to the same inventory. - /// - /// This operation is the same as calling `clone()`, but it's more explicit - /// in its intent. - pub fn new_handle(&self) -> Inventory { - self.clone() - } -} - -#[derive(Debug, thiserror::Error)] -pub enum WindowError { - #[error("slot index {0} is out of bounds")] - OutOfBounds(usize), -} - -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> { - let (inventory, area, slot) = self - .index_to_slot(index) - .ok_or(WindowError::OutOfBounds(index))?; - inventory - .item(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: Option) -> Result<(), WindowError> { - *self.item(index)? = item; - Ok(()) - } - - /// Gets a vector of all items in this window. - pub fn to_vec(&self) -> Vec> { - let mut i = 0; - let mut vec = Vec::new(); - while let Ok(item) = self.item(i) { - vec.push(item.clone()); - i += 1; - } - vec - } -} diff --git a/feather/generated/src/particle.rs b/feather/generated/src/particle.rs deleted file mode 100644 index 79fefb8db..000000000 --- a/feather/generated/src/particle.rs +++ /dev/null @@ -1,398 +0,0 @@ -// This file is @generated. Please do not edit. - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum Particle { - AmbientEntityEffect, - AngryVillager, - Barrier, - Block, - Bubble, - Cloud, - Crit, - DamageIndicator, - DragonBreath, - DrippingLava, - FallingLava, - LandingLava, - DrippingWater, - FallingWater, - Dust, - Effect, - ElderGuardian, - EnchantedHit, - Enchant, - EndRod, - EntityEffect, - ExplosionEmitter, - Explosion, - FallingDust, - Firework, - Fishing, - Flame, - SoulFireFlame, - Soul, - Flash, - HappyVillager, - Composter, - Heart, - InstantEffect, - Item, - ItemSlime, - ItemSnowball, - LargeSmoke, - Lava, - Mycelium, - Note, - Poof, - Portal, - Rain, - Smoke, - Sneeze, - Spit, - SquidInk, - SweepAttack, - TotemOfUndying, - Underwater, - Splash, - Witch, - BubblePop, - CurrentDown, - BubbleColumnUp, - Nautilus, - Dolphin, - CampfireCosySmoke, - CampfireSignalSmoke, - DrippingHoney, - FallingHoney, - LandingHoney, - FallingNectar, - Ash, - CrimsonSpore, - WarpedSpore, - DrippingObsidianTear, - FallingObsidianTear, - LandingObsidianTear, - ReversePortal, - WhiteAsh, -} - -#[allow(warnings)] -#[allow(clippy::all)] -impl Particle { - /// Returns the `id` property of this `Particle`. - pub fn id(&self) -> u32 { - match self { - Particle::AmbientEntityEffect => 0, - Particle::AngryVillager => 1, - Particle::Barrier => 2, - Particle::Block => 3, - Particle::Bubble => 4, - Particle::Cloud => 5, - Particle::Crit => 6, - Particle::DamageIndicator => 7, - Particle::DragonBreath => 8, - Particle::DrippingLava => 9, - Particle::FallingLava => 10, - Particle::LandingLava => 11, - Particle::DrippingWater => 12, - Particle::FallingWater => 13, - Particle::Dust => 14, - Particle::Effect => 15, - Particle::ElderGuardian => 16, - Particle::EnchantedHit => 17, - Particle::Enchant => 18, - Particle::EndRod => 19, - Particle::EntityEffect => 20, - Particle::ExplosionEmitter => 21, - Particle::Explosion => 22, - Particle::FallingDust => 23, - Particle::Firework => 24, - Particle::Fishing => 25, - Particle::Flame => 26, - Particle::SoulFireFlame => 27, - Particle::Soul => 28, - Particle::Flash => 29, - Particle::HappyVillager => 30, - Particle::Composter => 31, - Particle::Heart => 32, - Particle::InstantEffect => 33, - Particle::Item => 34, - Particle::ItemSlime => 35, - Particle::ItemSnowball => 36, - Particle::LargeSmoke => 37, - Particle::Lava => 38, - Particle::Mycelium => 39, - Particle::Note => 40, - Particle::Poof => 41, - Particle::Portal => 42, - Particle::Rain => 43, - Particle::Smoke => 44, - Particle::Sneeze => 45, - Particle::Spit => 46, - Particle::SquidInk => 47, - Particle::SweepAttack => 48, - Particle::TotemOfUndying => 49, - Particle::Underwater => 50, - Particle::Splash => 51, - Particle::Witch => 52, - Particle::BubblePop => 53, - Particle::CurrentDown => 54, - Particle::BubbleColumnUp => 55, - Particle::Nautilus => 56, - Particle::Dolphin => 57, - Particle::CampfireCosySmoke => 58, - Particle::CampfireSignalSmoke => 59, - Particle::DrippingHoney => 60, - Particle::FallingHoney => 61, - Particle::LandingHoney => 62, - Particle::FallingNectar => 63, - Particle::Ash => 64, - Particle::CrimsonSpore => 65, - Particle::WarpedSpore => 66, - Particle::DrippingObsidianTear => 67, - Particle::FallingObsidianTear => 68, - Particle::LandingObsidianTear => 69, - Particle::ReversePortal => 70, - Particle::WhiteAsh => 71, - } - } - - /// Gets a `Particle` by its `id`. - pub fn from_id(id: u32) -> Option { - match id { - 0 => Some(Particle::AmbientEntityEffect), - 1 => Some(Particle::AngryVillager), - 2 => Some(Particle::Barrier), - 3 => Some(Particle::Block), - 4 => Some(Particle::Bubble), - 5 => Some(Particle::Cloud), - 6 => Some(Particle::Crit), - 7 => Some(Particle::DamageIndicator), - 8 => Some(Particle::DragonBreath), - 9 => Some(Particle::DrippingLava), - 10 => Some(Particle::FallingLava), - 11 => Some(Particle::LandingLava), - 12 => Some(Particle::DrippingWater), - 13 => Some(Particle::FallingWater), - 14 => Some(Particle::Dust), - 15 => Some(Particle::Effect), - 16 => Some(Particle::ElderGuardian), - 17 => Some(Particle::EnchantedHit), - 18 => Some(Particle::Enchant), - 19 => Some(Particle::EndRod), - 20 => Some(Particle::EntityEffect), - 21 => Some(Particle::ExplosionEmitter), - 22 => Some(Particle::Explosion), - 23 => Some(Particle::FallingDust), - 24 => Some(Particle::Firework), - 25 => Some(Particle::Fishing), - 26 => Some(Particle::Flame), - 27 => Some(Particle::SoulFireFlame), - 28 => Some(Particle::Soul), - 29 => Some(Particle::Flash), - 30 => Some(Particle::HappyVillager), - 31 => Some(Particle::Composter), - 32 => Some(Particle::Heart), - 33 => Some(Particle::InstantEffect), - 34 => Some(Particle::Item), - 35 => Some(Particle::ItemSlime), - 36 => Some(Particle::ItemSnowball), - 37 => Some(Particle::LargeSmoke), - 38 => Some(Particle::Lava), - 39 => Some(Particle::Mycelium), - 40 => Some(Particle::Note), - 41 => Some(Particle::Poof), - 42 => Some(Particle::Portal), - 43 => Some(Particle::Rain), - 44 => Some(Particle::Smoke), - 45 => Some(Particle::Sneeze), - 46 => Some(Particle::Spit), - 47 => Some(Particle::SquidInk), - 48 => Some(Particle::SweepAttack), - 49 => Some(Particle::TotemOfUndying), - 50 => Some(Particle::Underwater), - 51 => Some(Particle::Splash), - 52 => Some(Particle::Witch), - 53 => Some(Particle::BubblePop), - 54 => Some(Particle::CurrentDown), - 55 => Some(Particle::BubbleColumnUp), - 56 => Some(Particle::Nautilus), - 57 => Some(Particle::Dolphin), - 58 => Some(Particle::CampfireCosySmoke), - 59 => Some(Particle::CampfireSignalSmoke), - 60 => Some(Particle::DrippingHoney), - 61 => Some(Particle::FallingHoney), - 62 => Some(Particle::LandingHoney), - 63 => Some(Particle::FallingNectar), - 64 => Some(Particle::Ash), - 65 => Some(Particle::CrimsonSpore), - 66 => Some(Particle::WarpedSpore), - 67 => Some(Particle::DrippingObsidianTear), - 68 => Some(Particle::FallingObsidianTear), - 69 => Some(Particle::LandingObsidianTear), - 70 => Some(Particle::ReversePortal), - 71 => Some(Particle::WhiteAsh), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Particle { - /// Returns the `name` property of this `Particle`. - pub fn name(&self) -> &'static str { - match self { - Particle::AmbientEntityEffect => "ambient_entity_effect", - Particle::AngryVillager => "angry_villager", - Particle::Barrier => "barrier", - Particle::Block => "block", - Particle::Bubble => "bubble", - Particle::Cloud => "cloud", - Particle::Crit => "crit", - Particle::DamageIndicator => "damage_indicator", - Particle::DragonBreath => "dragon_breath", - Particle::DrippingLava => "dripping_lava", - Particle::FallingLava => "falling_lava", - Particle::LandingLava => "landing_lava", - Particle::DrippingWater => "dripping_water", - Particle::FallingWater => "falling_water", - Particle::Dust => "dust", - Particle::Effect => "effect", - Particle::ElderGuardian => "elder_guardian", - Particle::EnchantedHit => "enchanted_hit", - Particle::Enchant => "enchant", - Particle::EndRod => "end_rod", - Particle::EntityEffect => "entity_effect", - Particle::ExplosionEmitter => "explosion_emitter", - Particle::Explosion => "explosion", - Particle::FallingDust => "falling_dust", - Particle::Firework => "firework", - Particle::Fishing => "fishing", - Particle::Flame => "flame", - Particle::SoulFireFlame => "soul_fire_flame", - Particle::Soul => "soul", - Particle::Flash => "flash", - Particle::HappyVillager => "happy_villager", - Particle::Composter => "composter", - Particle::Heart => "heart", - Particle::InstantEffect => "instant_effect", - Particle::Item => "item", - Particle::ItemSlime => "item_slime", - Particle::ItemSnowball => "item_snowball", - Particle::LargeSmoke => "large_smoke", - Particle::Lava => "lava", - Particle::Mycelium => "mycelium", - Particle::Note => "note", - Particle::Poof => "poof", - Particle::Portal => "portal", - Particle::Rain => "rain", - Particle::Smoke => "smoke", - Particle::Sneeze => "sneeze", - Particle::Spit => "spit", - Particle::SquidInk => "squid_ink", - Particle::SweepAttack => "sweep_attack", - Particle::TotemOfUndying => "totem_of_undying", - Particle::Underwater => "underwater", - Particle::Splash => "splash", - Particle::Witch => "witch", - Particle::BubblePop => "bubble_pop", - Particle::CurrentDown => "current_down", - Particle::BubbleColumnUp => "bubble_column_up", - Particle::Nautilus => "nautilus", - Particle::Dolphin => "dolphin", - Particle::CampfireCosySmoke => "campfire_cosy_smoke", - Particle::CampfireSignalSmoke => "campfire_signal_smoke", - Particle::DrippingHoney => "dripping_honey", - Particle::FallingHoney => "falling_honey", - Particle::LandingHoney => "landing_honey", - Particle::FallingNectar => "falling_nectar", - Particle::Ash => "ash", - Particle::CrimsonSpore => "crimson_spore", - Particle::WarpedSpore => "warped_spore", - Particle::DrippingObsidianTear => "dripping_obsidian_tear", - Particle::FallingObsidianTear => "falling_obsidian_tear", - Particle::LandingObsidianTear => "landing_obsidian_tear", - Particle::ReversePortal => "reverse_portal", - Particle::WhiteAsh => "white_ash", - } - } - - /// Gets a `Particle` by its `name`. - pub fn from_name(name: &str) -> Option { - match name { - "ambient_entity_effect" => Some(Particle::AmbientEntityEffect), - "angry_villager" => Some(Particle::AngryVillager), - "barrier" => Some(Particle::Barrier), - "block" => Some(Particle::Block), - "bubble" => Some(Particle::Bubble), - "cloud" => Some(Particle::Cloud), - "crit" => Some(Particle::Crit), - "damage_indicator" => Some(Particle::DamageIndicator), - "dragon_breath" => Some(Particle::DragonBreath), - "dripping_lava" => Some(Particle::DrippingLava), - "falling_lava" => Some(Particle::FallingLava), - "landing_lava" => Some(Particle::LandingLava), - "dripping_water" => Some(Particle::DrippingWater), - "falling_water" => Some(Particle::FallingWater), - "dust" => Some(Particle::Dust), - "effect" => Some(Particle::Effect), - "elder_guardian" => Some(Particle::ElderGuardian), - "enchanted_hit" => Some(Particle::EnchantedHit), - "enchant" => Some(Particle::Enchant), - "end_rod" => Some(Particle::EndRod), - "entity_effect" => Some(Particle::EntityEffect), - "explosion_emitter" => Some(Particle::ExplosionEmitter), - "explosion" => Some(Particle::Explosion), - "falling_dust" => Some(Particle::FallingDust), - "firework" => Some(Particle::Firework), - "fishing" => Some(Particle::Fishing), - "flame" => Some(Particle::Flame), - "soul_fire_flame" => Some(Particle::SoulFireFlame), - "soul" => Some(Particle::Soul), - "flash" => Some(Particle::Flash), - "happy_villager" => Some(Particle::HappyVillager), - "composter" => Some(Particle::Composter), - "heart" => Some(Particle::Heart), - "instant_effect" => Some(Particle::InstantEffect), - "item" => Some(Particle::Item), - "item_slime" => Some(Particle::ItemSlime), - "item_snowball" => Some(Particle::ItemSnowball), - "large_smoke" => Some(Particle::LargeSmoke), - "lava" => Some(Particle::Lava), - "mycelium" => Some(Particle::Mycelium), - "note" => Some(Particle::Note), - "poof" => Some(Particle::Poof), - "portal" => Some(Particle::Portal), - "rain" => Some(Particle::Rain), - "smoke" => Some(Particle::Smoke), - "sneeze" => Some(Particle::Sneeze), - "spit" => Some(Particle::Spit), - "squid_ink" => Some(Particle::SquidInk), - "sweep_attack" => Some(Particle::SweepAttack), - "totem_of_undying" => Some(Particle::TotemOfUndying), - "underwater" => Some(Particle::Underwater), - "splash" => Some(Particle::Splash), - "witch" => Some(Particle::Witch), - "bubble_pop" => Some(Particle::BubblePop), - "current_down" => Some(Particle::CurrentDown), - "bubble_column_up" => Some(Particle::BubbleColumnUp), - "nautilus" => Some(Particle::Nautilus), - "dolphin" => Some(Particle::Dolphin), - "campfire_cosy_smoke" => Some(Particle::CampfireCosySmoke), - "campfire_signal_smoke" => Some(Particle::CampfireSignalSmoke), - "dripping_honey" => Some(Particle::DrippingHoney), - "falling_honey" => Some(Particle::FallingHoney), - "landing_honey" => Some(Particle::LandingHoney), - "falling_nectar" => Some(Particle::FallingNectar), - "ash" => Some(Particle::Ash), - "crimson_spore" => Some(Particle::CrimsonSpore), - "warped_spore" => Some(Particle::WarpedSpore), - "dripping_obsidian_tear" => Some(Particle::DrippingObsidianTear), - "falling_obsidian_tear" => Some(Particle::FallingObsidianTear), - "landing_obsidian_tear" => Some(Particle::LandingObsidianTear), - "reverse_portal" => Some(Particle::ReversePortal), - "white_ash" => Some(Particle::WhiteAsh), - _ => None, - } - } -} diff --git a/feather/generated/src/simplified_block.rs b/feather/generated/src/simplified_block.rs deleted file mode 100644 index 2ad8b9c8d..000000000 --- a/feather/generated/src/simplified_block.rs +++ /dev/null @@ -1,1146 +0,0 @@ -// This file is @generated. Please do not edit. -use crate::BlockKind; -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum SimplifiedBlockKind { - Air, - Planks, - Sapling, - Log, - Leaves, - Bed, - Wool, - Flower, - WoodenPressurePlate, - StainedGlass, - WoodenTrapdoor, - WoodenButton, - Anvil, - GlazedTeracotta, - Teracotta, - StainedGlassPane, - Carpet, - WallBanner, - Banner, - Slab, - Stairs, - FenceGate, - Fence, - WoodenDoor, - ShulkerBox, - Concrete, - ConcretePowder, - Coral, - CoralBlock, - CoralFan, - CoralWallFan, - Mushroom, - WallSign, - Sign, - Stone, - Granite, - PolishedGranite, - Diorite, - PolishedDiorite, - Andesite, - PolishedAndesite, - GrassBlock, - Dirt, - CoarseDirt, - Podzol, - Cobblestone, - Bedrock, - Water, - Lava, - Sand, - RedSand, - Gravel, - GoldOre, - IronOre, - CoalOre, - NetherGoldOre, - Sponge, - WetSponge, - Glass, - LapisOre, - LapisBlock, - Dispenser, - Sandstone, - ChiseledSandstone, - CutSandstone, - NoteBlock, - PoweredRail, - DetectorRail, - StickyPiston, - Cobweb, - Grass, - 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, - 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, - Glowstone, - NetherPortal, - CarvedPumpkin, - JackOLantern, - Cake, - Repeater, - StoneBricks, - MossyStoneBricks, - CrackedStoneBricks, - ChiseledStoneBricks, - InfestedStone, - InfestedCobblestone, - InfestedStoneBricks, - InfestedMossyStoneBricks, - InfestedCrackedStoneBricks, - InfestedChiseledStoneBricks, - BrownMushroomBlock, - RedMushroomBlock, - MushroomStem, - IronBars, - Chain, - GlassPane, - Melon, - AttachedPumpkinStem, - AttachedMelonStem, - PumpkinStem, - MelonStem, - Vine, - Mycelium, - LilyPad, - NetherBricks, - NetherWart, - EnchantingTable, - BrewingStand, - Cauldron, - EndPortal, - EndPortalFrame, - EndStone, - DragonEgg, - RedstoneLamp, - Cocoa, - EmeraldOre, - EnderChest, - TripwireHook, - Tripwire, - EmeraldBlock, - CommandBlock, - Beacon, - CobblestoneWall, - MossyCobblestoneWall, - FlowerPot, - PottedFern, - PottedDandelion, - PottedPoppy, - PottedAllium, - PottedCornflower, - PottedLilyOfTheValley, - 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, - Prismarine, - PrismarineBricks, - DarkPrismarine, - SeaLantern, - HayBlock, - CoalBlock, - PackedIce, - Sunflower, - Lilac, - RoseBush, - Peony, - TallGrass, - LargeFern, - RedSandstone, - ChiseledRedSandstone, - CutRedSandstone, - SmoothStone, - SmoothSandstone, - SmoothQuartz, - SmoothRedSandstone, - EndRod, - ChorusPlant, - ChorusFlower, - PurpurBlock, - PurpurPillar, - EndStoneBricks, - Beetroots, - GrassPath, - EndGateway, - RepeatingCommandBlock, - ChainCommandBlock, - FrostedIce, - MagmaBlock, - NetherWartBlock, - RedNetherBricks, - BoneBlock, - StructureVoid, - Observer, - Kelp, - KelpPlant, - DriedKelpBlock, - TurtleEgg, - SeaPickle, - BlueIce, - Conduit, - Bamboo, - PottedBamboo, - BubbleColumn, - 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, - 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, -} - -#[allow(warnings)] -#[allow(clippy::all)] -impl BlockKind { - /// Returns the `simplified_kind` property of this `BlockKind`. - pub fn simplified_kind(&self) -> SimplifiedBlockKind { - match self { - BlockKind::Air => SimplifiedBlockKind::Air, - BlockKind::Stone => SimplifiedBlockKind::Stone, - BlockKind::Granite => SimplifiedBlockKind::Granite, - BlockKind::PolishedGranite => SimplifiedBlockKind::PolishedGranite, - BlockKind::Diorite => SimplifiedBlockKind::Diorite, - BlockKind::PolishedDiorite => SimplifiedBlockKind::PolishedDiorite, - BlockKind::Andesite => SimplifiedBlockKind::Andesite, - BlockKind::PolishedAndesite => SimplifiedBlockKind::PolishedAndesite, - BlockKind::GrassBlock => SimplifiedBlockKind::GrassBlock, - BlockKind::Dirt => SimplifiedBlockKind::Dirt, - BlockKind::CoarseDirt => SimplifiedBlockKind::CoarseDirt, - BlockKind::Podzol => SimplifiedBlockKind::Podzol, - BlockKind::Cobblestone => SimplifiedBlockKind::Cobblestone, - BlockKind::OakPlanks => SimplifiedBlockKind::Planks, - BlockKind::SprucePlanks => SimplifiedBlockKind::Planks, - BlockKind::BirchPlanks => SimplifiedBlockKind::Planks, - BlockKind::JunglePlanks => SimplifiedBlockKind::Planks, - BlockKind::AcaciaPlanks => SimplifiedBlockKind::Planks, - BlockKind::DarkOakPlanks => SimplifiedBlockKind::Planks, - BlockKind::OakSapling => SimplifiedBlockKind::Sapling, - BlockKind::SpruceSapling => SimplifiedBlockKind::Sapling, - BlockKind::BirchSapling => SimplifiedBlockKind::Sapling, - BlockKind::JungleSapling => SimplifiedBlockKind::Sapling, - BlockKind::AcaciaSapling => SimplifiedBlockKind::Sapling, - BlockKind::DarkOakSapling => SimplifiedBlockKind::Sapling, - BlockKind::Bedrock => SimplifiedBlockKind::Bedrock, - BlockKind::Water => SimplifiedBlockKind::Water, - BlockKind::Lava => SimplifiedBlockKind::Lava, - BlockKind::Sand => SimplifiedBlockKind::Sand, - BlockKind::RedSand => SimplifiedBlockKind::RedSand, - BlockKind::Gravel => SimplifiedBlockKind::Gravel, - BlockKind::GoldOre => SimplifiedBlockKind::GoldOre, - BlockKind::IronOre => SimplifiedBlockKind::IronOre, - BlockKind::CoalOre => SimplifiedBlockKind::CoalOre, - BlockKind::NetherGoldOre => SimplifiedBlockKind::NetherGoldOre, - BlockKind::OakLog => SimplifiedBlockKind::Log, - BlockKind::SpruceLog => SimplifiedBlockKind::Log, - BlockKind::BirchLog => SimplifiedBlockKind::Log, - BlockKind::JungleLog => SimplifiedBlockKind::Log, - BlockKind::AcaciaLog => SimplifiedBlockKind::Log, - BlockKind::DarkOakLog => SimplifiedBlockKind::Log, - BlockKind::StrippedSpruceLog => SimplifiedBlockKind::Log, - BlockKind::StrippedBirchLog => SimplifiedBlockKind::Log, - BlockKind::StrippedJungleLog => SimplifiedBlockKind::Log, - BlockKind::StrippedAcaciaLog => SimplifiedBlockKind::Log, - BlockKind::StrippedDarkOakLog => SimplifiedBlockKind::Log, - BlockKind::StrippedOakLog => SimplifiedBlockKind::Log, - BlockKind::OakWood => SimplifiedBlockKind::Log, - BlockKind::SpruceWood => SimplifiedBlockKind::Log, - BlockKind::BirchWood => SimplifiedBlockKind::Log, - BlockKind::JungleWood => SimplifiedBlockKind::Log, - BlockKind::AcaciaWood => SimplifiedBlockKind::Log, - BlockKind::DarkOakWood => SimplifiedBlockKind::Log, - BlockKind::StrippedOakWood => SimplifiedBlockKind::Log, - BlockKind::StrippedSpruceWood => SimplifiedBlockKind::Log, - BlockKind::StrippedBirchWood => SimplifiedBlockKind::Log, - BlockKind::StrippedJungleWood => SimplifiedBlockKind::Log, - BlockKind::StrippedAcaciaWood => SimplifiedBlockKind::Log, - BlockKind::StrippedDarkOakWood => SimplifiedBlockKind::Log, - BlockKind::OakLeaves => SimplifiedBlockKind::Leaves, - BlockKind::SpruceLeaves => SimplifiedBlockKind::Leaves, - BlockKind::BirchLeaves => SimplifiedBlockKind::Leaves, - BlockKind::JungleLeaves => SimplifiedBlockKind::Leaves, - BlockKind::AcaciaLeaves => SimplifiedBlockKind::Leaves, - BlockKind::DarkOakLeaves => SimplifiedBlockKind::Leaves, - BlockKind::Sponge => SimplifiedBlockKind::Sponge, - BlockKind::WetSponge => SimplifiedBlockKind::WetSponge, - BlockKind::Glass => SimplifiedBlockKind::Glass, - BlockKind::LapisOre => SimplifiedBlockKind::LapisOre, - BlockKind::LapisBlock => SimplifiedBlockKind::LapisBlock, - BlockKind::Dispenser => SimplifiedBlockKind::Dispenser, - BlockKind::Sandstone => SimplifiedBlockKind::Sandstone, - BlockKind::ChiseledSandstone => SimplifiedBlockKind::ChiseledSandstone, - BlockKind::CutSandstone => SimplifiedBlockKind::CutSandstone, - BlockKind::NoteBlock => SimplifiedBlockKind::NoteBlock, - BlockKind::WhiteBed => SimplifiedBlockKind::Bed, - BlockKind::OrangeBed => SimplifiedBlockKind::Bed, - BlockKind::MagentaBed => SimplifiedBlockKind::Bed, - BlockKind::LightBlueBed => SimplifiedBlockKind::Bed, - BlockKind::YellowBed => SimplifiedBlockKind::Bed, - BlockKind::LimeBed => SimplifiedBlockKind::Bed, - BlockKind::PinkBed => SimplifiedBlockKind::Bed, - BlockKind::GrayBed => SimplifiedBlockKind::Bed, - BlockKind::LightGrayBed => SimplifiedBlockKind::Bed, - BlockKind::CyanBed => SimplifiedBlockKind::Bed, - BlockKind::PurpleBed => SimplifiedBlockKind::Bed, - BlockKind::BlueBed => SimplifiedBlockKind::Bed, - BlockKind::BrownBed => SimplifiedBlockKind::Bed, - BlockKind::GreenBed => SimplifiedBlockKind::Bed, - BlockKind::RedBed => SimplifiedBlockKind::Bed, - BlockKind::BlackBed => SimplifiedBlockKind::Bed, - BlockKind::PoweredRail => SimplifiedBlockKind::PoweredRail, - BlockKind::DetectorRail => SimplifiedBlockKind::DetectorRail, - BlockKind::StickyPiston => SimplifiedBlockKind::StickyPiston, - BlockKind::Cobweb => SimplifiedBlockKind::Cobweb, - BlockKind::Grass => SimplifiedBlockKind::Grass, - BlockKind::Fern => SimplifiedBlockKind::Fern, - BlockKind::DeadBush => SimplifiedBlockKind::DeadBush, - BlockKind::Seagrass => SimplifiedBlockKind::Seagrass, - BlockKind::TallSeagrass => SimplifiedBlockKind::TallSeagrass, - BlockKind::Piston => SimplifiedBlockKind::Piston, - BlockKind::PistonHead => SimplifiedBlockKind::PistonHead, - BlockKind::WhiteWool => SimplifiedBlockKind::Wool, - BlockKind::OrangeWool => SimplifiedBlockKind::Wool, - BlockKind::MagentaWool => SimplifiedBlockKind::Wool, - BlockKind::LightBlueWool => SimplifiedBlockKind::Wool, - BlockKind::YellowWool => SimplifiedBlockKind::Wool, - BlockKind::LimeWool => SimplifiedBlockKind::Wool, - BlockKind::PinkWool => SimplifiedBlockKind::Wool, - BlockKind::GrayWool => SimplifiedBlockKind::Wool, - BlockKind::LightGrayWool => SimplifiedBlockKind::Wool, - BlockKind::CyanWool => SimplifiedBlockKind::Wool, - BlockKind::PurpleWool => SimplifiedBlockKind::Wool, - BlockKind::BlueWool => SimplifiedBlockKind::Wool, - BlockKind::BrownWool => SimplifiedBlockKind::Wool, - BlockKind::GreenWool => SimplifiedBlockKind::Wool, - BlockKind::RedWool => SimplifiedBlockKind::Wool, - BlockKind::BlackWool => SimplifiedBlockKind::Wool, - BlockKind::MovingPiston => SimplifiedBlockKind::MovingPiston, - BlockKind::Dandelion => SimplifiedBlockKind::Flower, - BlockKind::Poppy => SimplifiedBlockKind::Flower, - BlockKind::BlueOrchid => SimplifiedBlockKind::Flower, - BlockKind::Allium => SimplifiedBlockKind::Flower, - BlockKind::AzureBluet => SimplifiedBlockKind::Flower, - BlockKind::RedTulip => SimplifiedBlockKind::Flower, - BlockKind::OrangeTulip => SimplifiedBlockKind::Flower, - BlockKind::WhiteTulip => SimplifiedBlockKind::Flower, - BlockKind::PinkTulip => SimplifiedBlockKind::Flower, - BlockKind::OxeyeDaisy => SimplifiedBlockKind::Flower, - BlockKind::Cornflower => SimplifiedBlockKind::Cornflower, - BlockKind::WitherRose => SimplifiedBlockKind::WitherRose, - BlockKind::LilyOfTheValley => SimplifiedBlockKind::LilyOfTheValley, - BlockKind::BrownMushroom => SimplifiedBlockKind::Mushroom, - BlockKind::RedMushroom => SimplifiedBlockKind::Mushroom, - BlockKind::GoldBlock => SimplifiedBlockKind::GoldBlock, - BlockKind::IronBlock => SimplifiedBlockKind::IronBlock, - BlockKind::Bricks => SimplifiedBlockKind::Bricks, - BlockKind::Tnt => SimplifiedBlockKind::Tnt, - BlockKind::Bookshelf => SimplifiedBlockKind::Bookshelf, - BlockKind::MossyCobblestone => SimplifiedBlockKind::MossyCobblestone, - BlockKind::Obsidian => SimplifiedBlockKind::Obsidian, - BlockKind::Torch => SimplifiedBlockKind::Torch, - BlockKind::WallTorch => SimplifiedBlockKind::WallTorch, - BlockKind::Fire => SimplifiedBlockKind::Fire, - BlockKind::SoulFire => SimplifiedBlockKind::SoulFire, - BlockKind::Spawner => SimplifiedBlockKind::Spawner, - BlockKind::OakStairs => SimplifiedBlockKind::Stairs, - BlockKind::Chest => SimplifiedBlockKind::Chest, - BlockKind::RedstoneWire => SimplifiedBlockKind::RedstoneWire, - BlockKind::DiamondOre => SimplifiedBlockKind::DiamondOre, - BlockKind::DiamondBlock => SimplifiedBlockKind::DiamondBlock, - BlockKind::CraftingTable => SimplifiedBlockKind::CraftingTable, - BlockKind::Wheat => SimplifiedBlockKind::Wheat, - BlockKind::Farmland => SimplifiedBlockKind::Farmland, - BlockKind::Furnace => SimplifiedBlockKind::Furnace, - BlockKind::OakSign => SimplifiedBlockKind::Sign, - BlockKind::SpruceSign => SimplifiedBlockKind::Sign, - BlockKind::BirchSign => SimplifiedBlockKind::Sign, - BlockKind::AcaciaSign => SimplifiedBlockKind::Sign, - BlockKind::JungleSign => SimplifiedBlockKind::Sign, - BlockKind::DarkOakSign => SimplifiedBlockKind::Sign, - BlockKind::OakDoor => SimplifiedBlockKind::WoodenDoor, - BlockKind::Ladder => SimplifiedBlockKind::Ladder, - BlockKind::Rail => SimplifiedBlockKind::Rail, - BlockKind::CobblestoneStairs => SimplifiedBlockKind::Stairs, - BlockKind::OakWallSign => SimplifiedBlockKind::WallSign, - BlockKind::SpruceWallSign => SimplifiedBlockKind::WallSign, - BlockKind::BirchWallSign => SimplifiedBlockKind::WallSign, - BlockKind::AcaciaWallSign => SimplifiedBlockKind::WallSign, - BlockKind::JungleWallSign => SimplifiedBlockKind::WallSign, - BlockKind::DarkOakWallSign => SimplifiedBlockKind::WallSign, - BlockKind::Lever => SimplifiedBlockKind::Lever, - BlockKind::StonePressurePlate => SimplifiedBlockKind::StonePressurePlate, - BlockKind::IronDoor => SimplifiedBlockKind::IronDoor, - BlockKind::OakPressurePlate => SimplifiedBlockKind::WoodenPressurePlate, - BlockKind::SprucePressurePlate => SimplifiedBlockKind::WoodenPressurePlate, - BlockKind::BirchPressurePlate => SimplifiedBlockKind::WoodenPressurePlate, - BlockKind::JunglePressurePlate => SimplifiedBlockKind::WoodenPressurePlate, - BlockKind::AcaciaPressurePlate => SimplifiedBlockKind::WoodenPressurePlate, - BlockKind::DarkOakPressurePlate => SimplifiedBlockKind::WoodenPressurePlate, - BlockKind::RedstoneOre => SimplifiedBlockKind::RedstoneOre, - BlockKind::RedstoneTorch => SimplifiedBlockKind::RedstoneTorch, - BlockKind::RedstoneWallTorch => SimplifiedBlockKind::RedstoneWallTorch, - BlockKind::StoneButton => SimplifiedBlockKind::StoneButton, - BlockKind::Snow => SimplifiedBlockKind::Snow, - BlockKind::Ice => SimplifiedBlockKind::Ice, - BlockKind::SnowBlock => SimplifiedBlockKind::SnowBlock, - BlockKind::Cactus => SimplifiedBlockKind::Cactus, - BlockKind::Clay => SimplifiedBlockKind::Clay, - BlockKind::SugarCane => SimplifiedBlockKind::SugarCane, - BlockKind::Jukebox => SimplifiedBlockKind::Jukebox, - BlockKind::OakFence => SimplifiedBlockKind::Fence, - BlockKind::Pumpkin => SimplifiedBlockKind::Pumpkin, - BlockKind::Netherrack => SimplifiedBlockKind::Netherrack, - BlockKind::SoulSand => SimplifiedBlockKind::SoulSand, - BlockKind::SoulSoil => SimplifiedBlockKind::SoulSoil, - BlockKind::Basalt => SimplifiedBlockKind::Basalt, - BlockKind::PolishedBasalt => SimplifiedBlockKind::PolishedBasalt, - BlockKind::SoulTorch => SimplifiedBlockKind::SoulTorch, - BlockKind::SoulWallTorch => SimplifiedBlockKind::SoulWallTorch, - BlockKind::Glowstone => SimplifiedBlockKind::Glowstone, - BlockKind::NetherPortal => SimplifiedBlockKind::NetherPortal, - BlockKind::CarvedPumpkin => SimplifiedBlockKind::CarvedPumpkin, - BlockKind::JackOLantern => SimplifiedBlockKind::JackOLantern, - BlockKind::Cake => SimplifiedBlockKind::Cake, - BlockKind::Repeater => SimplifiedBlockKind::Repeater, - BlockKind::WhiteStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::OrangeStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::MagentaStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::LightBlueStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::YellowStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::LimeStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::PinkStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::GrayStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::LightGrayStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::CyanStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::PurpleStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::BlueStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::BrownStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::GreenStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::RedStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::BlackStainedGlass => SimplifiedBlockKind::StainedGlass, - BlockKind::OakTrapdoor => SimplifiedBlockKind::WoodenTrapdoor, - BlockKind::SpruceTrapdoor => SimplifiedBlockKind::WoodenTrapdoor, - BlockKind::BirchTrapdoor => SimplifiedBlockKind::WoodenTrapdoor, - BlockKind::JungleTrapdoor => SimplifiedBlockKind::WoodenTrapdoor, - BlockKind::AcaciaTrapdoor => SimplifiedBlockKind::WoodenTrapdoor, - BlockKind::DarkOakTrapdoor => SimplifiedBlockKind::WoodenTrapdoor, - BlockKind::StoneBricks => SimplifiedBlockKind::StoneBricks, - BlockKind::MossyStoneBricks => SimplifiedBlockKind::MossyStoneBricks, - BlockKind::CrackedStoneBricks => SimplifiedBlockKind::CrackedStoneBricks, - BlockKind::ChiseledStoneBricks => SimplifiedBlockKind::ChiseledStoneBricks, - BlockKind::InfestedStone => SimplifiedBlockKind::InfestedStone, - BlockKind::InfestedCobblestone => SimplifiedBlockKind::InfestedCobblestone, - BlockKind::InfestedStoneBricks => SimplifiedBlockKind::InfestedStoneBricks, - BlockKind::InfestedMossyStoneBricks => SimplifiedBlockKind::InfestedMossyStoneBricks, - BlockKind::InfestedCrackedStoneBricks => { - SimplifiedBlockKind::InfestedCrackedStoneBricks - } - BlockKind::InfestedChiseledStoneBricks => { - SimplifiedBlockKind::InfestedChiseledStoneBricks - } - BlockKind::BrownMushroomBlock => SimplifiedBlockKind::BrownMushroomBlock, - BlockKind::RedMushroomBlock => SimplifiedBlockKind::RedMushroomBlock, - BlockKind::MushroomStem => SimplifiedBlockKind::MushroomStem, - BlockKind::IronBars => SimplifiedBlockKind::IronBars, - BlockKind::Chain => SimplifiedBlockKind::Chain, - BlockKind::GlassPane => SimplifiedBlockKind::GlassPane, - BlockKind::Melon => SimplifiedBlockKind::Melon, - BlockKind::AttachedPumpkinStem => SimplifiedBlockKind::AttachedPumpkinStem, - BlockKind::AttachedMelonStem => SimplifiedBlockKind::AttachedMelonStem, - BlockKind::PumpkinStem => SimplifiedBlockKind::PumpkinStem, - BlockKind::MelonStem => SimplifiedBlockKind::MelonStem, - BlockKind::Vine => SimplifiedBlockKind::Vine, - BlockKind::OakFenceGate => SimplifiedBlockKind::FenceGate, - BlockKind::BrickStairs => SimplifiedBlockKind::Stairs, - BlockKind::StoneBrickStairs => SimplifiedBlockKind::Stairs, - BlockKind::Mycelium => SimplifiedBlockKind::Mycelium, - BlockKind::LilyPad => SimplifiedBlockKind::LilyPad, - BlockKind::NetherBricks => SimplifiedBlockKind::NetherBricks, - BlockKind::NetherBrickFence => SimplifiedBlockKind::Fence, - BlockKind::NetherBrickStairs => SimplifiedBlockKind::Stairs, - BlockKind::NetherWart => SimplifiedBlockKind::NetherWart, - BlockKind::EnchantingTable => SimplifiedBlockKind::EnchantingTable, - BlockKind::BrewingStand => SimplifiedBlockKind::BrewingStand, - BlockKind::Cauldron => SimplifiedBlockKind::Cauldron, - BlockKind::EndPortal => SimplifiedBlockKind::EndPortal, - BlockKind::EndPortalFrame => SimplifiedBlockKind::EndPortalFrame, - BlockKind::EndStone => SimplifiedBlockKind::EndStone, - BlockKind::DragonEgg => SimplifiedBlockKind::DragonEgg, - BlockKind::RedstoneLamp => SimplifiedBlockKind::RedstoneLamp, - BlockKind::Cocoa => SimplifiedBlockKind::Cocoa, - BlockKind::SandstoneStairs => SimplifiedBlockKind::Stairs, - BlockKind::EmeraldOre => SimplifiedBlockKind::EmeraldOre, - BlockKind::EnderChest => SimplifiedBlockKind::EnderChest, - BlockKind::TripwireHook => SimplifiedBlockKind::TripwireHook, - BlockKind::Tripwire => SimplifiedBlockKind::Tripwire, - BlockKind::EmeraldBlock => SimplifiedBlockKind::EmeraldBlock, - BlockKind::SpruceStairs => SimplifiedBlockKind::Stairs, - BlockKind::BirchStairs => SimplifiedBlockKind::Stairs, - BlockKind::JungleStairs => SimplifiedBlockKind::Stairs, - BlockKind::CommandBlock => SimplifiedBlockKind::CommandBlock, - BlockKind::Beacon => SimplifiedBlockKind::Beacon, - BlockKind::CobblestoneWall => SimplifiedBlockKind::CobblestoneWall, - BlockKind::MossyCobblestoneWall => SimplifiedBlockKind::MossyCobblestoneWall, - BlockKind::FlowerPot => SimplifiedBlockKind::FlowerPot, - BlockKind::PottedOakSapling => SimplifiedBlockKind::Sapling, - BlockKind::PottedSpruceSapling => SimplifiedBlockKind::Sapling, - BlockKind::PottedBirchSapling => SimplifiedBlockKind::Sapling, - BlockKind::PottedJungleSapling => SimplifiedBlockKind::Sapling, - BlockKind::PottedAcaciaSapling => SimplifiedBlockKind::Sapling, - BlockKind::PottedDarkOakSapling => SimplifiedBlockKind::Sapling, - BlockKind::PottedFern => SimplifiedBlockKind::PottedFern, - BlockKind::PottedDandelion => SimplifiedBlockKind::PottedDandelion, - BlockKind::PottedPoppy => SimplifiedBlockKind::PottedPoppy, - BlockKind::PottedBlueOrchid => SimplifiedBlockKind::Flower, - BlockKind::PottedAllium => SimplifiedBlockKind::PottedAllium, - BlockKind::PottedAzureBluet => SimplifiedBlockKind::Flower, - BlockKind::PottedRedTulip => SimplifiedBlockKind::Flower, - BlockKind::PottedOrangeTulip => SimplifiedBlockKind::Flower, - BlockKind::PottedWhiteTulip => SimplifiedBlockKind::Flower, - BlockKind::PottedPinkTulip => SimplifiedBlockKind::Flower, - BlockKind::PottedOxeyeDaisy => SimplifiedBlockKind::Flower, - BlockKind::PottedCornflower => SimplifiedBlockKind::PottedCornflower, - BlockKind::PottedLilyOfTheValley => SimplifiedBlockKind::PottedLilyOfTheValley, - BlockKind::PottedWitherRose => SimplifiedBlockKind::PottedWitherRose, - BlockKind::PottedRedMushroom => SimplifiedBlockKind::Mushroom, - BlockKind::PottedBrownMushroom => SimplifiedBlockKind::Mushroom, - BlockKind::PottedDeadBush => SimplifiedBlockKind::PottedDeadBush, - BlockKind::PottedCactus => SimplifiedBlockKind::PottedCactus, - BlockKind::Carrots => SimplifiedBlockKind::Carrots, - BlockKind::Potatoes => SimplifiedBlockKind::Potatoes, - BlockKind::OakButton => SimplifiedBlockKind::WoodenButton, - BlockKind::SpruceButton => SimplifiedBlockKind::WoodenButton, - BlockKind::BirchButton => SimplifiedBlockKind::WoodenButton, - BlockKind::JungleButton => SimplifiedBlockKind::WoodenButton, - BlockKind::AcaciaButton => SimplifiedBlockKind::WoodenButton, - BlockKind::DarkOakButton => SimplifiedBlockKind::WoodenButton, - BlockKind::SkeletonSkull => SimplifiedBlockKind::SkeletonSkull, - BlockKind::SkeletonWallSkull => SimplifiedBlockKind::SkeletonWallSkull, - BlockKind::WitherSkeletonSkull => SimplifiedBlockKind::WitherSkeletonSkull, - BlockKind::WitherSkeletonWallSkull => SimplifiedBlockKind::WitherSkeletonWallSkull, - BlockKind::ZombieHead => SimplifiedBlockKind::ZombieHead, - BlockKind::ZombieWallHead => SimplifiedBlockKind::ZombieWallHead, - BlockKind::PlayerHead => SimplifiedBlockKind::PlayerHead, - BlockKind::PlayerWallHead => SimplifiedBlockKind::PlayerWallHead, - BlockKind::CreeperHead => SimplifiedBlockKind::CreeperHead, - BlockKind::CreeperWallHead => SimplifiedBlockKind::CreeperWallHead, - BlockKind::DragonHead => SimplifiedBlockKind::DragonHead, - BlockKind::DragonWallHead => SimplifiedBlockKind::DragonWallHead, - BlockKind::Anvil => SimplifiedBlockKind::Anvil, - BlockKind::ChippedAnvil => SimplifiedBlockKind::Anvil, - BlockKind::DamagedAnvil => SimplifiedBlockKind::Anvil, - BlockKind::TrappedChest => SimplifiedBlockKind::TrappedChest, - BlockKind::LightWeightedPressurePlate => { - SimplifiedBlockKind::LightWeightedPressurePlate - } - BlockKind::HeavyWeightedPressurePlate => { - SimplifiedBlockKind::HeavyWeightedPressurePlate - } - BlockKind::Comparator => SimplifiedBlockKind::Comparator, - BlockKind::DaylightDetector => SimplifiedBlockKind::DaylightDetector, - BlockKind::RedstoneBlock => SimplifiedBlockKind::RedstoneBlock, - BlockKind::NetherQuartzOre => SimplifiedBlockKind::NetherQuartzOre, - BlockKind::Hopper => SimplifiedBlockKind::Hopper, - BlockKind::QuartzBlock => SimplifiedBlockKind::QuartzBlock, - BlockKind::ChiseledQuartzBlock => SimplifiedBlockKind::ChiseledQuartzBlock, - BlockKind::QuartzPillar => SimplifiedBlockKind::QuartzPillar, - BlockKind::QuartzStairs => SimplifiedBlockKind::Stairs, - BlockKind::ActivatorRail => SimplifiedBlockKind::ActivatorRail, - BlockKind::Dropper => SimplifiedBlockKind::Dropper, - BlockKind::WhiteTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::OrangeTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::MagentaTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::LightBlueTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::YellowTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::LimeTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::PinkTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::GrayTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::LightGrayTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::CyanTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::PurpleTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::BlueTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::BrownTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::GreenTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::RedTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::BlackTerracotta => SimplifiedBlockKind::Teracotta, - BlockKind::WhiteStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::OrangeStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::MagentaStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::LightBlueStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::YellowStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::LimeStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::PinkStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::GrayStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::LightGrayStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::CyanStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::PurpleStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::BlueStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::BrownStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::GreenStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::RedStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::BlackStainedGlassPane => SimplifiedBlockKind::StainedGlassPane, - BlockKind::AcaciaStairs => SimplifiedBlockKind::Stairs, - BlockKind::DarkOakStairs => SimplifiedBlockKind::Stairs, - BlockKind::SlimeBlock => SimplifiedBlockKind::SlimeBlock, - BlockKind::Barrier => SimplifiedBlockKind::Barrier, - BlockKind::IronTrapdoor => SimplifiedBlockKind::IronTrapdoor, - BlockKind::Prismarine => SimplifiedBlockKind::Prismarine, - BlockKind::PrismarineBricks => SimplifiedBlockKind::PrismarineBricks, - BlockKind::DarkPrismarine => SimplifiedBlockKind::DarkPrismarine, - BlockKind::PrismarineStairs => SimplifiedBlockKind::Stairs, - BlockKind::PrismarineBrickStairs => SimplifiedBlockKind::Stairs, - BlockKind::DarkPrismarineStairs => SimplifiedBlockKind::Stairs, - BlockKind::PrismarineSlab => SimplifiedBlockKind::Slab, - BlockKind::PrismarineBrickSlab => SimplifiedBlockKind::Slab, - BlockKind::DarkPrismarineSlab => SimplifiedBlockKind::Slab, - BlockKind::SeaLantern => SimplifiedBlockKind::SeaLantern, - BlockKind::HayBlock => SimplifiedBlockKind::HayBlock, - BlockKind::WhiteCarpet => SimplifiedBlockKind::Carpet, - BlockKind::OrangeCarpet => SimplifiedBlockKind::Carpet, - BlockKind::MagentaCarpet => SimplifiedBlockKind::Carpet, - BlockKind::LightBlueCarpet => SimplifiedBlockKind::Carpet, - BlockKind::YellowCarpet => SimplifiedBlockKind::Carpet, - BlockKind::LimeCarpet => SimplifiedBlockKind::Carpet, - BlockKind::PinkCarpet => SimplifiedBlockKind::Carpet, - BlockKind::GrayCarpet => SimplifiedBlockKind::Carpet, - BlockKind::LightGrayCarpet => SimplifiedBlockKind::Carpet, - BlockKind::CyanCarpet => SimplifiedBlockKind::Carpet, - BlockKind::PurpleCarpet => SimplifiedBlockKind::Carpet, - BlockKind::BlueCarpet => SimplifiedBlockKind::Carpet, - BlockKind::BrownCarpet => SimplifiedBlockKind::Carpet, - BlockKind::GreenCarpet => SimplifiedBlockKind::Carpet, - BlockKind::RedCarpet => SimplifiedBlockKind::Carpet, - BlockKind::BlackCarpet => SimplifiedBlockKind::Carpet, - BlockKind::Terracotta => SimplifiedBlockKind::Teracotta, - BlockKind::CoalBlock => SimplifiedBlockKind::CoalBlock, - BlockKind::PackedIce => SimplifiedBlockKind::PackedIce, - BlockKind::Sunflower => SimplifiedBlockKind::Sunflower, - BlockKind::Lilac => SimplifiedBlockKind::Lilac, - BlockKind::RoseBush => SimplifiedBlockKind::RoseBush, - BlockKind::Peony => SimplifiedBlockKind::Peony, - BlockKind::TallGrass => SimplifiedBlockKind::TallGrass, - BlockKind::LargeFern => SimplifiedBlockKind::LargeFern, - BlockKind::WhiteBanner => SimplifiedBlockKind::Banner, - BlockKind::OrangeBanner => SimplifiedBlockKind::Banner, - BlockKind::MagentaBanner => SimplifiedBlockKind::Banner, - BlockKind::LightBlueBanner => SimplifiedBlockKind::Banner, - BlockKind::YellowBanner => SimplifiedBlockKind::Banner, - BlockKind::LimeBanner => SimplifiedBlockKind::Banner, - BlockKind::PinkBanner => SimplifiedBlockKind::Banner, - BlockKind::GrayBanner => SimplifiedBlockKind::Banner, - BlockKind::LightGrayBanner => SimplifiedBlockKind::Banner, - BlockKind::CyanBanner => SimplifiedBlockKind::Banner, - BlockKind::PurpleBanner => SimplifiedBlockKind::Banner, - BlockKind::BlueBanner => SimplifiedBlockKind::Banner, - BlockKind::BrownBanner => SimplifiedBlockKind::Banner, - BlockKind::GreenBanner => SimplifiedBlockKind::Banner, - BlockKind::RedBanner => SimplifiedBlockKind::Banner, - BlockKind::BlackBanner => SimplifiedBlockKind::Banner, - BlockKind::WhiteWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::OrangeWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::MagentaWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::LightBlueWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::YellowWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::LimeWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::PinkWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::GrayWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::LightGrayWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::CyanWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::PurpleWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::BlueWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::BrownWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::GreenWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::RedWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::BlackWallBanner => SimplifiedBlockKind::WallBanner, - BlockKind::RedSandstone => SimplifiedBlockKind::RedSandstone, - BlockKind::ChiseledRedSandstone => SimplifiedBlockKind::ChiseledRedSandstone, - BlockKind::CutRedSandstone => SimplifiedBlockKind::CutRedSandstone, - BlockKind::RedSandstoneStairs => SimplifiedBlockKind::Stairs, - BlockKind::OakSlab => SimplifiedBlockKind::Slab, - BlockKind::SpruceSlab => SimplifiedBlockKind::Slab, - BlockKind::BirchSlab => SimplifiedBlockKind::Slab, - BlockKind::JungleSlab => SimplifiedBlockKind::Slab, - BlockKind::AcaciaSlab => SimplifiedBlockKind::Slab, - BlockKind::DarkOakSlab => SimplifiedBlockKind::Slab, - BlockKind::StoneSlab => SimplifiedBlockKind::Slab, - BlockKind::SmoothStoneSlab => SimplifiedBlockKind::Slab, - BlockKind::SandstoneSlab => SimplifiedBlockKind::Slab, - BlockKind::CutSandstoneSlab => SimplifiedBlockKind::Slab, - BlockKind::PetrifiedOakSlab => SimplifiedBlockKind::Slab, - BlockKind::CobblestoneSlab => SimplifiedBlockKind::Slab, - BlockKind::BrickSlab => SimplifiedBlockKind::Slab, - BlockKind::StoneBrickSlab => SimplifiedBlockKind::Slab, - BlockKind::NetherBrickSlab => SimplifiedBlockKind::Slab, - BlockKind::QuartzSlab => SimplifiedBlockKind::Slab, - BlockKind::RedSandstoneSlab => SimplifiedBlockKind::Slab, - BlockKind::CutRedSandstoneSlab => SimplifiedBlockKind::Slab, - BlockKind::PurpurSlab => SimplifiedBlockKind::Slab, - BlockKind::SmoothStone => SimplifiedBlockKind::SmoothStone, - BlockKind::SmoothSandstone => SimplifiedBlockKind::SmoothSandstone, - BlockKind::SmoothQuartz => SimplifiedBlockKind::SmoothQuartz, - BlockKind::SmoothRedSandstone => SimplifiedBlockKind::SmoothRedSandstone, - BlockKind::SpruceFenceGate => SimplifiedBlockKind::FenceGate, - BlockKind::BirchFenceGate => SimplifiedBlockKind::FenceGate, - BlockKind::JungleFenceGate => SimplifiedBlockKind::FenceGate, - BlockKind::AcaciaFenceGate => SimplifiedBlockKind::FenceGate, - BlockKind::DarkOakFenceGate => SimplifiedBlockKind::FenceGate, - BlockKind::SpruceFence => SimplifiedBlockKind::Fence, - BlockKind::BirchFence => SimplifiedBlockKind::Fence, - BlockKind::JungleFence => SimplifiedBlockKind::Fence, - BlockKind::AcaciaFence => SimplifiedBlockKind::Fence, - BlockKind::DarkOakFence => SimplifiedBlockKind::Fence, - BlockKind::SpruceDoor => SimplifiedBlockKind::WoodenDoor, - BlockKind::BirchDoor => SimplifiedBlockKind::WoodenDoor, - BlockKind::JungleDoor => SimplifiedBlockKind::WoodenDoor, - BlockKind::AcaciaDoor => SimplifiedBlockKind::WoodenDoor, - BlockKind::DarkOakDoor => SimplifiedBlockKind::WoodenDoor, - BlockKind::EndRod => SimplifiedBlockKind::EndRod, - BlockKind::ChorusPlant => SimplifiedBlockKind::ChorusPlant, - BlockKind::ChorusFlower => SimplifiedBlockKind::ChorusFlower, - BlockKind::PurpurBlock => SimplifiedBlockKind::PurpurBlock, - BlockKind::PurpurPillar => SimplifiedBlockKind::PurpurPillar, - BlockKind::PurpurStairs => SimplifiedBlockKind::Stairs, - BlockKind::EndStoneBricks => SimplifiedBlockKind::EndStoneBricks, - BlockKind::Beetroots => SimplifiedBlockKind::Beetroots, - BlockKind::GrassPath => SimplifiedBlockKind::GrassPath, - BlockKind::EndGateway => SimplifiedBlockKind::EndGateway, - BlockKind::RepeatingCommandBlock => SimplifiedBlockKind::RepeatingCommandBlock, - BlockKind::ChainCommandBlock => SimplifiedBlockKind::ChainCommandBlock, - BlockKind::FrostedIce => SimplifiedBlockKind::FrostedIce, - BlockKind::MagmaBlock => SimplifiedBlockKind::MagmaBlock, - BlockKind::NetherWartBlock => SimplifiedBlockKind::NetherWartBlock, - BlockKind::RedNetherBricks => SimplifiedBlockKind::RedNetherBricks, - BlockKind::BoneBlock => SimplifiedBlockKind::BoneBlock, - BlockKind::StructureVoid => SimplifiedBlockKind::StructureVoid, - BlockKind::Observer => SimplifiedBlockKind::Observer, - BlockKind::ShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::WhiteShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::OrangeShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::MagentaShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::LightBlueShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::YellowShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::LimeShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::PinkShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::GrayShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::LightGrayShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::CyanShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::PurpleShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::BlueShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::BrownShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::GreenShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::RedShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::BlackShulkerBox => SimplifiedBlockKind::ShulkerBox, - BlockKind::WhiteGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::OrangeGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::MagentaGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::LightBlueGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::YellowGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::LimeGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::PinkGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::GrayGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::LightGrayGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::CyanGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::PurpleGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::BlueGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::BrownGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::GreenGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::RedGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::BlackGlazedTerracotta => SimplifiedBlockKind::GlazedTeracotta, - BlockKind::WhiteConcrete => SimplifiedBlockKind::Concrete, - BlockKind::OrangeConcrete => SimplifiedBlockKind::Concrete, - BlockKind::MagentaConcrete => SimplifiedBlockKind::Concrete, - BlockKind::LightBlueConcrete => SimplifiedBlockKind::Concrete, - BlockKind::YellowConcrete => SimplifiedBlockKind::Concrete, - BlockKind::LimeConcrete => SimplifiedBlockKind::Concrete, - BlockKind::PinkConcrete => SimplifiedBlockKind::Concrete, - BlockKind::GrayConcrete => SimplifiedBlockKind::Concrete, - BlockKind::LightGrayConcrete => SimplifiedBlockKind::Concrete, - BlockKind::CyanConcrete => SimplifiedBlockKind::Concrete, - BlockKind::PurpleConcrete => SimplifiedBlockKind::Concrete, - BlockKind::BlueConcrete => SimplifiedBlockKind::Concrete, - BlockKind::BrownConcrete => SimplifiedBlockKind::Concrete, - BlockKind::GreenConcrete => SimplifiedBlockKind::Concrete, - BlockKind::RedConcrete => SimplifiedBlockKind::Concrete, - BlockKind::BlackConcrete => SimplifiedBlockKind::Concrete, - BlockKind::WhiteConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::OrangeConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::MagentaConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::LightBlueConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::YellowConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::LimeConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::PinkConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::GrayConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::LightGrayConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::CyanConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::PurpleConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::BlueConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::BrownConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::GreenConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::RedConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::BlackConcretePowder => SimplifiedBlockKind::ConcretePowder, - BlockKind::Kelp => SimplifiedBlockKind::Kelp, - BlockKind::KelpPlant => SimplifiedBlockKind::KelpPlant, - BlockKind::DriedKelpBlock => SimplifiedBlockKind::DriedKelpBlock, - BlockKind::TurtleEgg => SimplifiedBlockKind::TurtleEgg, - BlockKind::DeadTubeCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::DeadBrainCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::DeadBubbleCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::DeadFireCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::DeadHornCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::TubeCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::BrainCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::BubbleCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::FireCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::HornCoralBlock => SimplifiedBlockKind::CoralBlock, - BlockKind::DeadTubeCoral => SimplifiedBlockKind::Coral, - BlockKind::DeadBrainCoral => SimplifiedBlockKind::Coral, - BlockKind::DeadBubbleCoral => SimplifiedBlockKind::Coral, - BlockKind::DeadFireCoral => SimplifiedBlockKind::Coral, - BlockKind::DeadHornCoral => SimplifiedBlockKind::Coral, - BlockKind::TubeCoral => SimplifiedBlockKind::Coral, - BlockKind::BrainCoral => SimplifiedBlockKind::Coral, - BlockKind::BubbleCoral => SimplifiedBlockKind::Coral, - BlockKind::FireCoral => SimplifiedBlockKind::Coral, - BlockKind::HornCoral => SimplifiedBlockKind::Coral, - BlockKind::DeadTubeCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::DeadBrainCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::DeadBubbleCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::DeadFireCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::DeadHornCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::TubeCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::BrainCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::BubbleCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::FireCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::HornCoralFan => SimplifiedBlockKind::CoralFan, - BlockKind::DeadTubeCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::DeadBrainCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::DeadBubbleCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::DeadFireCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::DeadHornCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::TubeCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::BrainCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::BubbleCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::FireCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::HornCoralWallFan => SimplifiedBlockKind::CoralWallFan, - BlockKind::SeaPickle => SimplifiedBlockKind::SeaPickle, - BlockKind::BlueIce => SimplifiedBlockKind::BlueIce, - BlockKind::Conduit => SimplifiedBlockKind::Conduit, - BlockKind::BambooSapling => SimplifiedBlockKind::Sapling, - BlockKind::Bamboo => SimplifiedBlockKind::Bamboo, - BlockKind::PottedBamboo => SimplifiedBlockKind::PottedBamboo, - BlockKind::VoidAir => SimplifiedBlockKind::Air, - BlockKind::CaveAir => SimplifiedBlockKind::Air, - BlockKind::BubbleColumn => SimplifiedBlockKind::BubbleColumn, - BlockKind::PolishedGraniteStairs => SimplifiedBlockKind::Stairs, - BlockKind::SmoothRedSandstoneStairs => SimplifiedBlockKind::Stairs, - BlockKind::MossyStoneBrickStairs => SimplifiedBlockKind::Stairs, - BlockKind::PolishedDioriteStairs => SimplifiedBlockKind::Stairs, - BlockKind::MossyCobblestoneStairs => SimplifiedBlockKind::Stairs, - BlockKind::EndStoneBrickStairs => SimplifiedBlockKind::Stairs, - BlockKind::StoneStairs => SimplifiedBlockKind::Stairs, - BlockKind::SmoothSandstoneStairs => SimplifiedBlockKind::Stairs, - BlockKind::SmoothQuartzStairs => SimplifiedBlockKind::Stairs, - BlockKind::GraniteStairs => SimplifiedBlockKind::Stairs, - BlockKind::AndesiteStairs => SimplifiedBlockKind::Stairs, - BlockKind::RedNetherBrickStairs => SimplifiedBlockKind::Stairs, - BlockKind::PolishedAndesiteStairs => SimplifiedBlockKind::Stairs, - BlockKind::DioriteStairs => SimplifiedBlockKind::Stairs, - BlockKind::PolishedGraniteSlab => SimplifiedBlockKind::Slab, - BlockKind::SmoothRedSandstoneSlab => SimplifiedBlockKind::Slab, - BlockKind::MossyStoneBrickSlab => SimplifiedBlockKind::Slab, - BlockKind::PolishedDioriteSlab => SimplifiedBlockKind::Slab, - BlockKind::MossyCobblestoneSlab => SimplifiedBlockKind::Slab, - BlockKind::EndStoneBrickSlab => SimplifiedBlockKind::Slab, - BlockKind::SmoothSandstoneSlab => SimplifiedBlockKind::Slab, - BlockKind::SmoothQuartzSlab => SimplifiedBlockKind::Slab, - BlockKind::GraniteSlab => SimplifiedBlockKind::Slab, - BlockKind::AndesiteSlab => SimplifiedBlockKind::Slab, - BlockKind::RedNetherBrickSlab => SimplifiedBlockKind::Slab, - BlockKind::PolishedAndesiteSlab => SimplifiedBlockKind::Slab, - BlockKind::DioriteSlab => SimplifiedBlockKind::Slab, - BlockKind::BrickWall => SimplifiedBlockKind::BrickWall, - BlockKind::PrismarineWall => SimplifiedBlockKind::PrismarineWall, - BlockKind::RedSandstoneWall => SimplifiedBlockKind::RedSandstoneWall, - BlockKind::MossyStoneBrickWall => SimplifiedBlockKind::MossyStoneBrickWall, - BlockKind::GraniteWall => SimplifiedBlockKind::GraniteWall, - BlockKind::StoneBrickWall => SimplifiedBlockKind::StoneBrickWall, - BlockKind::NetherBrickWall => SimplifiedBlockKind::NetherBrickWall, - BlockKind::AndesiteWall => SimplifiedBlockKind::AndesiteWall, - BlockKind::RedNetherBrickWall => SimplifiedBlockKind::RedNetherBrickWall, - BlockKind::SandstoneWall => SimplifiedBlockKind::SandstoneWall, - BlockKind::EndStoneBrickWall => SimplifiedBlockKind::EndStoneBrickWall, - BlockKind::DioriteWall => SimplifiedBlockKind::DioriteWall, - BlockKind::Scaffolding => SimplifiedBlockKind::Scaffolding, - BlockKind::Loom => SimplifiedBlockKind::Loom, - BlockKind::Barrel => SimplifiedBlockKind::Barrel, - BlockKind::Smoker => SimplifiedBlockKind::Smoker, - BlockKind::BlastFurnace => SimplifiedBlockKind::BlastFurnace, - BlockKind::CartographyTable => SimplifiedBlockKind::CartographyTable, - BlockKind::FletchingTable => SimplifiedBlockKind::FletchingTable, - BlockKind::Grindstone => SimplifiedBlockKind::Grindstone, - BlockKind::Lectern => SimplifiedBlockKind::Lectern, - BlockKind::SmithingTable => SimplifiedBlockKind::SmithingTable, - BlockKind::Stonecutter => SimplifiedBlockKind::Stonecutter, - BlockKind::Bell => SimplifiedBlockKind::Bell, - BlockKind::Lantern => SimplifiedBlockKind::Lantern, - BlockKind::SoulLantern => SimplifiedBlockKind::SoulLantern, - BlockKind::Campfire => SimplifiedBlockKind::Campfire, - BlockKind::SoulCampfire => SimplifiedBlockKind::SoulCampfire, - BlockKind::SweetBerryBush => SimplifiedBlockKind::SweetBerryBush, - BlockKind::WarpedStem => SimplifiedBlockKind::WarpedStem, - BlockKind::StrippedWarpedStem => SimplifiedBlockKind::StrippedWarpedStem, - BlockKind::WarpedHyphae => SimplifiedBlockKind::WarpedHyphae, - BlockKind::StrippedWarpedHyphae => SimplifiedBlockKind::StrippedWarpedHyphae, - BlockKind::WarpedNylium => SimplifiedBlockKind::WarpedNylium, - BlockKind::WarpedFungus => SimplifiedBlockKind::WarpedFungus, - BlockKind::WarpedWartBlock => SimplifiedBlockKind::WarpedWartBlock, - BlockKind::WarpedRoots => SimplifiedBlockKind::WarpedRoots, - BlockKind::NetherSprouts => SimplifiedBlockKind::NetherSprouts, - BlockKind::CrimsonStem => SimplifiedBlockKind::CrimsonStem, - BlockKind::StrippedCrimsonStem => SimplifiedBlockKind::StrippedCrimsonStem, - BlockKind::CrimsonHyphae => SimplifiedBlockKind::CrimsonHyphae, - BlockKind::StrippedCrimsonHyphae => SimplifiedBlockKind::StrippedCrimsonHyphae, - BlockKind::CrimsonNylium => SimplifiedBlockKind::CrimsonNylium, - BlockKind::CrimsonFungus => SimplifiedBlockKind::CrimsonFungus, - BlockKind::Shroomlight => SimplifiedBlockKind::Shroomlight, - BlockKind::WeepingVines => SimplifiedBlockKind::WeepingVines, - BlockKind::WeepingVinesPlant => SimplifiedBlockKind::WeepingVinesPlant, - BlockKind::TwistingVines => SimplifiedBlockKind::TwistingVines, - BlockKind::TwistingVinesPlant => SimplifiedBlockKind::TwistingVinesPlant, - BlockKind::CrimsonRoots => SimplifiedBlockKind::CrimsonRoots, - BlockKind::CrimsonPlanks => SimplifiedBlockKind::Planks, - BlockKind::WarpedPlanks => SimplifiedBlockKind::Planks, - BlockKind::CrimsonSlab => SimplifiedBlockKind::Slab, - BlockKind::WarpedSlab => SimplifiedBlockKind::Slab, - BlockKind::CrimsonPressurePlate => SimplifiedBlockKind::CrimsonPressurePlate, - BlockKind::WarpedPressurePlate => SimplifiedBlockKind::WarpedPressurePlate, - BlockKind::CrimsonFence => SimplifiedBlockKind::Fence, - BlockKind::WarpedFence => SimplifiedBlockKind::Fence, - BlockKind::CrimsonTrapdoor => SimplifiedBlockKind::CrimsonTrapdoor, - BlockKind::WarpedTrapdoor => SimplifiedBlockKind::WarpedTrapdoor, - BlockKind::CrimsonFenceGate => SimplifiedBlockKind::FenceGate, - BlockKind::WarpedFenceGate => SimplifiedBlockKind::FenceGate, - BlockKind::CrimsonStairs => SimplifiedBlockKind::Stairs, - BlockKind::WarpedStairs => SimplifiedBlockKind::Stairs, - BlockKind::CrimsonButton => SimplifiedBlockKind::CrimsonButton, - BlockKind::WarpedButton => SimplifiedBlockKind::WarpedButton, - BlockKind::CrimsonDoor => SimplifiedBlockKind::CrimsonDoor, - BlockKind::WarpedDoor => SimplifiedBlockKind::WarpedDoor, - BlockKind::CrimsonSign => SimplifiedBlockKind::Sign, - BlockKind::WarpedSign => SimplifiedBlockKind::Sign, - BlockKind::CrimsonWallSign => SimplifiedBlockKind::WallSign, - BlockKind::WarpedWallSign => SimplifiedBlockKind::WallSign, - BlockKind::StructureBlock => SimplifiedBlockKind::StructureBlock, - BlockKind::Jigsaw => SimplifiedBlockKind::Jigsaw, - BlockKind::Composter => SimplifiedBlockKind::Composter, - BlockKind::Target => SimplifiedBlockKind::Target, - BlockKind::BeeNest => SimplifiedBlockKind::BeeNest, - BlockKind::Beehive => SimplifiedBlockKind::Beehive, - BlockKind::HoneyBlock => SimplifiedBlockKind::HoneyBlock, - BlockKind::HoneycombBlock => SimplifiedBlockKind::HoneycombBlock, - BlockKind::NetheriteBlock => SimplifiedBlockKind::NetheriteBlock, - BlockKind::AncientDebris => SimplifiedBlockKind::AncientDebris, - BlockKind::CryingObsidian => SimplifiedBlockKind::CryingObsidian, - BlockKind::RespawnAnchor => SimplifiedBlockKind::RespawnAnchor, - BlockKind::PottedCrimsonFungus => SimplifiedBlockKind::PottedCrimsonFungus, - BlockKind::PottedWarpedFungus => SimplifiedBlockKind::PottedWarpedFungus, - BlockKind::PottedCrimsonRoots => SimplifiedBlockKind::PottedCrimsonRoots, - BlockKind::PottedWarpedRoots => SimplifiedBlockKind::PottedWarpedRoots, - BlockKind::Lodestone => SimplifiedBlockKind::Lodestone, - BlockKind::Blackstone => SimplifiedBlockKind::Blackstone, - BlockKind::BlackstoneStairs => SimplifiedBlockKind::Stairs, - BlockKind::BlackstoneWall => SimplifiedBlockKind::BlackstoneWall, - BlockKind::BlackstoneSlab => SimplifiedBlockKind::Slab, - BlockKind::PolishedBlackstone => SimplifiedBlockKind::PolishedBlackstone, - BlockKind::PolishedBlackstoneBricks => SimplifiedBlockKind::PolishedBlackstoneBricks, - BlockKind::CrackedPolishedBlackstoneBricks => { - SimplifiedBlockKind::CrackedPolishedBlackstoneBricks - } - BlockKind::ChiseledPolishedBlackstone => { - SimplifiedBlockKind::ChiseledPolishedBlackstone - } - BlockKind::PolishedBlackstoneBrickSlab => SimplifiedBlockKind::Slab, - BlockKind::PolishedBlackstoneBrickStairs => SimplifiedBlockKind::Stairs, - BlockKind::PolishedBlackstoneBrickWall => { - SimplifiedBlockKind::PolishedBlackstoneBrickWall - } - BlockKind::GildedBlackstone => SimplifiedBlockKind::GildedBlackstone, - BlockKind::PolishedBlackstoneStairs => SimplifiedBlockKind::Stairs, - BlockKind::PolishedBlackstoneSlab => SimplifiedBlockKind::Slab, - BlockKind::PolishedBlackstonePressurePlate => { - SimplifiedBlockKind::PolishedBlackstonePressurePlate - } - BlockKind::PolishedBlackstoneButton => SimplifiedBlockKind::PolishedBlackstoneButton, - BlockKind::PolishedBlackstoneWall => SimplifiedBlockKind::PolishedBlackstoneWall, - BlockKind::ChiseledNetherBricks => SimplifiedBlockKind::ChiseledNetherBricks, - BlockKind::CrackedNetherBricks => SimplifiedBlockKind::CrackedNetherBricks, - BlockKind::QuartzBricks => SimplifiedBlockKind::QuartzBricks, - } - } -} diff --git a/feather/old/core/network/src/packets.rs b/feather/old/core/network/src/packets.rs index 994a277cb..e5b26ddd1 100644 --- a/feather/old/core/network/src/packets.rs +++ b/feather/old/core/network/src/packets.rs @@ -1817,7 +1817,7 @@ pub struct KeepAliveClientbound { #[derive(Default, AsAny, Clone)] pub struct ChunkData { - pub chunk: Arc>, + pub chunk: ChunkHandle, } impl Packet for ChunkData { diff --git a/feather/old/server/lighting/src/lib.rs b/feather/old/server/lighting/src/lib.rs index e433a071a..9e165cd45 100644 --- a/feather/old/server/lighting/src/lib.rs +++ b/feather/old/server/lighting/src/lib.rs @@ -107,7 +107,7 @@ pub enum Request { /// Notifies the worker of a new loaded chunk. LoadChunk { pos: ChunkPosition, - handle: Arc>, + handle: ChunkHandle, }, /// Notifies the worker that a chunk was unloaded. UnloadChunk { pos: ChunkPosition }, diff --git a/feather/old/server/player/src/view.rs b/feather/old/server/player/src/view.rs index aadb08657..d39bac190 100644 --- a/feather/old/server/player/src/view.rs +++ b/feather/old/server/player/src/view.rs @@ -356,6 +356,6 @@ pub fn on_chunk_load_send_to_clients( } /// Creates a chunk data packet for the given chunk. -fn create_chunk_data(chunk: Arc>) -> ChunkData { +fn create_chunk_data(chunk: ChunkHandle) -> ChunkData { ChunkData { chunk } } diff --git a/feather/plugin-host/Cargo.toml b/feather/plugin-host/Cargo.toml index fe5112433..b25394923 100644 --- a/feather/plugin-host/Cargo.toml +++ b/feather/plugin-host/Cargo.toml @@ -23,8 +23,9 @@ quill-plugin-format = { path = "../../quill/plugin-format" } serde = "1" tempfile = "3" vec-arena = "1" -wasmer = { version = "1", default-features = false, features = [ "jit" ] } -wasmer-wasi = { version = "1", default-features = false } +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" ] diff --git a/feather/plugin-host/src/context.rs b/feather/plugin-host/src/context.rs index b52b59671..3e014ddcd 100644 --- a/feather/plugin-host/src/context.rs +++ b/feather/plugin-host/src/context.rs @@ -328,6 +328,20 @@ impl PluginContext { } } + /// 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 diff --git a/feather/plugin-host/src/context/wasm/bump.rs b/feather/plugin-host/src/context/wasm/bump.rs index 054725956..6c97db69a 100644 --- a/feather/plugin-host/src/context/wasm/bump.rs +++ b/feather/plugin-host/src/context/wasm/bump.rs @@ -40,8 +40,6 @@ impl WasmBump { deallocate_function, chunks: Vec::new(), }; - let initial_chunk = this.allocate_chunk(None, None)?; - this.chunks.push(initial_chunk); Ok(this) } @@ -94,7 +92,6 @@ impl WasmBump { .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()); @@ -102,17 +99,13 @@ impl WasmBump { 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, @@ -124,7 +117,7 @@ impl WasmBump { /// 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() - 1) { + for chunk in self.chunks.drain(..self.chunks.len()) { self.deallocate_function.call( chunk.start, chunk.layout.size() as u32, @@ -132,13 +125,9 @@ impl WasmBump { )?; } - assert_eq!(self.chunks.len(), 1); - - // Reset the last chunk's data pointer. - let last_chunk = self.chunks.last_mut().unwrap(); - last_chunk - .ptr - .set(last_chunk.start + last_chunk.layout.size() as u32); + // Allocate initial chunk + let chunk = self.allocate_chunk(None, None)?; + self.chunks.push(chunk); Ok(()) } diff --git a/feather/plugin-host/src/host_calls.rs b/feather/plugin-host/src/host_calls.rs index bf90ccb81..91c0109f4 100644 --- a/feather/plugin-host/src/host_calls.rs +++ b/feather/plugin-host/src/host_calls.rs @@ -12,6 +12,7 @@ mod block; mod component; mod entity; mod entity_builder; +mod event; mod plugin_message; mod query; mod system; @@ -49,6 +50,7 @@ use block::*; use component::*; use entity::*; use entity_builder::*; +use event::*; use plugin_message::*; use query::*; use system::*; @@ -57,6 +59,8 @@ 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, diff --git a/feather/plugin-host/src/host_calls/block.rs b/feather/plugin-host/src/host_calls/block.rs index eb11dfca7..cc1f14b8b 100644 --- a/feather/plugin-host/src/host_calls/block.rs +++ b/feather/plugin-host/src/host_calls/block.rs @@ -1,3 +1,5 @@ +use std::convert::TryInto; + use feather_base::{BlockId, BlockPosition, ChunkPosition}; use feather_plugin_host_macros::host_function; use quill_common::block::BlockGetResult; @@ -7,7 +9,7 @@ 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); + 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)); @@ -16,7 +18,7 @@ pub fn block_get(cx: &PluginContext, x: i32, y: i32, z: i32) -> anyhow::Result anyhow::Result { - let pos = BlockPosition::new(x, y, z); + 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); diff --git a/feather/plugin-host/src/host_calls/component.rs b/feather/plugin-host/src/host_calls/component.rs index 85e33089f..b9722255d 100644 --- a/feather/plugin-host/src/host_calls/component.rs +++ b/feather/plugin-host/src/host_calls/component.rs @@ -43,26 +43,36 @@ pub fn entity_get_component( Ok(()) } -struct SetComponentVisitor<'a> { - cx: &'a PluginContext, - entity: Entity, - bytes_ptr: PluginPtr, - bytes_len: u32, +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 SetComponentVisitor<'a> { +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(); - let existing_component = game.ecs.get_mut::(self.entity); - if let Ok(mut existing_component) = existing_component { - *existing_component = component; - } else { - drop(existing_component); - let _ = game.ecs.insert(self.entity, component); + 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(()) @@ -79,11 +89,11 @@ pub fn entity_set_component( ) -> anyhow::Result<()> { let entity = Entity::from_bits(entity); let component = HostComponent::from_u32(component).context("invalid component")?; - let visitor = SetComponentVisitor { + let visitor = InsertComponentVisitor { cx, - entity, 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 index f6d443476..0224f6a0c 100644 --- a/feather/plugin-host/src/host_calls/entity.rs +++ b/feather/plugin-host/src/host_calls/entity.rs @@ -17,12 +17,11 @@ pub fn entity_send_message( message_ptr: PluginPtr, message_len: u32, ) -> anyhow::Result<()> { - let message = cx.read_string(message_ptr, message_len)?; + 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, Text::from(message)), - ); + let _ = cx + .game_mut() + .send_message(entity, ChatMessage::new(ChatKind::System, message)); Ok(()) } @@ -33,7 +32,7 @@ pub fn entity_send_title( title_ptr: PluginPtr, title_len: u32, ) -> anyhow::Result<()> { - let title = cx.read_bincode(title_ptr, title_len)?; + 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/event.rs b/feather/plugin-host/src/host_calls/event.rs new file mode 100644 index 000000000..649ffce65 --- /dev/null +++ b/feather/plugin-host/src/host_calls/event.rs @@ -0,0 +1,42 @@ +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/lib.rs b/feather/plugin-host/src/lib.rs index f7759abbb..4167b6457 100644 --- a/feather/plugin-host/src/lib.rs +++ b/feather/plugin-host/src/lib.rs @@ -43,6 +43,7 @@ const WASM_FEATURES: Features = Features { module_linking: false, multi_memory: false, memory64: false, + exceptions: true, }; /// Unique ID of a plugin. @@ -135,7 +136,7 @@ impl PluginManager { fn compiler_config() -> impl CompilerConfig { use wasmer::{Cranelift, CraneliftOptLevel}; let mut cfg = Cranelift::new(); - cfg.opt_level(CraneliftOptLevel::Speed).enable_simd(true); + cfg.opt_level(CraneliftOptLevel::Speed); cfg } diff --git a/feather/protocol/Cargo.toml b/feather/protocol/Cargo.toml index 0ecbd6c70..d919d83b4 100644 --- a/feather/protocol/Cargo.toml +++ b/feather/protocol/Cargo.toml @@ -5,22 +5,22 @@ authors = [ "caelunshun " ] edition = "2018" [dependencies] -aes = "0.5" +aes = "0.7" anyhow = "1" base = { path = "../base", package = "feather-base" } blocks = { path = "../blocks", package = "feather-blocks" } bytemuck = "1" byteorder = "1" bytes = "0.5" -cfb8 = "0.5" +cfb8 = "0.7" flate2 = "1" -generated = { path = "../generated", package = "feather-generated" } + hematite-nbt = { git = "https://github.com/PistonDevelopers/hematite_nbt" } num-traits = "0.2" parking_lot = "0.11" # Arc> compat +quill-common = { path = "../../quill/common" } serde = "1" thiserror = "1" uuid = "0.8" - -[features] -proxy = ["base/proxy"] \ No newline at end of file +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 aa892c0a8..d38217eb3 100644 --- a/feather/protocol/src/codec.rs +++ b/feather/protocol/src/codec.rs @@ -2,7 +2,7 @@ use crate::{io::VarInt, ProtocolVersion, Readable, Writeable}; use aes::Aes128; use bytes::BytesMut; use cfb8::{ - stream_cipher::{NewStreamCipher, StreamCipher}, + cipher::{AsyncStreamCipher, NewCipher}, Cfb8, }; use flate2::{ @@ -42,7 +42,7 @@ impl MinecraftCodec { /// Enables encryption with the provided key. pub fn enable_encryption(&mut self, key: CryptKey) { // yes, Mojang uses the same nonce for each packet. don't ask me why. - self.cryptor = Some(AesCfb8::new_var(&key, &key).expect("key size is invalid")); + self.cryptor = Some(AesCfb8::new_from_slices(&key, &key).expect("key size is invalid")); self.crypt_key = Some(key); } @@ -57,7 +57,7 @@ impl MinecraftCodec { MinecraftCodec { cryptor: self .crypt_key - .map(|key| AesCfb8::new_var(&key, &key).expect("key size is invalid")), + .map(|key| AesCfb8::new_from_slices(&key, &key).expect("key size is invalid")), crypt_key: self.crypt_key, compression: self.compression, received_buf: BytesMut::new(), diff --git a/feather/protocol/src/io.rs b/feather/protocol/src/io.rs index 7d91e60ae..4c9a51be6 100644 --- a/feather/protocol/src/io.rs +++ b/feather/protocol/src/io.rs @@ -4,11 +4,14 @@ use crate::{ProtocolVersion, Slot}; use anyhow::{anyhow, bail, Context}; use base::{ anvil::entity::ItemNbt, metadata::MetaEntry, BlockId, BlockPosition, Direction, EntityMetadata, - Gamemode, Item, ItemStack, + Gamemode, Item, ItemStackBuilder, ValidBlockPosition, }; use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; +use libcraft_items::InventorySlot::*; use num_traits::{FromPrimitive, ToPrimitive}; +use quill_common::components::PreviousGamemode; use serde::{de::DeserializeOwned, Serialize}; +use std::io::ErrorKind; use std::{ borrow::Cow, collections::BTreeMap, @@ -158,31 +161,11 @@ where pub struct VarInt(pub i32); impl Readable for VarInt { - fn read(buffer: &mut Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result + fn read(buffer: &mut Cursor<&[u8]>, _version: ProtocolVersion) -> anyhow::Result where Self: Sized, { - let mut num_read = 0; - let mut result = 0; - - loop { - let read = u8::read(buffer, version)?; - let value = i32::from(read & 0b0111_1111); - result |= value.overflowing_shl(7 * num_read).0; - - num_read += 1; - - if num_read > 5 { - bail!( - "VarInt too long (max length: 5, value read so far: {})", - result - ); - } - if read & 0b1000_0000 == 0 { - break; - } - } - Ok(VarInt(result)) + Self::read_from(buffer).map_err(Into::into) } } @@ -212,8 +195,9 @@ impl From for VarInt { } impl VarInt { - pub fn write_to(&self, mut writer: impl Write) -> io::Result<()> { + pub fn write_to(&self, mut writer: impl Write) -> io::Result { let mut x = self.0 as u32; + let mut i = 0; loop { let mut temp = (x & 0b0111_1111) as u8; x >>= 7; @@ -223,11 +207,35 @@ impl VarInt { writer.write_all(&[temp])?; + i += 1; if x == 0 { break; } } - Ok(()) + Ok(i) + } + pub fn read_from(mut reader: impl Read) -> io::Result { + let mut num_read = 0; + let mut result = 0; + + loop { + let read = reader.read_u8()?; + let value = i32::from(read & 0b0111_1111); + result |= value.overflowing_shl(7 * num_read).0; + + num_read += 1; + + if num_read > 5 { + return Err(io::Error::new( + ErrorKind::InvalidData, + "VarInt too long (max length: 5)", + )); + } + if read & 0b1000_0000 == 0 { + break; + } + } + Ok(VarInt(result)) } } @@ -553,28 +561,29 @@ impl Readable for Slot { let item = Item::from_id(item_id.try_into()?) .ok_or_else(|| anyhow!("unknown item ID {}", item_id))?; - Ok(Some(ItemStack { - item, - count, - damage: tags.map(|t| t.damage).flatten().map(|d| d as u32), - })) + // Todo fix: Panics if count is zero + Ok(Filled( + ItemStackBuilder::with_item(item) + .count(count) + .apply_damage(tags.and_then(|t| t.damage)) + .into(), + )) } else { - Ok(None) + Ok(Empty) } } } impl Writeable for Slot { fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { - self.is_some().write(buffer, version)?; + self.is_filled().write(buffer, version)?; - if let Some(stack) = self { - VarInt(stack.item.id() as i32).write(buffer, version)?; - (stack.count as u8).write(buffer, version)?; + if let Filled(stack) = self { + VarInt(stack.item().id() as i32).write(buffer, version)?; + (stack.count() as u8).write(buffer, version)?; let tags: ItemNbt = stack.into(); if tags != ItemNbt::default() { - dbg!(); Nbt(tags).write(buffer, version)?; } else { 0u8.write(buffer, version)?; // TAG_End @@ -631,9 +640,9 @@ fn read_meta_entry( f32::read(buffer, version)?, f32::read(buffer, version)?, ), - 9 => MetaEntry::Position(BlockPosition::read(buffer, version)?), + 9 => MetaEntry::Position(ValidBlockPosition::read(buffer, version)?), 10 => MetaEntry::OptPosition(if bool::read(buffer, version)? { - Some(BlockPosition::read(buffer, version)?) + Some(ValidBlockPosition::read(buffer, version)?) } else { None }), @@ -646,18 +655,28 @@ fn read_meta_entry( } else { None }), - 13 => MetaEntry::OptBlockId(if bool::read(buffer, version)? { - Some(VarInt::read(buffer, version)?.0) - } else { - None + 13 => MetaEntry::OptBlockId({ + let id = VarInt::read(buffer, version)?.0; + if id == 0 { + None + } else { + Some(id) + } }), 14 => MetaEntry::Nbt(Nbt::read(buffer, version)?.0), 15 => MetaEntry::Particle, - 16 => MetaEntry::VillagerData, - 17 => MetaEntry::OptVarInt(if bool::read(buffer, version)? { - Some(VarInt::read(buffer, version)?.0) - } else { - None + 16 => MetaEntry::VillagerData( + VarInt::read(buffer, version)?.0, + VarInt::read(buffer, version)?.0, + VarInt::read(buffer, version)?.0, + ), + 17 => MetaEntry::OptVarInt({ + let varint = VarInt::read(buffer, version)?.0; + if varint == 0 { + None + } else { + Some(varint - 1) + } }), 18 => MetaEntry::Pose(VarInt::read(buffer, version)?.0), x => bail!("invalid entity metadata entry ID {}", x), @@ -733,7 +752,11 @@ fn write_meta_entry( } MetaEntry::Nbt(val) => Nbt(val).write(buffer, version)?, MetaEntry::Particle => unimplemented!("entity metadata with particles"), - MetaEntry::VillagerData => unimplemented!("entity metadata with villager data"), + MetaEntry::VillagerData(villager_type, villager_profession, level) => { + VarInt(*villager_type).write(buffer, version)?; + VarInt(*villager_profession).write(buffer, version)?; + VarInt(*level).write(buffer, version)?; + } MetaEntry::OptVarInt(ox) => { if let Some(x) = ox { true.write(buffer, version)?; @@ -767,7 +790,7 @@ impl Writeable for Uuid { } } -impl Readable for BlockPosition { +impl Readable for ValidBlockPosition { fn read(buffer: &mut Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result where Self: Sized, @@ -778,15 +801,15 @@ impl Readable for BlockPosition { let y = (val & 0xFFF) as i32; let z = (val << 26 >> 38) as i32; - Ok(BlockPosition { x, y, z }) + Ok(BlockPosition { x, y, z }.try_into()?) } } -impl Writeable for BlockPosition { +impl Writeable for ValidBlockPosition { fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { - let val = ((self.x as u64 & 0x3FFFFFF) << 38) - | ((self.z as u64 & 0x3FFFFFF) << 12) - | (self.y as u64 & 0xFFF); + let val = ((self.x() as u64 & 0x3FFFFFF) << 38) + | ((self.z() as u64 & 0x3FFFFFF) << 12) + | (self.y() as u64 & 0xFFF); val.write(buffer, version)?; Ok(()) @@ -818,7 +841,11 @@ impl Readable for Angle { impl Writeable for Angle { fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { - let val = (self.0 / 360.0 * 256.0).round() as u8; + let temp = (256.0 / 360.0) * (self.0 % 360.0); + // Wrap negative values 'x' in the range [-256.0 to 0] to the + // correct angle in the range [0 to 256.0 ) by changing 'x' to + // x = 256.0 - x + let val = ((temp + 256.0) % 256.0) as u8; val.write(buffer, version)?; Ok(()) @@ -873,3 +900,18 @@ impl Writeable for Gamemode { Ok(()) } } + +impl Readable for PreviousGamemode { + fn read(buffer: &mut Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result + where + Self: Sized, + { + Ok(Self::from_id(i8::read(buffer, version)?)) + } +} + +impl Writeable for PreviousGamemode { + fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { + self.id().write(buffer, version) + } +} diff --git a/feather/protocol/src/lib.rs b/feather/protocol/src/lib.rs index 93bcf073a..411ac5ef8 100644 --- a/feather/protocol/src/lib.rs +++ b/feather/protocol/src/lib.rs @@ -1,14 +1,15 @@ use anyhow::anyhow; -use base::ItemStack; pub mod codec; pub mod io; pub mod packets; +use crate::codec::CompressionThreshold; #[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}, @@ -16,7 +17,7 @@ pub use packets::{ VariantOf, }; -pub type Slot = Option; +pub type Slot = InventorySlot; /// A protocol version. #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] @@ -62,6 +63,10 @@ impl ClientPacketCodec { self.state = state } + pub fn set_compression(&mut self, threshold: CompressionThreshold) { + self.codec.enable_compression(threshold) + } + /// Decodes a `ClientPacket` using the provided data. pub fn decode(&mut self, data: &[u8]) -> anyhow::Result> { self.codec.accept(data); @@ -120,6 +125,10 @@ impl ServerPacketCodec { self.state = state } + pub fn set_compression(&mut self, threshold: CompressionThreshold) { + self.codec.enable_compression(threshold) + } + /// Decodes a `ServerPacket` using the provided data. pub fn decode(&mut self, data: &[u8]) -> anyhow::Result> { self.codec.accept(data); @@ -159,6 +168,17 @@ pub enum ClientPacket { 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) @@ -191,6 +211,16 @@ pub enum ServerPacket { 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) diff --git a/feather/protocol/src/packets.rs b/feather/protocol/src/packets.rs index acd786f58..445051ef0 100644 --- a/feather/protocol/src/packets.rs +++ b/feather/protocol/src/packets.rs @@ -286,7 +286,7 @@ pub trait VariantOf { use crate::io::{Angle, LengthInferredVecU8, Nbt, ShortPrefixedVec, VarInt, VarIntPrefixedVec}; use crate::Slot; -use base::{BlockId, BlockPosition}; +use base::BlockId; use nbt::Blob; use uuid::Uuid; diff --git a/feather/protocol/src/packets/client/play.rs b/feather/protocol/src/packets/client/play.rs index 7f10754bd..211c71e6a 100644 --- a/feather/protocol/src/packets/client/play.rs +++ b/feather/protocol/src/packets/client/play.rs @@ -1,3 +1,5 @@ +use base::ValidBlockPosition; + use super::*; use crate::packets::server::Hand; @@ -8,7 +10,7 @@ packets! { QueryBlockNbt { transaction_id VarInt; - position BlockPosition; + position ValidBlockPosition; } QueryEntityNbt { @@ -104,9 +106,9 @@ def_enum! { 0 = Interact, 1 = Attack, 2 = InteractAt { - target_x f64; - target_y f64; - target_z f64; + target_x f32; + target_y f32; + target_z f32; hand VarInt; }, } @@ -114,7 +116,7 @@ def_enum! { packets! { GenerateStructure { - position BlockPosition; + position ValidBlockPosition; levels VarInt; keep_jigsaws bool; } @@ -192,7 +194,7 @@ packets! { PlayerDigging { status PlayerDiggingStatus; - position BlockPosition; + position ValidBlockPosition; face BlockFace; } } @@ -277,7 +279,7 @@ packets! { } UpdateCommandBlock { - position BlockPosition; + position ValidBlockPosition; command String; mode VarInt; flags u8; @@ -295,7 +297,7 @@ packets! { } UpdateJigsawBlock { - position BlockPosition; + position ValidBlockPosition; name String; target String; pool String; @@ -304,7 +306,7 @@ packets! { } UpdateStructureBlock { - position BlockPosition; + position ValidBlockPosition; action VarInt; mode VarInt; name String; @@ -323,7 +325,7 @@ packets! { } UpdateSign { - position BlockPosition; + position ValidBlockPosition; line_1 String; line_2 String; line_3 String; @@ -340,7 +342,7 @@ packets! { PlayerBlockPlacement { hand VarInt; - position BlockPosition; + position ValidBlockPosition; face BlockFace; cursor_position_x f32; cursor_position_y f32; diff --git a/feather/protocol/src/packets/server/play.rs b/feather/protocol/src/packets/server/play.rs index 88b89ab8b..e52266b58 100644 --- a/feather/protocol/src/packets/server/play.rs +++ b/feather/protocol/src/packets/server/play.rs @@ -1,19 +1,24 @@ -use anyhow::bail; -use base::{BlockState, EntityMetadata, Gamemode, ParticleKind, ProfileProperty}; +use std::io::Cursor; -use super::*; -use crate::{io::VarLong, Readable, Writeable}; +use anyhow::{anyhow, bail}; -mod chunk_data; +use base::{ + BlockState, EntityMetadata, Gamemode, ParticleKind, ProfileProperty, ValidBlockPosition, +}; pub use chunk_data::{ChunkData, ChunkDataKind}; - -mod update_light; +use quill_common::components::PreviousGamemode; 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; - uuid String; + uuid Uuid; kind VarInt; x f64; y f64; @@ -53,7 +58,7 @@ packets! { entity_id VarInt; entity_uuid Uuid; motive VarInt; - location BlockPosition; + location ValidBlockPosition; direction PaintingDirection; } } @@ -107,7 +112,7 @@ packets! { } AcknowledgePlayerDigging { - position BlockPosition; + position ValidBlockPosition; block BlockId; status PlayerDiggingStatus; successful bool; @@ -125,25 +130,25 @@ def_enum! { packets! { BlockBreakAnimation { entity_id VarInt; - position BlockPosition; + position ValidBlockPosition; destroy_stage u8; } BlockEntityData { - position BlockPosition; + position ValidBlockPosition; action u8; data Nbt; } BlockAction { - position BlockPosition; + position ValidBlockPosition; action_id u8; action_param u8; block_type VarInt; } BlockChange { - position BlockPosition; + position ValidBlockPosition; block BlockId; } @@ -304,6 +309,7 @@ packets! { EntityStatus { entity_id i32; + // status changes meaning depending on entity Type status i8; } @@ -330,8 +336,7 @@ packets! { } ChangeGameState { - reason u8; - value f32; + state_change GameStateChange; } OpenHorseWindow { @@ -346,18 +351,143 @@ packets! { Effect { effect_id i32; - position BlockPosition; + position ValidBlockPosition; data i32; disable_relative_volume bool; } } +#[derive(Debug, Clone)] +pub enum GameStateChange { + /// Sends block.minecraft.spawn.not_valid to client + SendNoRespawnBlockAvailableMessage, + EndRaining, + BeginRaining, + ChangeGamemode { + gamemode: Gamemode, + }, + /// Sent when the player enters an end portal from minecraft:the_end to minecraft:overworld + WinGame { + show_credits: bool, + }, + /// See https://help.minecraft.net/hc/en-us/articles/4408948974989-Minecraft-Java-Edition-Demo-Mode- + DemoEvent(DemoEventType), + /// Sent when any player is struck by an arrow. + ArrowHitAnyPlayer, + /// Seems to change both skycolor and lightning. + RainLevelChange { + /// Possible values are from 0 to 1 + rain_level: f32, + }, + /// Seems to change both skycolor and lightning (same as Rain level change, but doesn't start rain). + /// It also requires rain to render by notchian client. + ThunderLevelChange { + /// Possible values are from 0 to 1 + thunder_level: f32, + }, + PlayPufferfishStingSound, + PlayElderGuardianAppearance, + /// Send when doImmediateRespawn gamerule changes. + EnableRespawnScreen { + enable: bool, + }, +} + +#[derive(Debug, Clone)] +pub enum DemoEventType { + ShowWelcomeToDemoScreen, + TellMovementControls, + TellJumpControl, + TellInventoryControl, + TellDemoIsOver, +} + +impl Writeable for GameStateChange { + fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { + // Reason + match self { + GameStateChange::SendNoRespawnBlockAvailableMessage => 0u8, + GameStateChange::EndRaining => 1, + GameStateChange::BeginRaining => 2, + GameStateChange::ChangeGamemode { .. } => 3, + GameStateChange::WinGame { .. } => 4, + GameStateChange::DemoEvent(_) => 5, + GameStateChange::ArrowHitAnyPlayer => 6, + GameStateChange::RainLevelChange { .. } => 7, + GameStateChange::ThunderLevelChange { .. } => 8, + GameStateChange::PlayPufferfishStingSound => 9, + GameStateChange::PlayElderGuardianAppearance => 10, + GameStateChange::EnableRespawnScreen { .. } => 11, + } + .write(buffer, version)?; + + // Value + match self { + GameStateChange::ChangeGamemode { gamemode } => *gamemode as u8 as f32, + GameStateChange::WinGame { show_credits } => *show_credits as u8 as f32, + GameStateChange::DemoEvent(DemoEventType::ShowWelcomeToDemoScreen) => 0.0, + GameStateChange::DemoEvent(DemoEventType::TellMovementControls) => 101.0, + GameStateChange::DemoEvent(DemoEventType::TellJumpControl) => 102.0, + GameStateChange::DemoEvent(DemoEventType::TellInventoryControl) => 103.0, + GameStateChange::DemoEvent(DemoEventType::TellDemoIsOver) => 104.0, + GameStateChange::RainLevelChange { rain_level } => *rain_level, + GameStateChange::ThunderLevelChange { thunder_level } => *thunder_level, + GameStateChange::EnableRespawnScreen { enable } => !enable as u8 as f32, + _ => 0.0, + } + .write(buffer, version)?; + + Ok(()) + } +} + +impl Readable for GameStateChange { + fn read(buffer: &mut Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result + where + Self: Sized, + { + let reason = u8::read(buffer, version)?; + let value = f32::read(buffer, version)?; + Ok(match reason { + 0 => GameStateChange::SendNoRespawnBlockAvailableMessage, + 1 => GameStateChange::EndRaining, + 2 => GameStateChange::BeginRaining, + 3 => GameStateChange::ChangeGamemode { + gamemode: Gamemode::from_id(value as u8) + .ok_or(anyhow!("Unsupported gamemode ID"))?, + }, + 4 => GameStateChange::WinGame { + show_credits: value as u8 != 0, + }, + 5 => GameStateChange::DemoEvent(match value as u8 { + 0 => DemoEventType::ShowWelcomeToDemoScreen, + 101 => DemoEventType::TellMovementControls, + 102 => DemoEventType::TellJumpControl, + 103 => DemoEventType::TellInventoryControl, + 104 => DemoEventType::TellDemoIsOver, + other => bail!("Invalid demo event type: {}", other), + }), + 6 => GameStateChange::ArrowHitAnyPlayer, + 7 => GameStateChange::RainLevelChange { rain_level: value }, + 8 => GameStateChange::ThunderLevelChange { + thunder_level: value, + }, + 9 => GameStateChange::PlayPufferfishStingSound, + 10 => GameStateChange::PlayElderGuardianAppearance, + 11 => GameStateChange::EnableRespawnScreen { + enable: value as u8 == 0, + }, + other => bail!("Invalid game state change reason: {}", other), + }) + } +} + packets! { JoinGame { entity_id i32; is_hardcore bool; gamemode Gamemode; - previous_gamemode u8; // can be 255 if "not set," otherwise corresponds to a gamemode ID + previous_gamemode PreviousGamemode; // can be -1 if "not set", otherwise corresponds to a gamemode ID world_names VarIntPrefixedVec; dimension_codec Nbt; @@ -455,7 +585,7 @@ packets! { } OpenSignEditor { - position BlockPosition; + position ValidBlockPosition; } CraftRecipeResponse { @@ -869,7 +999,7 @@ def_enum! { z f64; old_diameter f64; new_diameter f64; - speed u64; + speed VarLong; portal_teeport_boundary VarInt; warning_time VarInt; warning_blocks VarInt; @@ -1080,7 +1210,7 @@ packets! { } SpawnPosition { - position BlockPosition; + position ValidBlockPosition; } TimeUpdate { diff --git a/feather/protocol/src/packets/server/play/chunk_data.rs b/feather/protocol/src/packets/server/play/chunk_data.rs index d6301c6d2..569ce0148 100644 --- a/feather/protocol/src/packets/server/play/chunk_data.rs +++ b/feather/protocol/src/packets/server/play/chunk_data.rs @@ -4,10 +4,9 @@ use std::{ sync::Arc, }; -use base::{Chunk, ChunkPosition, ChunkSection}; +use base::{Chunk, ChunkHandle, ChunkLock, ChunkPosition, ChunkSection}; use blocks::BlockId; -use generated::Biome; -use parking_lot::RwLock; +use libcraft_core::Biome; use serde::{ de, de::{SeqAccess, Visitor}, @@ -37,7 +36,7 @@ pub enum ChunkDataKind { #[derive(Clone)] pub struct ChunkData { /// The chunk to send. - pub chunk: Arc>, + pub chunk: ChunkHandle, /// Whether this packet will load a chunk on /// the client or overwrite an existing one. @@ -146,7 +145,6 @@ fn encode_section( Ok(()) } -#[cfg(feature = "proxy")] impl Readable for ChunkData { fn read(buffer: &mut std::io::Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result where @@ -198,7 +196,7 @@ impl Readable for ChunkData { for i in 0..16 { if (primary_bit_mask & (1 << i)) != 0 { - if chunk.section(i + 1).is_none() { + 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) { @@ -232,7 +230,7 @@ impl Readable for ChunkData { VarInt::read(buffer, version)?; // Block entities length, redundant for feather right now Ok(Self { - chunk: Arc::new(RwLock::new(chunk)), + chunk: Arc::new(ChunkLock::new(chunk, true)), kind: chunk_data_kind, }) } diff --git a/feather/protocol/src/packets/server/play/update_light.rs b/feather/protocol/src/packets/server/play/update_light.rs index 2bb045537..51ad2070d 100644 --- a/feather/protocol/src/packets/server/play/update_light.rs +++ b/feather/protocol/src/packets/server/play/update_light.rs @@ -1,13 +1,12 @@ use std::{fmt::Debug, sync::Arc}; -use base::{chunk::PackedArray, Chunk, ChunkPosition, ChunkSection}; -use parking_lot::RwLock; +use base::{chunk::PackedArray, Chunk, ChunkHandle, ChunkLock, ChunkPosition, ChunkSection}; use crate::{io::VarInt, ProtocolVersion, Readable, Writeable}; #[derive(Clone)] pub struct UpdateLight { - pub chunk: Arc>, + pub chunk: ChunkHandle, } impl Debug for UpdateLight { @@ -58,7 +57,6 @@ fn encode_light(light: &PackedArray, buffer: &mut Vec, version: ProtocolVers buffer.extend_from_slice(light_data); } -#[cfg(feature = "proxy")] impl Readable for UpdateLight { fn read( buffer: &mut std::io::Cursor<&[u8]>, @@ -88,7 +86,7 @@ impl Readable for UpdateLight { bytes.push(u8::read(buffer, version)?); } let mut bytes = bytes.iter(); - if chunk.section(i + 1).is_none() { + 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) { @@ -125,7 +123,7 @@ impl Readable for UpdateLight { } Ok(Self { - chunk: Arc::new(RwLock::new(chunk)), + chunk: Arc::new(ChunkLock::new(chunk, true)), }) } } diff --git a/feather/server/Cargo.toml b/feather/server/Cargo.toml index 03875a7ef..970560311 100644 --- a/feather/server/Cargo.toml +++ b/feather/server/Cargo.toml @@ -17,7 +17,7 @@ ahash = "0.7" anyhow = "1" base = { path = "../base", package = "feather-base" } base64 = "0.13" -chrono = "0.4" +time = { version = "0.3", features = ["local-offset", "formatting", "macros"] } colored = "2" common = { path = "../common", package = "feather-common" } crossbeam-utils = "0.8" @@ -29,16 +29,21 @@ futures-lite = "1" hematite-nbt = { git = "https://github.com/PistonDevelopers/hematite_nbt" } log = "0.4" md-5 = "0.9" -num-bigint = "0.3" +num-bigint = "0.4" +num-traits = "0.2" once_cell = "1" parking_lot = "0.11" plugin-host = { path = "../plugin-host", package = "feather-plugin-host" } protocol = { path = "../protocol", package = "feather-protocol" } quill-common = { path = "../../quill/common" } -rand = "0.7" + +rand = "0.8" ring = "0.16" -rsa = "0.3" -rsa-der = "0.2" + +rsa = "0.5" +rsa-der = "0.3" +base64ct = "1" + serde = { version = "1", features = [ "derive" ] } serde_json = "1" sha-1 = "0.9" @@ -47,8 +52,10 @@ toml = "0.5" ureq = { version = "2", features = [ "json" ] } utils = { path = "../utils", package = "feather-utils" } uuid = "0.8" -vec-arena = "1" +slab = "0.4" libcraft-core = { path = "../../libcraft/core" } +libcraft-items = { path = "../../libcraft/items" } +worldgen = { path = "../worldgen", package = "feather-worldgen" } [features] default = [ "plugin-cranelift" ] diff --git a/feather/server/config.toml b/feather/server/config.toml index ec6f7ae42..5e9efff7a 100644 --- a/feather/server/config.toml +++ b/feather/server/config.toml @@ -27,12 +27,11 @@ url = "" # Optional SHA1 hash of the resource pack file. hash = "" -# UNIMPLEMENTED [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 +# 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. diff --git a/feather/server/src/chunk_subscriptions.rs b/feather/server/src/chunk_subscriptions.rs index ccec7a780..fc7484a0f 100644 --- a/feather/server/src/chunk_subscriptions.rs +++ b/feather/server/src/chunk_subscriptions.rs @@ -1,11 +1,8 @@ use ahash::AHashMap; use base::ChunkPosition; -use common::{ - events::{EntityRemoveEvent, ViewUpdateEvent}, - view::View, - Game, -}; +use common::{events::ViewUpdateEvent, view::View, Game}; use ecs::{SysResult, SystemExecutor}; +use quill_common::events::EntityRemoveEvent; use utils::vec_remove_item; use crate::{ClientId, Server}; diff --git a/feather/server/src/client.rs b/feather/server/src/client.rs index 37cb253fa..f18af09a1 100644 --- a/feather/server/src/client.rs +++ b/feather/server/src/client.rs @@ -6,34 +6,44 @@ use std::{ }; use ahash::AHashSet; +use flume::{Receiver, Sender}; +use slab::Slab; +use uuid::Uuid; + use base::{ - BlockId, BlockPosition, Chunk, ChunkPosition, EntityKind, EntityMetadata, Gamemode, ItemStack, - Position, ProfileProperty, Text, + BlockId, ChunkHandle, ChunkPosition, EntityKind, EntityMetadata, Gamemode, Position, + ProfileProperty, Text, ValidBlockPosition, }; use common::{ chat::{ChatKind, ChatMessage}, Window, }; -use flume::{Receiver, Sender}; +use libcraft_items::InventorySlot; use packets::server::{Particle, SetSlot, SpawnLivingEntity, UpdateLight, WindowConfirmation}; -use parking_lot::RwLock; +use protocol::packets::server::{ + ChangeGameState, EntityPosition, EntityPositionAndRotation, EntityTeleport, GameStateChange, + HeldItemChange, PlayerAbilities, +}; use protocol::{ packets::{ self, server::{ AddPlayer, Animation, BlockChange, ChatPosition, ChunkData, ChunkDataKind, - DestroyEntities, Disconnect, EntityAnimation, EntityHeadLook, EntityTeleport, JoinGame, - KeepAlive, PlayerInfo, PlayerPositionAndLook, PluginMessage, SendEntityMetadata, - SpawnPlayer, Title, UnloadChunk, UpdateViewPosition, WindowItems, + DestroyEntities, Disconnect, EntityAnimation, EntityHeadLook, JoinGame, KeepAlive, + PlayerInfo, PlayerPositionAndLook, PluginMessage, SendEntityMetadata, SpawnPlayer, + Title, UnloadChunk, UpdateViewPosition, WindowItems, }, }, ClientPlayPacket, Nbt, ProtocolVersion, ServerPlayPacket, Writeable, }; -use quill_common::components::OnGround; -use uuid::Uuid; -use vec_arena::Arena; +use quill_common::components::{OnGround, PreviousGamemode}; -use crate::{initial_handler::NewPlayer, network_id_registry::NetworkId, Options}; +use crate::{ + entities::{PreviousOnGround, PreviousPosition}, + initial_handler::NewPlayer, + network_id_registry::NetworkId, + Options, +}; /// Max number of chunks to send to a client per tick. const MAX_CHUNKS_PER_TICK: usize = 10; @@ -45,7 +55,7 @@ pub struct ClientId(usize); /// Stores all `Client`s. #[derive(Default)] pub struct Clients { - arena: Arena, + slab: Slab, } impl Clients { @@ -54,19 +64,23 @@ impl Clients { } pub fn insert(&mut self, client: Client) -> ClientId { - ClientId(self.arena.insert(client)) + ClientId(self.slab.insert(client)) } pub fn remove(&mut self, id: ClientId) -> Option { - self.arena.remove(id.0) + self.slab.try_remove(id.0) } pub fn get(&self, id: ClientId) -> Option<&Client> { - self.arena.get(id.0) + self.slab.get(id.0) + } + + pub fn get_mut(&mut self, id: ClientId) -> Option<&mut Client> { + self.slab.get_mut(id.0) } pub fn iter(&self) -> impl Iterator + '_ { - self.arena.iter().map(|(_i, client)| client) + self.slab.iter().map(|(_i, client)| client) } } @@ -84,7 +98,7 @@ pub struct Client { teleport_id_counter: Cell, - network_id: NetworkId, + network_id: Option, sent_entities: RefCell>, knows_position: Cell, @@ -100,14 +114,14 @@ pub struct Client { } impl Client { - pub fn new(player: NewPlayer, options: Arc, network_id: NetworkId) -> Self { + pub fn new(player: NewPlayer, options: Arc) -> Self { Self { packets_to_send: player.packets_to_send, received_packets: player.received_packets, options, username: player.username, teleport_id_counter: Cell::new(0), - network_id, + network_id: None, profile: player.profile, uuid: player.uuid, sent_entities: RefCell::new(AHashSet::new()), @@ -131,7 +145,7 @@ impl Client { &self.profile } - pub fn network_id(&self) -> NetworkId { + pub fn network_id(&self) -> Option { self.network_id } @@ -179,7 +193,11 @@ impl Client { self.sent_entities.borrow().contains(&network_id) } - pub fn send_join_game(&self, gamemode: Gamemode) { + 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) { 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!( @@ -192,10 +210,10 @@ impl Client { .expect("dimension asset is malformed"); self.send_packet(JoinGame { - entity_id: self.network_id.0, + 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: 0, + previous_gamemode, world_names: vec!["world".to_owned()], dimension_codec: Nbt(dimension_codec), dimension: Nbt(dimension), @@ -257,7 +275,7 @@ impl Client { }); } - pub fn send_chunk(&self, chunk: &Arc>) { + pub fn send_chunk(&self, chunk: &ChunkHandle) { self.chunk_send_queue.borrow_mut().push_back(ChunkData { chunk: Arc::clone(chunk), kind: ChunkDataKind::LoadChunk, @@ -267,14 +285,14 @@ impl Client { .insert(chunk.read().position()); } - pub fn overwrite_chunk_sections(&self, chunk: &Arc>, sections: Vec) { + pub fn overwrite_chunk_sections(&self, chunk: &ChunkHandle, sections: Vec) { self.send_packet(ChunkData { chunk: Arc::clone(chunk), kind: ChunkDataKind::OverwriteChunk { sections }, }); } - pub fn send_block_change(&self, position: BlockPosition, new_block: BlockId) { + pub fn send_block_change(&self, position: ValidBlockPosition, new_block: BlockId) { self.send_packet(BlockChange { position, block: new_block, @@ -314,6 +332,10 @@ impl Client { self.send_packet(PlayerInfo::RemovePlayers(vec![uuid])); } + pub fn change_player_tablist_gamemode(&self, uuid: Uuid, gamemode: Gamemode) { + self.send_packet(PlayerInfo::UpdateGamemodes(vec![(uuid, gamemode)])); + } + pub fn unload_entity(&self, id: NetworkId) { log::trace!("Unloading {:?} on {}", id, self.username); self.sent_entities.borrow_mut().remove(&id); @@ -370,9 +392,11 @@ impl Client { &self, network_id: NetworkId, position: Position, + prev_position: PreviousPosition, on_ground: OnGround, + prev_on_ground: PreviousOnGround, ) { - if network_id == self.network_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. @@ -381,23 +405,50 @@ impl Client { } return; } - // Consider using the relative movement packets in the future. - // (Entity Teleport works fine, but the relative movement packets - // save bandwidth.) - 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.0, - }); - // Needed for head orientation - self.send_packet(EntityHeadLook { - entity_id: network_id.0, - head_yaw: position.yaw, - }); + + 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; + } + + 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, + }); + } } pub fn send_keepalive(&self) { @@ -406,7 +457,7 @@ impl Client { } pub fn send_entity_animation(&self, network_id: NetworkId, animation: Animation) { - if network_id == self.network_id { + if self.network_id == Some(network_id) { return; } self.send_packet(EntityAnimation { @@ -434,11 +485,15 @@ impl Client { self.send_packet(Title::Reset); } else { if let Some(main_title) = title.title { - self.send_packet(Title::SetTitle { text: main_title }); + self.send_packet(Title::SetTitle { + text: main_title.to_string(), + }); } if let Some(sub_title) = title.sub_title { - self.send_packet(Title::SetSubtitle { text: sub_title }) + self.send_packet(Title::SetSubtitle { + text: sub_title.to_string(), + }) } self.send_packet(Title::SetTimesAndDisplay { @@ -483,12 +538,12 @@ impl Client { self.send_packet(packet); } - pub fn set_slot(&self, slot: i16, item: Option) { + pub fn set_slot(&self, slot: i16, item: &InventorySlot) { log::trace!("Setting slot {} of {} to {:?}", slot, self.username, item); self.send_packet(SetSlot { window_id: 0, slot, - slot_data: item, + slot_data: item.clone(), }); } @@ -507,7 +562,7 @@ impl Client { }) } - pub fn set_cursor_slot(&self, item: Option) { + pub fn set_cursor_slot(&self, item: &InventorySlot) { log::trace!("Setting cursor slot of {} to {:?}", self.username, item); self.set_slot(-1, item); } @@ -521,6 +576,47 @@ impl Client { }); } + pub fn send_entity_metadata(&self, network_id: NetworkId, metadata: EntityMetadata) { + if self.network_id == Some(network_id) { + return; + } + self.send_packet(SendEntityMetadata { + entity_id: network_id.0, + entries: metadata, + }); + } + + pub fn send_abilities(&self, abilities: &base::anvil::player::PlayerAbilities) { + let mut bitfield = 0; + if *abilities.invulnerable { + bitfield |= 1 << 0; + } + if *abilities.is_flying { + bitfield |= 1 << 1; + } + if *abilities.may_fly { + bitfield |= 1 << 2; + } + if *abilities.instabreak { + bitfield |= 1 << 3; + } + self.send_packet(PlayerAbilities { + flags: bitfield, + flying_speed: *abilities.fly_speed, + fov_modifier: *abilities.walk_speed, + }); + } + + pub fn set_hotbar_slot(&self, slot: u8) { + self.send_packet(HeldItemChange { slot }); + } + + pub fn change_gamemode(&self, gamemode: Gamemode) { + self.send_packet(ChangeGameState { + state_change: GameStateChange::ChangeGamemode { gamemode }, + }) + } + fn register_entity(&self, network_id: NetworkId) { self.sent_entities.borrow_mut().insert(network_id); } diff --git a/feather/server/src/config.rs b/feather/server/src/config.rs index 8976caa1e..9111a037f 100644 --- a/feather/server/src/config.rs +++ b/feather/server/src/config.rs @@ -1,6 +1,6 @@ //! Loads an `Options` from a TOML config. -use std::{fs, net::Ipv4Addr, path::Path, str::FromStr}; +use std::{fs, net::IpAddr, path::Path, str::FromStr}; use anyhow::Context; use base::Gamemode; @@ -78,7 +78,7 @@ impl Config { #[derive(Debug, Deserialize)] pub struct Network { - pub address: Ipv4Addr, + pub address: IpAddr, pub port: u16, pub compression_threshold: i32, } diff --git a/feather/server/src/entities.rs b/feather/server/src/entities.rs index 25564d149..67015afda 100644 --- a/feather/server/src/entities.rs +++ b/feather/server/src/entities.rs @@ -1,6 +1,6 @@ use base::{EntityKind, Position}; use ecs::{EntityBuilder, EntityRef, SysResult}; -use quill_common::entity_init::EntityInit; +use quill_common::{components::OnGround, entity_init::EntityInit}; use uuid::Uuid; use crate::{Client, NetworkId}; @@ -15,17 +15,31 @@ impl SpawnPacketSender { } } -/// Stores the position of an entity on +/// Stores the [`Position`] of an entity on /// the previous tick. Used to determine /// when to send movement updates. #[derive(Copy, Clone, Debug)] pub struct PreviousPosition(pub Position); +/// 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) { if !builder.has::() { builder.add(NetworkId::new()); } - builder.add(PreviousPosition(*builder.get::().unwrap())); + + // 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(); + + builder + .add(PreviousPosition(prev_position)) + .add(PreviousOnGround(on_ground)); add_spawn_packet(builder, init); } diff --git a/feather/server/src/initial_handler.rs b/feather/server/src/initial_handler.rs index 56b52f5eb..adb72127b 100644 --- a/feather/server/src/initial_handler.rs +++ b/feather/server/src/initial_handler.rs @@ -19,7 +19,7 @@ use protocol::{ ServerLoginPacket, ServerPlayPacket, ServerStatusPacket, }; use rand::rngs::OsRng; -use rsa::{PaddingScheme, PublicKeyParts, RSAPrivateKey}; +use rsa::{PaddingScheme, PublicKeyParts, RsaPrivateKey}; use serde::{Deserialize, Serialize}; use sha1::Sha1; use std::convert::TryInto; @@ -205,8 +205,8 @@ fn offline_mode_uuid(username: &str) -> Uuid { const RSA_BITS: usize = 1024; /// Cached RSA key used by this server instance. -static RSA_KEY: Lazy = - Lazy::new(|| RSAPrivateKey::new(&mut OsRng, RSA_BITS).expect("failed to create RSA key")); +static RSA_KEY: Lazy = + Lazy::new(|| RsaPrivateKey::new(&mut OsRng, RSA_BITS).expect("failed to create RSA key")); static RSA_KEY_ENCODED: Lazy> = Lazy::new(|| { rsa_der::public_key_to_der(&RSA_KEY.n().to_bytes_be(), &RSA_KEY.e().to_bytes_be()) }); @@ -281,7 +281,7 @@ fn compute_server_hash(shared_secret: CryptKey) -> String { hasher.update(b""); // server ID - always empty hasher.update(&shared_secret); hasher.update(&*RSA_KEY_ENCODED); - hexdigest(&hasher.finalize().as_slice()) + hexdigest(hasher.finalize().as_slice()) } // Non-standard hex digest used by Minecraft. diff --git a/feather/server/src/initial_handler/proxy/bungeecord.rs b/feather/server/src/initial_handler/proxy/bungeecord.rs index 70bccc0a8..4e576a10a 100644 --- a/feather/server/src/initial_handler/proxy/bungeecord.rs +++ b/feather/server/src/initial_handler/proxy/bungeecord.rs @@ -1,3 +1,4 @@ +#![allow(clippy::octal_escapes)] use std::str::FromStr; use anyhow::bail; @@ -50,7 +51,7 @@ mod tests { fn extract_bungeecord_data_normal() { let handshake = Handshake { protocol_version: PROTOCOL_VERSION, - server_address: "192.168.1.87\0192.168.1.67\0905c7e4fb96b45139645d123225575e2\0[{\"name\":\"textures\",\"value\":\"textures_value\",\"signature\":\"textures_signature\"}]".to_string(), + server_address: "192.168.1.87\x00192.168.1.67\x00905c7e4fb96b45139645d123225575e2\x00[{\"name\":\"textures\",\"value\":\"textures_value\",\"signature\":\"textures_signature\"}]".to_string(), server_port: 25565, next_state: HandshakeState::Login, }; @@ -74,7 +75,7 @@ mod tests { fn extract_bungeecord_data_too_short() { let handshake = Handshake { protocol_version: PROTOCOL_VERSION, - server_address: "192.168.1.87\0192.168.1.67\0905c7e4fb96b45139645d123225575e2" + server_address: "192.168.1.87\x00192.168.1.67\x00905c7e4fb96b45139645d123225575e2" .to_string(), server_port: 25565, next_state: HandshakeState::Login, @@ -87,8 +88,9 @@ mod tests { fn extract_bungeecord_data_too_long() { let handshake = Handshake { protocol_version: PROTOCOL_VERSION, - server_address: "192.168.1.87\0192.168.1.67\0905c7e4fb96b45139645d123225575e2\0a\0b" - .to_string(), + server_address: + "192.168.1.87\x00192.168.1.67\x00905c7e4fb96b45139645d123225575e2\x00a\x00b" + .to_string(), server_port: 25565, next_state: HandshakeState::Login, }; @@ -100,7 +102,7 @@ mod tests { fn extract_bungeecord_data_localhost_host_ip() { let handshake = Handshake { protocol_version: PROTOCOL_VERSION, - server_address: "localhost\0192.168.1.67\0905c7e4fb96b45139645d123225575e2\0[{\"name\":\"textures\",\"value\":\"textures_value\",\"signature\":\"textures_signature\"}]".to_string(), + server_address: "localhost\x00192.168.1.67\x00905c7e4fb96b45139645d123225575e2\x00[{\"name\":\"textures\",\"value\":\"textures_value\",\"signature\":\"textures_signature\"}]".to_string(), server_port: 25565, next_state: HandshakeState::Login, }; @@ -124,7 +126,7 @@ mod tests { fn extract_bungeecord_data_localhost_client_ip() { let handshake = Handshake { protocol_version: PROTOCOL_VERSION, - server_address: "192.168.1.87\0localhost\0905c7e4fb96b45139645d123225575e2\0[{\"name\":\"textures\",\"value\":\"textures_value\",\"signature\":\"textures_signature\"}]".to_string(), + server_address: "192.168.1.87\x00localhost\x00905c7e4fb96b45139645d123225575e2\x00[{\"name\":\"textures\",\"value\":\"textures_value\",\"signature\":\"textures_signature\"}]".to_string(), server_port: 25565, next_state: HandshakeState::Login, }; @@ -148,7 +150,7 @@ mod tests { fn extract_bungeecord_data_invalid_uuid() { let handshake = Handshake { protocol_version: PROTOCOL_VERSION, - server_address: "192.168.1.87\0192.168.1.67\005c7e4fb9675e2\0[{\"name\":\"textures\",\"value\":\"textures_value\",\"signature\":\"textures_signature\"}]".to_string(), + server_address: "192.168.1.87\x00192.168.1.67\x0005c7e4fb9675e2\x00[{\"name\":\"textures\",\"value\":\"textures_value\",\"signature\":\"textures_signature\"}]".to_string(), server_port: 25565, next_state: HandshakeState::Login, }; @@ -160,7 +162,7 @@ mod tests { fn extract_bungeecord_data_invalid_properties() { let handshake = Handshake { protocol_version: PROTOCOL_VERSION, - server_address: "192.168.1.87\0192.168.1.67\0905c7e4fb96b45139645d123225575e2\0[{\"name\":\"textures\",\"value\":\"textures_value\",\"sinature\":\"textures_signature\"}]".to_string(), + server_address: "192.168.1.87\x00192.168.1.67\x00905c7e4fb96b45139645d123225575e2\x00[{\"name\":\"textures\",\"value\":\"textures_value\",\"sinature\":\"textures_signature\"}]".to_string(), server_port: 25565, next_state: HandshakeState::Login, }; diff --git a/feather/server/src/lib.rs b/feather/server/src/lib.rs index 2d55cd4fc..c1aec55dc 100644 --- a/feather/server/src/lib.rs +++ b/feather/server/src/lib.rs @@ -98,6 +98,9 @@ impl Server { 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); } @@ -112,15 +115,9 @@ impl Server { } } - /// Allocates a `NetworkId` for an entity. - pub fn create_network_id(&mut self) -> NetworkId { - NetworkId::new() - } - fn create_client(&mut self, player: NewPlayer) -> ClientId { log::debug!("Creating client for {}", player.username); - let network_id = self.create_network_id(); - let client = Client::new(player, Arc::clone(&self.options), network_id); + let client = Client::new(player, Arc::clone(&self.options)); self.clients.insert(client) } diff --git a/feather/server/src/logging.rs b/feather/server/src/logging.rs index ecae08af2..0dd93e45a 100644 --- a/feather/server/src/logging.rs +++ b/feather/server/src/logging.rs @@ -1,5 +1,7 @@ use colored::Colorize; use log::{Level, LevelFilter}; +use time::macros::format_description; +use time::OffsetDateTime; pub fn init(level: LevelFilter) { fern::Dispatch::new() @@ -16,9 +18,18 @@ pub fn init(level: LevelFilter) { } else { record.module_path().unwrap_or_default() }; + + let datetime: OffsetDateTime = match OffsetDateTime::now_local() { + Ok(x) => x, + Err(_) => OffsetDateTime::now_utc(), + }; out.finish(format_args!( "{} {:<5} [{}] {}", - chrono::Local::now().format("%Y-%m-%d %H:%M:%S,%3f"), + datetime + .format(format_description!( + "[year]-[month]-[day] [hour]:[minute]:[second],[subsecond digits:3]" + )) + .unwrap(), level_string, target, message, @@ -27,6 +38,9 @@ pub fn init(level: LevelFilter) { .level(level) // cranelift_codegen spams debug-level logs .level_for("cranelift_codegen", LevelFilter::Info) + .level_for("regalloc", LevelFilter::Off) + .level_for("wasmer_wasi::syscalls", LevelFilter::Info) + .level_for("wasmer_compiler_cranelift::translator", LevelFilter::Warn) .chain(std::io::stdout()) .apply() .unwrap(); diff --git a/feather/server/src/main.rs b/feather/server/src/main.rs index 81a103e9f..c3bf7ea16 100644 --- a/feather/server/src/main.rs +++ b/feather/server/src/main.rs @@ -1,18 +1,16 @@ -use std::{cell::RefCell, rc::Rc}; +use std::{cell::RefCell, rc::Rc, sync::Arc}; use anyhow::Context; -use common::{ - world_source::{flat::FlatWorldSource, region::RegionWorldSource, WorldSource}, - Game, TickLoop, World, -}; +use base::anvil::level::SuperflatGeneratorOptions; +use common::{Game, TickLoop, World}; use ecs::SystemExecutor; -use feather_server::Server; +use feather_server::{config::Config, Server}; use plugin_host::PluginManager; +use worldgen::{ComposableGenerator, SuperflatWorldGenerator, VoidWorldGenerator, WorldGenerator}; mod logging; const PLUGINS_DIRECTORY: &str = "plugins"; -const WORLD_DIRECTORY: &str = "world"; const CONFIG_PATH: &str = "config.toml"; #[tokio::main] @@ -31,17 +29,17 @@ async fn main() -> anyhow::Result<()> { let options = config.to_options(); let server = Server::bind(options).await?; - let game = init_game(server)?; + let game = init_game(server, &config)?; run(game); Ok(()) } -fn init_game(server: Server) -> anyhow::Result { +fn init_game(server: Server, config: &Config) -> anyhow::Result { let mut game = Game::new(); init_systems(&mut game, server); - init_world_source(&mut game); + init_world_source(&mut game, config); init_plugin_manager(&mut game)?; Ok(game) } @@ -60,14 +58,22 @@ fn init_systems(game: &mut Game, server: Server) { game.system_executor = Rc::new(RefCell::new(systems)); } -fn init_world_source(game: &mut Game) { +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 world_source = - RegionWorldSource::new(WORLD_DIRECTORY).with_fallback(FlatWorldSource::new()); - game.world = World::with_source(world_source); + + 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<()> { diff --git a/feather/server/src/packet_handlers.rs b/feather/server/src/packet_handlers.rs index 4a6035037..b0452c96a 100644 --- a/feather/server/src/packet_handlers.rs +++ b/feather/server/src/packet_handlers.rs @@ -47,10 +47,12 @@ pub fn handle_packet( ClientPlayPacket::ChatMessage(packet) => handle_chat_message(game, player, packet), - ClientPlayPacket::PlayerDigging(packet) => handle_player_digging(game, packet, player_id), + ClientPlayPacket::PlayerDigging(packet) => { + handle_player_digging(game, server, packet, player_id) + } ClientPlayPacket::CreativeInventoryAction(packet) => { - inventory::handle_creative_inventory_action(player, packet) + inventory::handle_creative_inventory_action(player, packet, server) } ClientPlayPacket::ClickWindow(packet) => { inventory::handle_click_window(server, player, packet) diff --git a/feather/server/src/packet_handlers/entity_action.rs b/feather/server/src/packet_handlers/entity_action.rs index 281906da4..8de3210c2 100644 --- a/feather/server/src/packet_handlers/entity_action.rs +++ b/feather/server/src/packet_handlers/entity_action.rs @@ -1,7 +1,10 @@ use common::Game; use ecs::{Entity, SysResult}; use protocol::packets::client::{EntityAction, EntityActionKind}; -use quill_common::{components::Sneaking, events::SneakEvent}; +use quill_common::{ + components::{Sneaking, Sprinting}, + events::{SneakEvent, SprintEvent}, +}; /// From [wiki](https://wiki.vg/Protocol#Entity_Action) /// Sent by the client to indicate that it has performed certain actions: @@ -35,11 +38,14 @@ pub fn handle_entity_action(game: &mut Game, player: Entity, packet: EntityActio // and all players are kicked out of the bed. We have to seperatly send out // a notice that bed state might have changed. } - EntityActionKind::StartSprinting => { - //TODO issue #423 - } - EntityActionKind::StopSprinting => { - //TODO issue #423 + EntityActionKind::StartSprinting | EntityActionKind::StopSprinting => { + let start_sprinting = matches!(packet.action_id, EntityActionKind::StartSprinting); + let is_sprinting = game.ecs.get_mut::(player)?.0; + if is_sprinting != start_sprinting { + game.ecs + .insert_entity_event(player, SprintEvent::new(start_sprinting))?; + game.ecs.get_mut::(player)?.0 = start_sprinting; + } } EntityActionKind::StartHorseJump => { //TODO issue #423 diff --git a/feather/server/src/packet_handlers/interaction.rs b/feather/server/src/packet_handlers/interaction.rs index 369fce91c..1c6f69d9c 100644 --- a/feather/server/src/packet_handlers/interaction.rs +++ b/feather/server/src/packet_handlers/interaction.rs @@ -1,7 +1,8 @@ use crate::{ClientId, NetworkId, Server}; +use base::inventory::{SLOT_HOTBAR_OFFSET, SLOT_OFFHAND}; use common::entities::player::HotbarSlot; use common::interactable::InteractableRegistry; -use common::Game; +use common::{Game, Window}; use ecs::{Entity, EntityRef, SysResult}; use libcraft_core::{BlockFace as LibcraftBlockFace, Hand}; use libcraft_core::{InteractionType, Vec3f}; @@ -80,7 +81,7 @@ pub fn handle_player_block_placement( // Handle this as a block interaction let event = BlockInteractEvent { hand, - location: packet.position, + location: packet.position.into(), face, cursor_position, inside_block: packet.inside_block, @@ -91,7 +92,7 @@ pub fn handle_player_block_placement( // Handle this as a block placement let event = BlockPlacementEvent { hand, - location: packet.position, + location: packet.position.into(), face, cursor_position, inside_block: packet.inside_block, @@ -110,13 +111,40 @@ pub fn handle_player_block_placement( /// * Shooting arrows. /// * Eating. /// * Swapping items between the main and off hand. -pub fn handle_player_digging(game: &mut Game, packet: PlayerDigging, _player: Entity) -> SysResult { +pub fn handle_player_digging( + game: &mut Game, + server: &mut Server, + packet: PlayerDigging, + player: Entity, +) -> SysResult { log::trace!("Got player digging with status {:?}", packet.status); match packet.status { PlayerDiggingStatus::StartDigging | PlayerDiggingStatus::CancelDigging => { game.break_block(packet.position); Ok(()) } + PlayerDiggingStatus::SwapItemInHand => { + let window = game.ecs.get::(player)?; + + let hotbar_slot = game.ecs.get::(player)?.get(); + + let hotbar_index = SLOT_HOTBAR_OFFSET + hotbar_slot; + let offhand_index = SLOT_OFFHAND; + + { + let mut hotbar_item = window.item(hotbar_index)?; + let mut offhand_item = window.item(offhand_index)?; + + std::mem::swap(&mut *hotbar_item, &mut *offhand_item); + } + + let client_id = *game.ecs.get::(player)?; + let client = server.clients.get(client_id).unwrap(); + + client.send_window_items(&window); + + Ok(()) + } _ => Ok(()), } } diff --git a/feather/server/src/packet_handlers/inventory.rs b/feather/server/src/packet_handlers/inventory.rs index c0e060244..48a397197 100644 --- a/feather/server/src/packet_handlers/inventory.rs +++ b/feather/server/src/packet_handlers/inventory.rs @@ -9,6 +9,7 @@ use crate::{ClientId, Server}; pub fn handle_creative_inventory_action( player: EntityRef, packet: CreativeInventoryAction, + server: &mut Server, ) -> SysResult { if *player.get::()? != Gamemode::Creative { bail!("cannot use Creative Inventory Action outside of creative mode"); @@ -23,6 +24,12 @@ 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(()) @@ -45,7 +52,7 @@ pub fn handle_click_window( let window = player.get::()?; if packet.slot >= 0 { - client.set_slot(packet.slot, window.item(packet.slot as usize)?.clone()); + client.set_slot(packet.slot, &*window.item(packet.slot as usize)?); } client.set_cursor_slot(window.cursor_item()); @@ -75,88 +82,3 @@ fn _handle_click_window(player: &EntityRef, packet: &ClickWindow) -> SysResult { Ok(()) } - -#[cfg(test)] -mod tests { - use base::{Inventory, Item, ItemStack}; - use common::Game; - - use super::*; - - #[test] - fn creative_inventory_action_survival_mode() { - let mut game = Game::new(); - let entity = game.ecs.spawn((Gamemode::Survival, player_window())); - let player = game.ecs.entity(entity).unwrap(); - - let packet = CreativeInventoryAction { - slot: 10, - clicked_item: Some(ItemStack::new(Item::Diamond, 64)), - }; - handle_creative_inventory_action(player, packet).unwrap_err(); - - assert!(game - .ecs - .get::(entity) - .unwrap() - .item(10) - .unwrap() - .is_none()); - } - - #[test] - fn creative_inventory_action_non_player_window() { - let mut game = Game::new(); - let entity = game.ecs.spawn(( - Window::new(BackingWindow::Generic9x3 { - player: Inventory::player(), - block: Inventory::chest(), - }), - Gamemode::Creative, - )); - let player = game.ecs.entity(entity).unwrap(); - - let packet = CreativeInventoryAction { - slot: 5, - clicked_item: Some(ItemStack::new(Item::Diamond, 64)), - }; - handle_creative_inventory_action(player, packet).unwrap_err(); - - assert!(game - .ecs - .get::(entity) - .unwrap() - .item(5) - .unwrap() - .is_none()); - } - - #[test] - fn creative_inventory_action() { - let mut game = Game::new(); - let entity = game.ecs.spawn((Gamemode::Creative, player_window())); - let player = game.ecs.entity(entity).unwrap(); - - let packet = CreativeInventoryAction { - slot: 5, - clicked_item: Some(ItemStack::new(Item::Diamond, 64)), - }; - handle_creative_inventory_action(player, packet).unwrap(); - - assert_eq!( - game.ecs - .get::(entity) - .unwrap() - .item(5) - .unwrap() - .clone(), - Some(ItemStack::new(Item::Diamond, 64)) - ); - } - - fn player_window() -> Window { - Window::new(BackingWindow::Player { - player: Inventory::player(), - }) - } -} diff --git a/feather/server/src/systems.rs b/feather/server/src/systems.rs index ee7e85b37..e364dc591 100644 --- a/feather/server/src/systems.rs +++ b/feather/server/src/systems.rs @@ -3,6 +3,7 @@ mod block; mod chat; mod entity; +mod gamemode; mod particle; mod player_join; mod player_leave; @@ -36,6 +37,7 @@ pub fn register(server: Server, game: &mut Game, systems: &mut SystemExecutor().add_system(tick_clients); } diff --git a/feather/server/src/systems/entity.rs b/feather/server/src/systems/entity.rs index 80a2b3bf4..49aed542f 100644 --- a/feather/server/src/systems/entity.rs +++ b/feather/server/src/systems/entity.rs @@ -1,33 +1,109 @@ //! Sends entity-related packets to clients. //! Spawn packets, position updates, equipment, animations, etc. -use base::Position; +use base::{ + metadata::{EntityBitMask, Pose, META_INDEX_ENTITY_BITMASK, META_INDEX_POSE}, + EntityMetadata, Position, +}; use common::Game; use ecs::{SysResult, SystemExecutor}; -use quill_common::components::OnGround; +use quill_common::{ + components::{OnGround, Sprinting}, + events::{SneakEvent, SprintEvent}, +}; -use crate::{entities::PreviousPosition, NetworkId, Server}; +use crate::{ + entities::{PreviousOnGround, PreviousPosition}, + NetworkId, Server, +}; mod spawn_packet; pub fn register(game: &mut Game, systems: &mut SystemExecutor) { spawn_packet::register(game, systems); - systems.group::().add_system(send_entity_movement); + systems + .group::() + .add_system(send_entity_movement) + .add_system(send_entity_sneak_metadata) + .add_system(send_entity_sprint_metadata); } /// Sends entity movement packets. fn send_entity_movement(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (&position, prev_position, &on_ground, &network_id)) in game + for (_, (&position, prev_position, &on_ground, &network_id, prev_on_ground)) in game .ecs - .query::<(&Position, &mut PreviousPosition, &OnGround, &NetworkId)>() + .query::<( + &Position, + &mut PreviousPosition, + &OnGround, + &NetworkId, + &mut PreviousOnGround, + )>() .iter() { if position != prev_position.0 { server.broadcast_nearby_with(position, |client| { - client.update_entity_position(network_id, position, on_ground); + client.update_entity_position( + network_id, + position, + *prev_position, + on_ground, + *prev_on_ground, + ); }); prev_position.0 = position; } + if on_ground != prev_on_ground.0 { + prev_on_ground.0 = on_ground; + } + } + Ok(()) +} + +/// 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 + .ecs + .query::<(&Position, &SneakEvent, &Sprinting, &NetworkId)>() + .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::SPRINTING, is_sprinting.0); + metadata.set(META_INDEX_ENTITY_BITMASK, bit_mask.bits()); + + if 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()); + }); + } + Ok(()) +} + +/// 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 + .ecs + .query::<(&Position, &SprintEvent, &NetworkId)>() + .iter() + { + let mut metadata = EntityMetadata::entity_base(); + let mut bit_mask = EntityBitMask::empty(); + + bit_mask.set(EntityBitMask::SPRINTING, 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()); + }); } Ok(()) } diff --git a/feather/server/src/systems/entity/spawn_packet.rs b/feather/server/src/systems/entity/spawn_packet.rs index fcb4ea03a..23cb0b523 100644 --- a/feather/server/src/systems/entity/spawn_packet.rs +++ b/feather/server/src/systems/entity/spawn_packet.rs @@ -2,10 +2,11 @@ use ahash::AHashSet; use anyhow::Context; use base::Position; use common::{ - events::{ChunkCrossEvent, EntityCreateEvent, EntityRemoveEvent, ViewUpdateEvent}, + events::{ChunkCrossEvent, ViewUpdateEvent}, Game, }; use ecs::{SysResult, SystemExecutor}; +use quill_common::events::{EntityCreateEvent, EntityRemoveEvent}; use crate::{entities::SpawnPacketSender, ClientId, NetworkId, Server}; diff --git a/feather/server/src/systems/gamemode.rs b/feather/server/src/systems/gamemode.rs new file mode 100644 index 000000000..8c9581bd1 --- /dev/null +++ b/feather/server/src/systems/gamemode.rs @@ -0,0 +1,194 @@ +use base::anvil::player::PlayerAbilities; +use base::Gamemode; +use common::Game; +use ecs::{SysResult, SystemExecutor}; +use quill_common::components::{ + CanBuild, CanCreativeFly, CreativeFlying, CreativeFlyingSpeed, Instabreak, Invulnerable, + PreviousGamemode, WalkSpeed, +}; +use quill_common::events::{ + BuildingAbilityEvent, CreativeFlyingEvent, FlyingAbilityEvent, GamemodeEvent, InstabreakEvent, + InvulnerabilityEvent, +}; + +use crate::{ClientId, Server}; + +pub fn register(systems: &mut SystemExecutor) { + systems.group::().add_system(gamemode_change); +} + +fn gamemode_change(game: &mut Game, server: &mut Server) -> SysResult { + let mut may_fly_changes = Vec::new(); + let mut fly_changes = Vec::new(); + let mut instabreak_changes = Vec::new(); + let mut build_changes = Vec::new(); + let mut invulnerability_changes = Vec::new(); + for ( + entity, + ( + event, + &client_id, + &walk_speed, + &fly_speed, + mut may_fly, + mut is_flying, + mut instabreak, + mut may_build, + mut invulnerable, + gamemode, + prev_gamemode, + ), + ) in game + .ecs + .query::<( + &GamemodeEvent, + &ClientId, + &WalkSpeed, + &CreativeFlyingSpeed, + &mut CanCreativeFly, + &mut CreativeFlying, + &mut Instabreak, + &mut CanBuild, + &mut Invulnerable, + &mut Gamemode, + &mut PreviousGamemode, + )>() + .iter() + { + if **event == *gamemode { + continue; + } + *prev_gamemode = PreviousGamemode(Some(*gamemode)); + *gamemode = **event; + match gamemode { + Gamemode::Creative => { + if !**instabreak { + instabreak_changes.push((entity, true)); + instabreak.0 = true; + } + if !**may_fly { + may_fly_changes.push((entity, true)); + may_fly.0 = true; + } + if !**may_build { + build_changes.push((entity, true)); + may_build.0 = true; + } + if !**invulnerable { + invulnerability_changes.push((entity, true)); + invulnerable.0 = true; + } + } + Gamemode::Spectator => { + if !**is_flying { + fly_changes.push((entity, true)); + is_flying.0 = true; + } + if **instabreak { + instabreak_changes.push((entity, false)); + instabreak.0 = false; + } + if !**may_fly { + may_fly_changes.push((entity, true)); + may_fly.0 = true; + } + if **may_build { + build_changes.push((entity, false)); + may_build.0 = false; + } + if !**invulnerable { + invulnerability_changes.push((entity, true)); + invulnerable.0 = true; + } + } + Gamemode::Survival => { + if **is_flying { + fly_changes.push((entity, false)); + is_flying.0 = false; + } + if **instabreak { + instabreak_changes.push((entity, false)); + instabreak.0 = false; + } + if **may_fly { + may_fly_changes.push((entity, false)); + may_fly.0 = false; + } + if !**may_build { + build_changes.push((entity, true)); + may_build.0 = true; + } + if **invulnerable { + invulnerability_changes.push((entity, false)); + invulnerable.0 = false; + } + } + Gamemode::Adventure => { + if **is_flying { + fly_changes.push((entity, false)); + is_flying.0 = false; + } + if **instabreak { + instabreak_changes.push((entity, false)); + instabreak.0 = false; + } + if **may_fly { + may_fly_changes.push((entity, false)); + may_fly.0 = false; + } + if **may_build { + build_changes.push((entity, false)); + may_build.0 = false; + } + if **invulnerable { + invulnerability_changes.push((entity, false)); + invulnerable.0 = false; + } + } + } + server + .clients + .get(client_id) + .unwrap() + .change_gamemode(**event); + server + .clients + .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, + }); + } + for (entity, flying) in fly_changes { + game.ecs + .insert_entity_event(entity, CreativeFlyingEvent::new(flying)) + .unwrap(); + } + for (entity, instabreak) in instabreak_changes { + game.ecs + .insert_entity_event(entity, InstabreakEvent(instabreak)) + .unwrap(); + } + for (entity, may_fly) in may_fly_changes { + game.ecs + .insert_entity_event(entity, FlyingAbilityEvent(may_fly)) + .unwrap(); + } + for (entity, build) in build_changes { + game.ecs + .insert_entity_event(entity, BuildingAbilityEvent(build)) + .unwrap(); + } + for (entity, invulnerable) in invulnerability_changes { + game.ecs + .insert_entity_event(entity, InvulnerabilityEvent(invulnerable)) + .unwrap(); + } + Ok(()) +} diff --git a/feather/server/src/systems/player_join.rs b/feather/server/src/systems/player_join.rs index a6d9d242e..f8e01b195 100644 --- a/feather/server/src/systems/player_join.rs +++ b/feather/server/src/systems/player_join.rs @@ -1,4 +1,8 @@ -use base::{Inventory, Position, Text}; +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, @@ -7,9 +11,14 @@ use common::{ ChatBox, Game, Window, }; use ecs::{SysResult, SystemExecutor}; +use quill_common::components::{ + CanBuild, CanCreativeFly, CreativeFlying, CreativeFlyingSpeed, Health, Instabreak, + Invulnerable, PreviousGamemode, WalkSpeed, +}; +use quill_common::events::GamemodeEvent; use quill_common::{components::Name, entity_init::EntityInit}; -use crate::{ClientId, Server}; +use crate::{ClientId, NetworkId, Server}; pub fn register(systems: &mut SystemExecutor) { systems.group::().add_system(poll_new_players); @@ -25,34 +34,105 @@ 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 client = server.clients.get(client_id).unwrap(); - client.send_join_game(server.options.default_gamemode); + 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(); - let mut builder = game.create_entity_builder(Position::default(), EntityInit::Player); + // Abilities + let abilities = player_abilities_or_default( + player_data.as_ref().map(|data| data.abilities.clone()).ok(), + gamemode, + ); + client.send_abilities(&abilities); + + 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 inventory = Inventory::player(); let window = Window::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.network_id()) .add(client_id) .add(View::new( Position::default().chunk(), server.options.view_distance, )) - .add(server.options.default_gamemode) + .add(gamemode) + .add(previous_gamemode) .add(Name::new(client.username())) .add(client.uuid()) .add(client.profile().to_vec()) .add(ChatBox::new(ChatPreference::All)) .add(inventory) .add(window) - .add(HotbarSlot::default()); + .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); + + builder.add(GamemodeEvent(gamemode)); game.spawn_entity(builder); @@ -65,3 +145,18 @@ fn broadcast_player_join(game: &mut Game, username: &str) { let message = Text::translate_with("multiplayer.player.joined", vec![username.to_owned()]); game.broadcast_chat(ChatKind::System, message); } + +fn player_abilities_or_default( + data: Option, + 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)), + }) +} diff --git a/feather/server/src/systems/player_leave.rs b/feather/server/src/systems/player_leave.rs index f7f582115..8034d0b0a 100644 --- a/feather/server/src/systems/player_leave.rs +++ b/feather/server/src/systems/player_leave.rs @@ -1,7 +1,15 @@ -use base::Text; +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::Name; +use quill_common::components::{ + CanBuild, CanCreativeFly, CreativeFlying, CreativeFlyingSpeed, Health, Instabreak, + Invulnerable, Name, PreviousGamemode, WalkSpeed, +}; use crate::{ClientId, Server}; @@ -13,12 +21,73 @@ pub fn register(systems: &mut SystemExecutor) { fn remove_disconnected_clients(game: &mut Game, server: &mut Server) -> SysResult { let mut entities_to_remove = Vec::new(); - for (player, (&client_id, name)) in game.ecs.query::<(&ClientId, &Name)>().iter() { + for ( + player, + ( + &client_id, + name, + 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, + &PreviousGamemode, + &Health, + &WalkSpeed, + &CreativeFlyingSpeed, + &CanCreativeFly, + &CreativeFlying, + &CanBuild, + &Instabreak, + &Invulnerable, + &HotbarSlot, + &Inventory, + )>() + .iter() + { let client = server.clients.get(client_id).unwrap(); if client.is_disconnected() { - server.remove_client(client_id); 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); } } @@ -33,3 +102,52 @@ fn broadcast_player_leave(game: &Game, username: &Name) { let message = Text::translate_with("multiplayer.player.left", vec![username.to_string()]); game.broadcast_chat(ChatKind::System, message); } + +fn create_player_data( + position: Position, + gamemode: Gamemode, + previous_gamemode: PreviousGamemode, + health: Health, + abilities: PlayerAbilities, + hotbar_slot: HotbarSlot, + inventory: &Inventory, +) -> PlayerData { + PlayerData { + animal: AnimalData { + base: BaseEntityData { + position: [position.x, position.y, position.z].into(), + rotation: [position.yaw, position.pitch].into(), + velocity: [0.0, 0.0, 0.0].into(), + }, + health: *health, + }, + gamemode: gamemode.to_i32().unwrap(), + previous_gamemode: previous_gamemode.id() as i32, + inventory: inventory + .to_vec() + .iter() + .enumerate() + // Here we filter out all empty slots. + .filter_map(|(slot, item)| { + match item { + libcraft_items::InventorySlot::Filled(item) => { + let res = InventorySlot::from_network_index(slot, item); + match res { + Some(i) => Some(i), + None => { + log::error!("Failed to convert the slot into anvil format."); + None + } + } + } + libcraft_items::InventorySlot::Empty => { + // Empty items are filtered out. + None + } + } + }) + .collect(), + held_item: hotbar_slot.get() as i32, + abilities, + } +} diff --git a/feather/server/src/systems/tablist.rs b/feather/server/src/systems/tablist.rs index 2f38b6aa9..047ac19c6 100644 --- a/feather/server/src/systems/tablist.rs +++ b/feather/server/src/systems/tablist.rs @@ -1,13 +1,12 @@ //! Sends tablist info to clients via the Player Info packet. +use uuid::Uuid; + use base::{Gamemode, ProfileProperty}; -use common::{ - events::{EntityRemoveEvent, PlayerJoinEvent}, - Game, -}; +use common::Game; use ecs::{SysResult, SystemExecutor}; +use quill_common::events::{EntityRemoveEvent, GamemodeEvent, PlayerJoinEvent}; use quill_common::{components::Name, entities::Player}; -use uuid::Uuid; use crate::{ClientId, Server}; @@ -15,7 +14,8 @@ pub fn register(systems: &mut SystemExecutor) { systems .group::() .add_system(remove_tablist_players) - .add_system(add_tablist_players); + .add_system(add_tablist_players) + .add_system(change_tablist_player_gamemode); } fn remove_tablist_players(game: &mut Game, server: &mut Server) -> SysResult { @@ -62,3 +62,11 @@ fn add_tablist_players(game: &mut Game, server: &mut Server) -> SysResult { } Ok(()) } + +fn change_tablist_player_gamemode(game: &mut Game, server: &mut Server) -> SysResult { + for (_, (event, &uuid)) in game.ecs.query::<(&GamemodeEvent, &Uuid)>().iter() { + // Change this player's gamemode in players' tablists + server.broadcast_with(|client| client.change_player_tablist_gamemode(uuid, **event)); + } + Ok(()) +} diff --git a/feather/server/src/systems/view.rs b/feather/server/src/systems/view.rs index c28b51154..5d43a3eee 100644 --- a/feather/server/src/systems/view.rs +++ b/feather/server/src/systems/view.rs @@ -40,16 +40,20 @@ fn send_new_chunks(game: &mut Game, server: &mut Server) -> SysResult { .query::<(&ClientId, &ViewUpdateEvent, &Position)>() .iter() { - let client = server.clients.get(client_id).unwrap(); - client.update_own_chunk(event.new_view.center()); - update_chunks( - game, - player, - client, - event, - position, - &mut server.waiting_chunks, - )?; + // 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) { + client.update_own_chunk(event.new_view.center()); + update_chunks( + game, + player, + client, + event, + position, + &mut server.waiting_chunks, + )?; + } } Ok(()) } diff --git a/feather/utils/Cargo.toml b/feather/utils/Cargo.toml index 74dc1e9e8..a8e34a1ab 100644 --- a/feather/utils/Cargo.toml +++ b/feather/utils/Cargo.toml @@ -7,4 +7,3 @@ edition = "2018" [dependencies] [dev-dependencies] -simple_logger = "1" diff --git a/feather/worldgen/Cargo.toml b/feather/worldgen/Cargo.toml index 4fde02011..ac61648e3 100644 --- a/feather/worldgen/Cargo.toml +++ b/feather/worldgen/Cargo.toml @@ -14,7 +14,7 @@ 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.19" +strum = "0.21" [dev-dependencies] approx = "0.3" diff --git a/feather/worldgen/src/biomes/distorted_voronoi.rs b/feather/worldgen/src/biomes/distorted_voronoi.rs index c8a5c15a8..20f3d31d1 100644 --- a/feather/worldgen/src/biomes/distorted_voronoi.rs +++ b/feather/worldgen/src/biomes/distorted_voronoi.rs @@ -1,5 +1,6 @@ use crate::voronoi::VoronoiGrid; -use crate::{BiomeGenerator, ChunkBiomes}; +use crate::BiomeGenerator; +use base::chunk::BiomeStore; use base::{Biome, ChunkPosition}; use rand::{Rng, SeedableRng}; use rand_xorshift::XorShiftRng; @@ -10,10 +11,10 @@ use rand_xorshift::XorShiftRng; pub struct DistortedVoronoiBiomeGenerator; impl BiomeGenerator for DistortedVoronoiBiomeGenerator { - fn generate_for_chunk(&self, chunk: ChunkPosition, seed: u64) -> ChunkBiomes { + fn generate_for_chunk(&self, chunk: ChunkPosition, seed: u64) -> BiomeStore { let mut voronoi = VoronoiGrid::new(384, seed); - let mut biomes = ChunkBiomes::from_array([Biome::Plains; 16 * 16]); // Will be overridden + let mut biomes = BiomeStore::default(); // Will be overridden // Noise is used to distort each coordinate. /*let x_noise = @@ -25,8 +26,8 @@ impl BiomeGenerator for DistortedVoronoiBiomeGenerator { .with_seed(seed as i32 + 2) .generate_scaled(-4.0, 4.0);*/ - for x in 0..16 { - for z in 0..16 { + 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; @@ -36,8 +37,8 @@ impl BiomeGenerator for DistortedVoronoiBiomeGenerator { let distort_z = 0; let (closest_x, closest_y) = voronoi.get( - (chunk.x * 16) + x as i32 + distort_x, - (chunk.z * 16) + z as i32 + distort_z, + (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 @@ -52,7 +53,9 @@ impl BiomeGenerator for DistortedVoronoiBiomeGenerator { let biome = Biome::from_id(shifted % 60).unwrap(); if is_biome_allowed(biome) { - biomes.set_biome_at(x, z, biome); + for y in 0..64 { + biomes.set(x, y, z, biome); + } break; } } @@ -96,15 +99,17 @@ mod tests { println!("{:?}", biomes); let mut num_plains = 0; - for x in 0..16 { - for z in 0..16 { - if biomes.biome_at(x, z) == Biome::Plains { - num_plains += 1; + 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, 16 * 16); + assert_ne!(num_plains, 4 * 64 * 4); } #[test] @@ -120,9 +125,11 @@ mod tests { for _ in 0..5 { let next = gen.generate_for_chunk(chunk, seed); - for x in 0..16 { - for z in 0..16 { - assert_eq!(first.biome_at(x, z), next.biome_at(x, z)); + 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/two_level.rs b/feather/worldgen/src/biomes/two_level.rs index 6458e0664..a14ae3fe4 100644 --- a/feather/worldgen/src/biomes/two_level.rs +++ b/feather/worldgen/src/biomes/two_level.rs @@ -1,5 +1,6 @@ use crate::voronoi::VoronoiGrid; -use crate::{voronoi, BiomeGenerator, ChunkBiomes}; +use crate::{voronoi, BiomeGenerator}; +use base::chunk::BiomeStore; use base::{Biome, ChunkPosition}; use once_cell::sync::Lazy; @@ -31,24 +32,24 @@ static BIOME_GROUPS: Lazy>> = Lazy::new(|| { pub struct TwoLevelBiomeGenerator; impl BiomeGenerator for TwoLevelBiomeGenerator { - fn generate_for_chunk(&self, chunk: ChunkPosition, seed: u64) -> ChunkBiomes { + 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 = ChunkBiomes::from_array([Biome::Plains; 16 * 16]); // Will be overridden + let mut biomes = BiomeStore::default(); // Will be overridden let num_groups = BIOME_GROUPS.len(); // TODO: distort voronoi - for x in 0..16 { - for z in 0..16 { + 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, chunk.z * 16 + 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); @@ -58,15 +59,16 @@ impl BiomeGenerator for TwoLevelBiomeGenerator { // Compute biome within group let biome = { let (closest_x, closest_z) = - local_voronoi.get(chunk.x * 16 + x, chunk.z * 16 + 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] }; - - biomes.set_biome_at(x as usize, z as usize, biome); + for y in 0..64 { + biomes.set(x as usize, y, z as usize, biome); + } } } diff --git a/feather/worldgen/src/composition.rs b/feather/worldgen/src/composition.rs index fad0d235d..61bc6e14c 100644 --- a/feather/worldgen/src/composition.rs +++ b/feather/worldgen/src/composition.rs @@ -1,8 +1,8 @@ //! Composition generator, used to populate chunks with blocks //! based on the density and biome values. -use crate::{block_index, util, ChunkBiomes, CompositionGenerator, SEA_LEVEL}; -use base::{Biome, BlockId, Chunk, ChunkPosition}; +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}; @@ -19,7 +19,7 @@ impl CompositionGenerator for BasicCompositionGenerator { &self, chunk: &mut Chunk, _pos: ChunkPosition, - biomes: &ChunkBiomes, + biomes: &BiomeStore, density: &BitSlice, seed: u64, ) { @@ -29,7 +29,14 @@ impl CompositionGenerator for BasicCompositionGenerator { // stone. for x in 0..16 { for z in 0..16 { - basic_composition_for_column(x, z, chunk, density, seed, biomes.biome_at(x, z)); + basic_composition_for_column( + x, + z, + chunk, + density, + seed, + biomes.get_at_block(x, 0, z), + ); } } } diff --git a/feather/worldgen/src/density_map/density.rs b/feather/worldgen/src/density_map/density.rs index 925cd9889..3d09f0f4f 100644 --- a/feather/worldgen/src/density_map/density.rs +++ b/feather/worldgen/src/density_map/density.rs @@ -34,7 +34,7 @@ impl DensityMapGenerator for DensityMapGeneratorImpl { ) -> BitVec { let mut density = BitVec::from_vec(vec![0u8; 16 * 256 * 16 / 8]); - let uninterpolated_densities = generate_density(chunk, &biomes, seed); + let uninterpolated_densities = generate_density(chunk, biomes, seed); let noise = NoiseLerper::new(&uninterpolated_densities) .with_offset(chunk.x, chunk.z) .generate(); @@ -106,7 +106,7 @@ fn generate_density(chunk: ChunkPosition, biomes: &NearbyBiomes, seed: u64) -> V let height_noise = NoiseBuilder::fbm_2d_offset(x_offset, len, z_offset, len) .with_seed(noise_seed + 3) .with_octaves(2) - .with_freq(0.001) + .with_freq(0.08) .generate() .0; @@ -116,9 +116,9 @@ fn generate_density(chunk: ChunkPosition, biomes: &NearbyBiomes, seed: u64) -> V 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 (amplitude, midpoint) = column_parameters(biomes, subx, subz); - let height = height_noise[(subz * len) + subx] * 25.0; + let height = height_noise[(subz * len) + subx] * 3.0; // Loop through Y axis of this subchunk column. for suby in 0..DENSITY_HEIGHT { @@ -146,7 +146,8 @@ fn generate_density(chunk: ChunkPosition, biomes: &NearbyBiomes, seed: u64) -> V 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) + height_offset + height; + result[index] = + lerp(density_1, density_2, choice) * 0.2 + height_offset * 2.0 + height; } } } @@ -191,7 +192,7 @@ fn column_parameters(biomes: &NearbyBiomes, x: usize, z: usize) -> (f32, f32) { let abs_x = x + block_x; let abs_z = z + block_z; - let biome = biomes.biome_at(abs_x, abs_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]; diff --git a/feather/worldgen/src/density_map/height.rs b/feather/worldgen/src/density_map/height.rs index cf84fc485..c38bac35e 100644 --- a/feather/worldgen/src/density_map/height.rs +++ b/feather/worldgen/src/density_map/height.rs @@ -35,7 +35,7 @@ impl DensityMapGenerator for HeightMapGenerator { 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.biome_at(x, z); + 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; diff --git a/feather/worldgen/src/finishers/clumped.rs b/feather/worldgen/src/finishers/clumped.rs index a4da7066e..af8880f05 100644 --- a/feather/worldgen/src/finishers/clumped.rs +++ b/feather/worldgen/src/finishers/clumped.rs @@ -1,5 +1,5 @@ use crate::util::shuffle_seed_for_chunk; -use crate::{ChunkBiomes, FinishingGenerator, TopBlocks}; +use crate::{BiomeStore, FinishingGenerator, TopBlocks}; use base::{Biome, BlockId, Chunk}; use rand::{Rng, SeedableRng}; use rand_xorshift::XorShiftRng; @@ -13,7 +13,7 @@ impl FinishingGenerator for ClumpedFoliageFinisher { fn generate_for_chunk( &self, chunk: &mut Chunk, - biomes: &ChunkBiomes, + biomes: &BiomeStore, top_blocks: &TopBlocks, seed: u64, ) { @@ -28,7 +28,7 @@ impl FinishingGenerator for ClumpedFoliageFinisher { for x in 0..16 { for z in 0..16 { - let biome = biomes.biome_at(x, z); + let biome = biomes.get_at_block(x, 0, z); if let Some(block) = biome_clump_block(biome) { if rng.gen_range(0, 48) == 0 { @@ -41,7 +41,7 @@ impl FinishingGenerator for ClumpedFoliageFinisher { 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(pos_x, 0, pos_z) != biome { + if chunk.biomes().get_at_block(pos_x, 0, pos_z) != biome { return; // Don't generate block outside this biome } diff --git a/feather/worldgen/src/finishers/single.rs b/feather/worldgen/src/finishers/single.rs index f65714975..74bcaf005 100644 --- a/feather/worldgen/src/finishers/single.rs +++ b/feather/worldgen/src/finishers/single.rs @@ -1,5 +1,6 @@ use crate::util::shuffle_seed_for_chunk; -use crate::{ChunkBiomes, FinishingGenerator, TopBlocks}; +use crate::{FinishingGenerator, TopBlocks}; +use base::chunk::BiomeStore; use base::{Biome, BlockId, Chunk}; use rand::{Rng, SeedableRng}; use rand_xorshift::XorShiftRng; @@ -12,14 +13,14 @@ impl FinishingGenerator for SingleFoliageFinisher { fn generate_for_chunk( &self, chunk: &mut Chunk, - biomes: &ChunkBiomes, + 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.biome_at(x, z); + 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() diff --git a/feather/worldgen/src/finishers/snow.rs b/feather/worldgen/src/finishers/snow.rs index 8b1f12ac0..164d74970 100644 --- a/feather/worldgen/src/finishers/snow.rs +++ b/feather/worldgen/src/finishers/snow.rs @@ -1,5 +1,5 @@ -use crate::{ChunkBiomes, FinishingGenerator, TopBlocks}; -use base::{Biome, BlockId, Chunk}; +use crate::{FinishingGenerator, TopBlocks}; +use base::{chunk::BiomeStore, Biome, BlockId, Chunk}; /// Finisher for generating snow on top of snow biomes. #[derive(Default)] @@ -9,13 +9,13 @@ impl FinishingGenerator for SnowFinisher { fn generate_for_chunk( &self, chunk: &mut Chunk, - biomes: &ChunkBiomes, + biomes: &BiomeStore, top_blocks: &TopBlocks, _seed: u64, ) { for x in 0..16 { for z in 0..16 { - if !is_snowy_biome(biomes.biome_at(x, z)) { + if !is_snowy_biome(biomes.get_at_block(x, 0, z)) { continue; } diff --git a/feather/worldgen/src/lib.rs b/feather/worldgen/src/lib.rs index 11023941c..36a421ee5 100644 --- a/feather/worldgen/src/lib.rs +++ b/feather/worldgen/src/lib.rs @@ -14,6 +14,7 @@ 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; @@ -26,7 +27,6 @@ use num_traits::ToPrimitive; use rand::{Rng, SeedableRng}; use rand_xorshift::XorShiftRng; use smallvec::SmallVec; -use std::fmt; pub use superflat::SuperflatWorldGenerator; /// Sea-level height. @@ -41,9 +41,9 @@ pub trait WorldGenerator: Send + Sync { fn generate_chunk(&self, position: ChunkPosition) -> Chunk; } -pub struct EmptyWorldGenerator {} +pub struct VoidWorldGenerator; -impl WorldGenerator for EmptyWorldGenerator { +impl WorldGenerator for VoidWorldGenerator { fn generate_chunk(&self, position: ChunkPosition) -> Chunk { Chunk::new(position) } @@ -133,24 +133,19 @@ impl WorldGenerator for ComposableGenerator { biomes.push(self.biome.generate_for_chunk(pos, biome_seed)); } } - let biomes = NearbyBiomes::from_vec(biomes); + 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); - - for x in 0..16 { - for z in 0..16 { - chunk.biomes_mut().set(x, 0, z, biomes.biome_at(x, z)); - } - } + *chunk.biomes_mut() = *biomes.center(); self.composition.generate_for_chunk( &mut chunk, position, - &biomes.biomes[4], // Center chunk + &biomes.biome_stores[4], // Center chunk density_map.as_bitslice(), seed_shuffler.gen(), ); @@ -175,7 +170,7 @@ impl WorldGenerator for ComposableGenerator { for finisher in &self.finishers { finisher.generate_for_chunk( &mut chunk, - &biomes.biomes[4], + &biomes.biome_stores[4], &top_blocks, seed_shuffler.gen(), ); @@ -189,7 +184,7 @@ impl WorldGenerator for 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) -> ChunkBiomes; + fn generate_for_chunk(&self, chunk: ChunkPosition, seed: u64) -> BiomeStore; } /// A generator which generates the density map for a chunk. @@ -216,7 +211,7 @@ pub trait CompositionGenerator: Send + Sync { &self, chunk: &mut Chunk, pos: ChunkPosition, - biomes: &ChunkBiomes, + biomes: &BiomeStore, density: &BitSlice, seed: u64, ); @@ -231,7 +226,7 @@ pub trait FinishingGenerator: Send + Sync { fn generate_for_chunk( &self, chunk: &mut Chunk, - biomes: &ChunkBiomes, + biomes: &BiomeStore, top_blocks: &TopBlocks, seed: u64, ); @@ -267,48 +262,87 @@ impl TopBlocks { 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 biomes: Vec, + pub biome_stores: [BiomeStore; 3 * 3], } impl NearbyBiomes { - pub fn from_vec(biomes: Vec) -> Self { - Self { biomes } + 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 column position. + /// Gets the biome at the given coordinates. /// - /// The column position is an offset from the - /// bottom-left corner of the center chunk. - pub fn biome_at(&self, x: N, z: N) -> Biome { - let (index, local_x, local_z) = self.index(x, z); + /// # 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.biomes[index].biome_at(local_x, local_z) + self.biome_stores[index].get_at_block(local_x, local_y, local_z) } - pub fn set_biome_at(&mut self, x: N, z: N, biome: Biome) { - let (index, local_x, local_z) = self.index(x, 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.biomes[index].set_biome_at(local_x, local_z, biome); + self.biome_stores[index].get(local_x / 4, local_y / 4, local_z / 4) } - fn index(&self, ox: N, oz: N) -> (usize, usize, usize) { + /// 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 mut local_z = (oz % 16).abs() as usize; + let mut local_x = (ox % 16).unsigned_abs(); + let local_y = (oy % 16).unsigned_abs(); + let mut local_z = (oz % 16).unsigned_abs(); if ox < 0 { local_x = 16 - local_x; @@ -317,69 +351,16 @@ impl NearbyBiomes { local_z = 16 - local_z; } - (chunk_x + chunk_z * 3, local_x, local_z) - } -} - -/// Represents the biomes of a chunk. -pub struct ChunkBiomes { - /// 2D array of biome values. The biome for a given - /// column local to the chunk can be indexed using - /// (x << 4) | z. - biomes: [Biome; 16 * 16], -} - -impl ChunkBiomes { - /// Creates a `ChunkBiomes` wrapping the given array of biomes. - #[inline] - pub fn from_array(biomes: [Biome; 16 * 16]) -> Self { - Self { biomes } - } - - /// Gets the biome for the given column index. - /// - /// # Panics - /// Panics if `x >= 16 | z >= 16`. - pub fn biome_at(&self, x: usize, z: usize) -> Biome { - assert!(x < 16 && z < 16); - - let index = Self::index(x, z); - self.biomes[index] - } - - /// Sets the biome for the given column index. - /// - /// # Panics - /// Panics if `x >= 16 | z >= 16`. - pub fn set_biome_at(&mut self, x: usize, z: usize, biome: Biome) { - assert!(x < 16 && z < 16); - - let index = Self::index(x, z); - self.biomes[index] = biome; - } - - fn index(x: usize, z: usize) -> usize { - (x << 4) | z - } -} - -impl fmt::Debug for ChunkBiomes { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - for i in 0..256 { - write!(f, "{:?}, ", self.biomes[i])?; - } - - Ok(()) + (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) -> ChunkBiomes { - ChunkBiomes::from_array([Biome::Plains; 16 * 16]) + fn generate_for_chunk(&self, _chunk: ChunkPosition, _seed: u64) -> BiomeStore { + BiomeStore::new(Biome::Plains) } } @@ -388,7 +369,6 @@ mod tests { use super::*; #[test] - #[ignore] // TODO (1.16): account for new 3D biomes fn test_reproducability() { let seeds: [u64; 4] = [std::u64::MAX, 3243, 0, 100]; @@ -413,18 +393,24 @@ mod tests { fn test_chunks_eq(a: &Chunk, b: &Chunk) { for x in 0..16 { for z in 0..16 { - assert_eq!(a.biomes().get(x, 0, z), b.biomes().get(x, 0, z)); 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_empty() { + pub fn test_worldgen_void() { let chunk_pos = ChunkPosition { x: 1, z: 2 }; - let generator = EmptyWorldGenerator {}; + let generator = VoidWorldGenerator; let chunk = generator.generate_chunk(chunk_pos); // No sections have been generated @@ -434,15 +420,15 @@ mod tests { #[test] fn test_chunk_biomes() { - let biomes = [Biome::Plains; 16 * 16]; - - let mut biomes = ChunkBiomes::from_array(biomes); - - for x in 0..16 { - for z in 0..16 { - assert_eq!(biomes.biome_at(x, z), Biome::Plains); - biomes.set_biome_at(x, z, Biome::Ocean); - assert_eq!(biomes.biome_at(x, z), Biome::Ocean); + 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); + } } } } @@ -453,9 +439,11 @@ mod tests { let biomes = gen.generate_for_chunk(ChunkPosition::new(0, 0), 0); - for x in 0..16 { - for z in 0..16 { - assert_eq!(biomes.biome_at(x, z), 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); + } } } } @@ -463,21 +451,21 @@ mod tests { #[test] fn test_nearby_biomes() { let biomes = vec![ - ChunkBiomes::from_array([Biome::Plains; 256]), - ChunkBiomes::from_array([Biome::Swamp; 256]), - ChunkBiomes::from_array([Biome::Savanna; 256]), - ChunkBiomes::from_array([Biome::BirchForest; 256]), - ChunkBiomes::from_array([Biome::DarkForest; 256]), - ChunkBiomes::from_array([Biome::Mountains; 256]), - ChunkBiomes::from_array([Biome::Ocean; 256]), - ChunkBiomes::from_array([Biome::Desert; 256]), - ChunkBiomes::from_array([Biome::Taiga; 256]), + 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_vec(biomes); + let biomes = NearbyBiomes::from_slice(&biomes[..]).unwrap(); - assert_eq!(biomes.biome_at(0, 0), Biome::DarkForest); - assert_eq!(biomes.biome_at(16, 16), Biome::Taiga); - assert_eq!(biomes.biome_at(-1, -1), Biome::Plains); - assert_eq!(biomes.biome_at(-1, 0), Biome::BirchForest); + 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); } } diff --git a/feather/worldgen/src/superflat.rs b/feather/worldgen/src/superflat.rs index 54e935826..69aaf2c0a 100644 --- a/feather/worldgen/src/superflat.rs +++ b/feather/worldgen/src/superflat.rs @@ -6,6 +6,12 @@ pub struct SuperflatWorldGenerator { pub options: SuperflatGeneratorOptions, } +impl SuperflatWorldGenerator { + pub fn new(options: SuperflatGeneratorOptions) -> Self { + Self { options } + } +} + 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); @@ -16,7 +22,8 @@ impl WorldGenerator for SuperflatWorldGenerator { if layer.height == 0 { continue; } - let layer_block = BlockId::from_identifier(layer.block.as_str()); + // 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)); if let Some(layer_block) = layer_block { for y in y_counter..(y_counter + layer.height) { for x in 0..16 { @@ -27,7 +34,7 @@ impl WorldGenerator for SuperflatWorldGenerator { } } else { // Skip this layer - log::debug!("Failed to generate layer: unknown block {}", layer.block); + log::warn!("Failed to generate layer: unknown block {}", layer.block); } y_counter += layer.height; @@ -44,7 +51,6 @@ mod tests { use super::*; #[test] - #[ignore] // TODO (1.16): account for new 3D biomes pub fn test_worldgen_flat() { let options = SuperflatGeneratorOptions { biome: Biome::Mountains.name().to_owned(), @@ -72,7 +78,7 @@ mod tests { BlockId::air() ); } - assert_eq!(chunk.biomes().get(x, 0, z), Biome::Mountains); + assert_eq!(chunk.biomes().get_at_block(x, 0, z), Biome::Mountains); } } } diff --git a/libcraft/blocks/src/data.rs b/libcraft/blocks/src/data.rs index cb4fd4a1c..27e51d73d 100644 --- a/libcraft/blocks/src/data.rs +++ b/libcraft/blocks/src/data.rs @@ -121,7 +121,7 @@ impl BlockReportEntry { ::Err: std::fmt::Debug, { if let Some(vec) = self.properties.get(name) { - vec.iter().map(|s| T::from_str(s).ok()).flatten().collect() + vec.iter().filter_map(|s| T::from_str(s).ok()).collect() } else { Vec::new() } diff --git a/libcraft/core/Cargo.toml b/libcraft/core/Cargo.toml index 66401d5e1..e4897a0b8 100644 --- a/libcraft/core/Cargo.toml +++ b/libcraft/core/Cargo.toml @@ -9,6 +9,6 @@ bytemuck = { version = "1", features = ["derive"] } num-derive = "0.3" num-traits = "0.2" serde = { version = "1", features = ["derive"] } -strum = "0.20" -strum_macros = "0.20" +strum = "0.21" +strum_macros = "0.21" vek = "0.14" \ No newline at end of file diff --git a/libcraft/core/src/entity.rs b/libcraft/core/src/entity.rs index 9192ddfb2..0f16ee4ce 100644 --- a/libcraft/core/src/entity.rs +++ b/libcraft/core/src/entity.rs @@ -63,6 +63,7 @@ pub enum EntityKind { Phantom, Pig, Piglin, + PiglinBrute, Pillager, PolarBear, Tnt, @@ -178,52 +179,53 @@ impl EntityKind { EntityKind::Phantom => 58, EntityKind::Pig => 59, EntityKind::Piglin => 60, - EntityKind::Pillager => 61, - EntityKind::PolarBear => 62, - EntityKind::Tnt => 63, - EntityKind::Pufferfish => 64, - EntityKind::Rabbit => 65, - EntityKind::Ravager => 66, - EntityKind::Salmon => 67, - EntityKind::Sheep => 68, - EntityKind::Shulker => 69, - EntityKind::ShulkerBullet => 70, - EntityKind::Silverfish => 71, - EntityKind::Skeleton => 72, - EntityKind::SkeletonHorse => 73, - EntityKind::Slime => 74, - EntityKind::SmallFireball => 75, - EntityKind::SnowGolem => 76, - EntityKind::Snowball => 77, - EntityKind::SpectralArrow => 78, - EntityKind::Spider => 79, - EntityKind::Squid => 80, - EntityKind::Stray => 81, - EntityKind::Strider => 82, - EntityKind::Egg => 83, - EntityKind::EnderPearl => 84, - EntityKind::ExperienceBottle => 85, - EntityKind::Potion => 86, - EntityKind::Trident => 87, - EntityKind::TraderLlama => 88, - EntityKind::TropicalFish => 89, - EntityKind::Turtle => 90, - EntityKind::Vex => 91, - EntityKind::Villager => 92, - EntityKind::Vindicator => 93, - EntityKind::WanderingTrader => 94, - EntityKind::Witch => 95, - EntityKind::Wither => 96, - EntityKind::WitherSkeleton => 97, - EntityKind::WitherSkull => 98, - EntityKind::Wolf => 99, - EntityKind::Zoglin => 100, - EntityKind::Zombie => 101, - EntityKind::ZombieHorse => 102, - EntityKind::ZombieVillager => 103, - EntityKind::ZombifiedPiglin => 104, - EntityKind::Player => 105, - EntityKind::FishingBobber => 106, + 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, } } @@ -291,52 +293,53 @@ impl EntityKind { 58 => Some(EntityKind::Phantom), 59 => Some(EntityKind::Pig), 60 => Some(EntityKind::Piglin), - 61 => Some(EntityKind::Pillager), - 62 => Some(EntityKind::PolarBear), - 63 => Some(EntityKind::Tnt), - 64 => Some(EntityKind::Pufferfish), - 65 => Some(EntityKind::Rabbit), - 66 => Some(EntityKind::Ravager), - 67 => Some(EntityKind::Salmon), - 68 => Some(EntityKind::Sheep), - 69 => Some(EntityKind::Shulker), - 70 => Some(EntityKind::ShulkerBullet), - 71 => Some(EntityKind::Silverfish), - 72 => Some(EntityKind::Skeleton), - 73 => Some(EntityKind::SkeletonHorse), - 74 => Some(EntityKind::Slime), - 75 => Some(EntityKind::SmallFireball), - 76 => Some(EntityKind::SnowGolem), - 77 => Some(EntityKind::Snowball), - 78 => Some(EntityKind::SpectralArrow), - 79 => Some(EntityKind::Spider), - 80 => Some(EntityKind::Squid), - 81 => Some(EntityKind::Stray), - 82 => Some(EntityKind::Strider), - 83 => Some(EntityKind::Egg), - 84 => Some(EntityKind::EnderPearl), - 85 => Some(EntityKind::ExperienceBottle), - 86 => Some(EntityKind::Potion), - 87 => Some(EntityKind::Trident), - 88 => Some(EntityKind::TraderLlama), - 89 => Some(EntityKind::TropicalFish), - 90 => Some(EntityKind::Turtle), - 91 => Some(EntityKind::Vex), - 92 => Some(EntityKind::Villager), - 93 => Some(EntityKind::Vindicator), - 94 => Some(EntityKind::WanderingTrader), - 95 => Some(EntityKind::Witch), - 96 => Some(EntityKind::Wither), - 97 => Some(EntityKind::WitherSkeleton), - 98 => Some(EntityKind::WitherSkull), - 99 => Some(EntityKind::Wolf), - 100 => Some(EntityKind::Zoglin), - 101 => Some(EntityKind::Zombie), - 102 => Some(EntityKind::ZombieHorse), - 103 => Some(EntityKind::ZombieVillager), - 104 => Some(EntityKind::ZombifiedPiglin), - 105 => Some(EntityKind::Player), - 106 => Some(EntityKind::FishingBobber), + 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, } } @@ -408,52 +411,53 @@ impl EntityKind { EntityKind::Phantom => 58, EntityKind::Pig => 59, EntityKind::Piglin => 60, - EntityKind::Pillager => 61, - EntityKind::PolarBear => 62, - EntityKind::Tnt => 63, - EntityKind::Pufferfish => 64, - EntityKind::Rabbit => 65, - EntityKind::Ravager => 66, - EntityKind::Salmon => 67, - EntityKind::Sheep => 68, - EntityKind::Shulker => 69, - EntityKind::ShulkerBullet => 70, - EntityKind::Silverfish => 71, - EntityKind::Skeleton => 72, - EntityKind::SkeletonHorse => 73, - EntityKind::Slime => 74, - EntityKind::SmallFireball => 75, - EntityKind::SnowGolem => 76, - EntityKind::Snowball => 77, - EntityKind::SpectralArrow => 78, - EntityKind::Spider => 79, - EntityKind::Squid => 80, - EntityKind::Stray => 81, - EntityKind::Strider => 82, - EntityKind::Egg => 83, - EntityKind::EnderPearl => 84, - EntityKind::ExperienceBottle => 85, - EntityKind::Potion => 86, - EntityKind::Trident => 87, - EntityKind::TraderLlama => 88, - EntityKind::TropicalFish => 89, - EntityKind::Turtle => 90, - EntityKind::Vex => 91, - EntityKind::Villager => 92, - EntityKind::Vindicator => 93, - EntityKind::WanderingTrader => 94, - EntityKind::Witch => 95, - EntityKind::Wither => 96, - EntityKind::WitherSkeleton => 97, - EntityKind::WitherSkull => 98, - EntityKind::Wolf => 99, - EntityKind::Zoglin => 100, - EntityKind::Zombie => 101, - EntityKind::ZombieHorse => 102, - EntityKind::ZombieVillager => 103, - EntityKind::ZombifiedPiglin => 104, - EntityKind::Player => 105, - EntityKind::FishingBobber => 106, + 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, } } @@ -521,52 +525,53 @@ impl EntityKind { 58 => Some(EntityKind::Phantom), 59 => Some(EntityKind::Pig), 60 => Some(EntityKind::Piglin), - 61 => Some(EntityKind::Pillager), - 62 => Some(EntityKind::PolarBear), - 63 => Some(EntityKind::Tnt), - 64 => Some(EntityKind::Pufferfish), - 65 => Some(EntityKind::Rabbit), - 66 => Some(EntityKind::Ravager), - 67 => Some(EntityKind::Salmon), - 68 => Some(EntityKind::Sheep), - 69 => Some(EntityKind::Shulker), - 70 => Some(EntityKind::ShulkerBullet), - 71 => Some(EntityKind::Silverfish), - 72 => Some(EntityKind::Skeleton), - 73 => Some(EntityKind::SkeletonHorse), - 74 => Some(EntityKind::Slime), - 75 => Some(EntityKind::SmallFireball), - 76 => Some(EntityKind::SnowGolem), - 77 => Some(EntityKind::Snowball), - 78 => Some(EntityKind::SpectralArrow), - 79 => Some(EntityKind::Spider), - 80 => Some(EntityKind::Squid), - 81 => Some(EntityKind::Stray), - 82 => Some(EntityKind::Strider), - 83 => Some(EntityKind::Egg), - 84 => Some(EntityKind::EnderPearl), - 85 => Some(EntityKind::ExperienceBottle), - 86 => Some(EntityKind::Potion), - 87 => Some(EntityKind::Trident), - 88 => Some(EntityKind::TraderLlama), - 89 => Some(EntityKind::TropicalFish), - 90 => Some(EntityKind::Turtle), - 91 => Some(EntityKind::Vex), - 92 => Some(EntityKind::Villager), - 93 => Some(EntityKind::Vindicator), - 94 => Some(EntityKind::WanderingTrader), - 95 => Some(EntityKind::Witch), - 96 => Some(EntityKind::Wither), - 97 => Some(EntityKind::WitherSkeleton), - 98 => Some(EntityKind::WitherSkull), - 99 => Some(EntityKind::Wolf), - 100 => Some(EntityKind::Zoglin), - 101 => Some(EntityKind::Zombie), - 102 => Some(EntityKind::ZombieHorse), - 103 => Some(EntityKind::ZombieVillager), - 104 => Some(EntityKind::ZombifiedPiglin), - 105 => Some(EntityKind::Player), - 106 => Some(EntityKind::FishingBobber), + 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, } } @@ -638,6 +643,7 @@ impl EntityKind { EntityKind::Phantom => "phantom", EntityKind::Pig => "pig", EntityKind::Piglin => "piglin", + EntityKind::PiglinBrute => "piglin_brute", EntityKind::Pillager => "pillager", EntityKind::PolarBear => "polar_bear", EntityKind::Tnt => "tnt", @@ -751,6 +757,7 @@ impl EntityKind { "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), "tnt" => Some(EntityKind::Tnt), @@ -868,6 +875,7 @@ impl EntityKind { EntityKind::Phantom => "Phantom", EntityKind::Pig => "Pig", EntityKind::Piglin => "Piglin", + EntityKind::PiglinBrute => "Piglin Brute", EntityKind::Pillager => "Pillager", EntityKind::PolarBear => "Polar Bear", EntityKind::Tnt => "Primed TNT", @@ -981,6 +989,7 @@ impl EntityKind { "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), @@ -1281,6 +1290,10 @@ impl EntityKind { 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), diff --git a/libcraft/core/src/positions.rs b/libcraft/core/src/positions.rs index 91c9cf48d..81606b6f6 100644 --- a/libcraft/core/src/positions.rs +++ b/libcraft/core/src/positions.rs @@ -350,6 +350,18 @@ impl BlockPosition { z: self.z, } } + + /// Returns `true` if the [`BlockPosition`] is valid. + /// + /// Minecraft defines a valid block position with the following limits: + /// - X (-33554432 to 33554431) + /// - Y (-2048 to 2047) + /// - Z (-33554432 to 33554431) + pub fn valid(self) -> bool { + (-33554432 <= self.x && self.x <= 33554431) + && (-2048 <= self.y && self.y <= 2047) + && (-33554432 <= self.z && self.z <= 33554431) + } } impl Add for BlockPosition { diff --git a/feather/generated/feather/entity_metadata.json b/libcraft/generators/libcraft-data/entity_metadata.json similarity index 99% rename from feather/generated/feather/entity_metadata.json rename to libcraft/generators/libcraft-data/entity_metadata.json index b99c00349..ec5943227 100644 --- a/feather/generated/feather/entity_metadata.json +++ b/libcraft/generators/libcraft-data/entity_metadata.json @@ -343,4 +343,5 @@ } } } -} \ No newline at end of file +} + diff --git a/feather/generated/feather/inventory.json b/libcraft/generators/libcraft-data/inventory.json similarity index 99% rename from feather/generated/feather/inventory.json rename to libcraft/generators/libcraft-data/inventory.json index 37c5346a6..42b494720 100644 --- a/feather/generated/feather/inventory.json +++ b/libcraft/generators/libcraft-data/inventory.json @@ -62,7 +62,8 @@ "leggings": 1, "boots": 1, "storage": 27, - "hotbar": 9 + "hotbar": 9, + "offhand": 1 }, "chest": { "storage": 27 diff --git a/libcraft/generators/python/entity.py b/libcraft/generators/python/entity.py index a51d9edfa..e30c8b4e4 100644 --- a/libcraft/generators/python/entity.py +++ b/libcraft/generators/python/entity.py @@ -7,7 +7,7 @@ display_names = {} bboxes = {} -for entity in load_minecraft_json("entities.json"): +for entity in load_minecraft_json("entities.json","1.16.2"): variant = camel_case(entity['name']) entities.append(variant) ids[variant] = entity['id'] diff --git a/feather/generated/generators/inventory.py b/libcraft/generators/python/inventory.py similarity index 88% rename from feather/generated/generators/inventory.py rename to libcraft/generators/python/inventory.py index 0c0965f22..e7f3e4712 100644 --- a/feather/generated/generators/inventory.py +++ b/libcraft/generators/python/inventory.py @@ -1,3 +1,4 @@ +from pathlib import Path import common import collections @@ -57,10 +58,13 @@ 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 index >= {slot_offset} && index < {max_slot} {{ + if ({slot_offset}..{max_slot}).contains(&index) {{ let area = Area::{area_in_inventory}; - let slot = index - {slot_offset}; + let slot = index{slot_offset_operation}; Some(({inventory}, area, slot)) }} """ @@ -74,7 +78,10 @@ first = False area_in_inventory = common.camel_case(area_in_inventory) - slot_to_index += f"if area == Area::{area_in_inventory} && {inventory}.ptr_eq(inventory) {{ Some(slot + {slot_offset}) }}" + 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 } }," @@ -147,4 +154,4 @@ output += f"impl InventoryBacking {{ {get_area_fn} {get_areas_fn} {constructor_fns} }}" output += f"impl crate::Inventory {{ {inventory_constructor_fns} }}" -common.output("src/inventory.rs", output) +common.output("inventory/src/inventory.rs", output) diff --git a/libcraft/generators/python/item.py b/libcraft/generators/python/item.py index eb16e12ba..78d7ff2ab 100644 --- a/libcraft/generators/python/item.py +++ b/libcraft/generators/python/item.py @@ -48,11 +48,9 @@ """ output_data += f""" - use std::convert::Into; - - impl Into<&'static str> for Item {{ - fn into(self) -> &'static str {{ - self.name() + impl From for &'static str {{ + fn from(i: Item) -> Self {{ + i.name() }} }} """ diff --git a/libcraft/generators/src/common.rs b/libcraft/generators/src/common.rs index 248a227f8..56c98fa07 100644 --- a/libcraft/generators/src/common.rs +++ b/libcraft/generators/src/common.rs @@ -32,7 +32,6 @@ pub fn compress_and_write(data: Vec, path: &str) -> Result<()> pub fn state_name_to_block_kind(name: &str) -> Result { name.split(':') .last() - .map(BlockKind::from_name) - .flatten() + .and_then(BlockKind::from_name) .ok_or_else(|| anyhow!("Could not convert state name to BlockKind")) } diff --git a/libcraft/inventory/Cargo.toml b/libcraft/inventory/Cargo.toml new file mode 100644 index 000000000..93fc27208 --- /dev/null +++ b/libcraft/inventory/Cargo.toml @@ -0,0 +1,11 @@ +[package] +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 + +[dependencies] +libcraft-items = { path = "../items" } +parking_lot = "0.11" diff --git a/feather/generated/src/inventory.rs b/libcraft/inventory/src/inventory.rs similarity index 85% rename from feather/generated/src/inventory.rs rename to libcraft/inventory/src/inventory.rs index ce8900746..975d6030a 100644 --- a/feather/generated/src/inventory.rs +++ b/libcraft/inventory/src/inventory.rs @@ -142,39 +142,39 @@ impl Window { pub fn index_to_slot(&self, index: usize) -> Option<(&crate::Inventory, Area, usize)> { match self { Window::Player { player } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::CraftingOutput; - let slot = index - 0; + let slot = index; Some((player, area, slot)) - } else if index >= 1 && index < 5 { + } else if (1..5).contains(&index) { let area = Area::CraftingInput; let slot = index - 1; Some((player, area, slot)) - } else if index >= 5 && index < 6 { + } else if (5..6).contains(&index) { let area = Area::Helmet; let slot = index - 5; Some((player, area, slot)) - } else if index >= 6 && index < 7 { + } else if (6..7).contains(&index) { let area = Area::Chestplate; let slot = index - 6; Some((player, area, slot)) - } else if index >= 7 && index < 8 { + } else if (7..8).contains(&index) { let area = Area::Leggings; let slot = index - 7; Some((player, area, slot)) - } else if index >= 8 && index < 9 { + } else if (8..9).contains(&index) { let area = Area::Boots; let slot = index - 8; Some((player, area, slot)) - } else if index >= 9 && index < 36 { + } else if (9..36).contains(&index) { let area = Area::Storage; let slot = index - 9; Some((player, area, slot)) - } else if index >= 36 && index < 45 { + } else if (36..45).contains(&index) { let area = Area::Hotbar; let slot = index - 36; Some((player, area, slot)) - } else if index >= 45 && index < 46 { + } else if (45..46).contains(&index) { let area = Area::Offhand; let slot = index - 45; Some((player, area, slot)) @@ -183,15 +183,15 @@ impl Window { } } Window::Generic9x1 { block, player } => { - if index >= 0 && index < 9 { + if (0..9).contains(&index) { let area = Area::Storage; - let slot = index - 0; + let slot = index; Some((block, area, slot)) - } else if index >= 9 && index < 36 { + } else if (9..36).contains(&index) { let area = Area::Storage; let slot = index - 9; Some((player, area, slot)) - } else if index >= 36 && index < 45 { + } else if (36..45).contains(&index) { let area = Area::Hotbar; let slot = index - 36; Some((player, area, slot)) @@ -200,15 +200,15 @@ impl Window { } } Window::Generic9x2 { block, player } => { - if index >= 0 && index < 18 { + if (0..18).contains(&index) { let area = Area::Storage; - let slot = index - 0; + let slot = index; Some((block, area, slot)) - } else if index >= 18 && index < 45 { + } else if (18..45).contains(&index) { let area = Area::Storage; let slot = index - 18; Some((player, area, slot)) - } else if index >= 45 && index < 54 { + } else if (45..54).contains(&index) { let area = Area::Hotbar; let slot = index - 45; Some((player, area, slot)) @@ -217,15 +217,15 @@ impl Window { } } Window::Generic9x3 { block, player } => { - if index >= 0 && index < 27 { + if (0..27).contains(&index) { let area = Area::Storage; - let slot = index - 0; + let slot = index; Some((block, area, slot)) - } else if index >= 27 && index < 54 { + } else if (27..54).contains(&index) { let area = Area::Storage; let slot = index - 27; Some((player, area, slot)) - } else if index >= 54 && index < 63 { + } else if (54..63).contains(&index) { let area = Area::Hotbar; let slot = index - 54; Some((player, area, slot)) @@ -234,15 +234,15 @@ impl Window { } } Window::Generic9x4 { block, player } => { - if index >= 0 && index < 36 { + if (0..36).contains(&index) { let area = Area::Storage; - let slot = index - 0; + let slot = index; Some((block, area, slot)) - } else if index >= 36 && index < 63 { + } else if (36..63).contains(&index) { let area = Area::Storage; let slot = index - 36; Some((player, area, slot)) - } else if index >= 63 && index < 72 { + } else if (63..72).contains(&index) { let area = Area::Hotbar; let slot = index - 63; Some((player, area, slot)) @@ -251,15 +251,15 @@ impl Window { } } Window::Generic9x5 { block, player } => { - if index >= 0 && index < 45 { + if (0..45).contains(&index) { let area = Area::Storage; - let slot = index - 0; + let slot = index; Some((block, area, slot)) - } else if index >= 45 && index < 72 { + } else if (45..72).contains(&index) { let area = Area::Storage; let slot = index - 45; Some((player, area, slot)) - } else if index >= 72 && index < 81 { + } else if (72..81).contains(&index) { let area = Area::Hotbar; let slot = index - 72; Some((player, area, slot)) @@ -272,19 +272,19 @@ impl Window { right_chest, player, } => { - if index >= 0 && index < 27 { + if (0..27).contains(&index) { let area = Area::Storage; - let slot = index - 0; + let slot = index; Some((left_chest, area, slot)) - } else if index >= 27 && index < 54 { + } else if (27..54).contains(&index) { let area = Area::Storage; let slot = index - 27; Some((right_chest, area, slot)) - } else if index >= 54 && index < 81 { + } else if (54..81).contains(&index) { let area = Area::Storage; let slot = index - 54; Some((player, area, slot)) - } else if index >= 81 && index < 90 { + } else if (81..90).contains(&index) { let area = Area::Hotbar; let slot = index - 81; Some((player, area, slot)) @@ -293,15 +293,15 @@ impl Window { } } Window::Generic3x3 { block, player } => { - if index >= 0 && index < 9 { + if (0..9).contains(&index) { let area = Area::Storage; - let slot = index - 0; + let slot = index; Some((block, area, slot)) - } else if index >= 9 && index < 36 { + } else if (9..36).contains(&index) { let area = Area::Storage; let slot = index - 9; Some((player, area, slot)) - } else if index >= 36 && index < 45 { + } else if (36..45).contains(&index) { let area = Area::Hotbar; let slot = index - 36; Some((player, area, slot)) @@ -313,19 +313,19 @@ impl Window { crafting_table, player, } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::CraftingOutput; - let slot = index - 0; + let slot = index; Some((crafting_table, area, slot)) - } else if index >= 1 && index < 10 { + } else if (1..10).contains(&index) { let area = Area::CraftingInput; let slot = index - 1; Some((crafting_table, area, slot)) - } else if index >= 10 && index < 37 { + } else if (10..37).contains(&index) { let area = Area::Storage; let slot = index - 10; Some((player, area, slot)) - } else if index >= 37 && index < 46 { + } else if (37..46).contains(&index) { let area = Area::Hotbar; let slot = index - 37; Some((player, area, slot)) @@ -334,23 +334,23 @@ impl Window { } } Window::Furnace { furnace, player } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::FurnaceIngredient; - let slot = index - 0; + let slot = index; Some((furnace, area, slot)) - } else if index >= 1 && index < 2 { + } else if (1..2).contains(&index) { let area = Area::FurnaceFuel; let slot = index - 1; Some((furnace, area, slot)) - } else if index >= 2 && index < 3 { + } else if (2..3).contains(&index) { let area = Area::FurnaceOutput; let slot = index - 2; Some((furnace, area, slot)) - } else if index >= 3 && index < 30 { + } else if (3..30).contains(&index) { let area = Area::Storage; let slot = index - 3; Some((player, area, slot)) - } else if index >= 30 && index < 39 { + } else if (30..39).contains(&index) { let area = Area::Hotbar; let slot = index - 30; Some((player, area, slot)) @@ -362,23 +362,23 @@ impl Window { blast_furnace, player, } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::FurnaceIngredient; - let slot = index - 0; + let slot = index; Some((blast_furnace, area, slot)) - } else if index >= 1 && index < 2 { + } else if (1..2).contains(&index) { let area = Area::FurnaceFuel; let slot = index - 1; Some((blast_furnace, area, slot)) - } else if index >= 2 && index < 3 { + } else if (2..3).contains(&index) { let area = Area::FurnaceOutput; let slot = index - 2; Some((blast_furnace, area, slot)) - } else if index >= 3 && index < 30 { + } else if (3..30).contains(&index) { let area = Area::Storage; let slot = index - 3; Some((player, area, slot)) - } else if index >= 30 && index < 39 { + } else if (30..39).contains(&index) { let area = Area::Hotbar; let slot = index - 30; Some((player, area, slot)) @@ -387,23 +387,23 @@ impl Window { } } Window::Smoker { smoker, player } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::FurnaceIngredient; - let slot = index - 0; + let slot = index; Some((smoker, area, slot)) - } else if index >= 1 && index < 2 { + } else if (1..2).contains(&index) { let area = Area::FurnaceFuel; let slot = index - 1; Some((smoker, area, slot)) - } else if index >= 2 && index < 3 { + } else if (2..3).contains(&index) { let area = Area::FurnaceOutput; let slot = index - 2; Some((smoker, area, slot)) - } else if index >= 3 && index < 30 { + } else if (3..30).contains(&index) { let area = Area::Storage; let slot = index - 3; Some((player, area, slot)) - } else if index >= 30 && index < 39 { + } else if (30..39).contains(&index) { let area = Area::Hotbar; let slot = index - 30; Some((player, area, slot)) @@ -415,19 +415,19 @@ impl Window { enchantment_table, player, } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::EnchantmentItem; - let slot = index - 0; + let slot = index; Some((enchantment_table, area, slot)) - } else if index >= 1 && index < 2 { + } else if (1..2).contains(&index) { let area = Area::EnchantmentLapis; let slot = index - 1; Some((enchantment_table, area, slot)) - } else if index >= 2 && index < 29 { + } else if (2..29).contains(&index) { let area = Area::Storage; let slot = index - 2; Some((player, area, slot)) - } else if index >= 29 && index < 38 { + } else if (29..38).contains(&index) { let area = Area::Hotbar; let slot = index - 29; Some((player, area, slot)) @@ -439,23 +439,23 @@ impl Window { brewing_stand, player, } => { - if index >= 0 && index < 3 { + if (0..3).contains(&index) { let area = Area::BrewingBottle; - let slot = index - 0; + let slot = index; Some((brewing_stand, area, slot)) - } else if index >= 3 && index < 4 { + } else if (3..4).contains(&index) { let area = Area::BrewingIngredient; let slot = index - 3; Some((brewing_stand, area, slot)) - } else if index >= 4 && index < 5 { + } else if (4..5).contains(&index) { let area = Area::BrewingBlazePowder; let slot = index - 4; Some((brewing_stand, area, slot)) - } else if index >= 5 && index < 32 { + } else if (5..32).contains(&index) { let area = Area::Storage; let slot = index - 5; Some((player, area, slot)) - } else if index >= 32 && index < 41 { + } else if (32..41).contains(&index) { let area = Area::Hotbar; let slot = index - 32; Some((player, area, slot)) @@ -464,15 +464,15 @@ impl Window { } } Window::Beacon { beacon, player } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::BeaconPayment; - let slot = index - 0; + let slot = index; Some((beacon, area, slot)) - } else if index >= 1 && index < 28 { + } else if (1..28).contains(&index) { let area = Area::Storage; let slot = index - 1; Some((player, area, slot)) - } else if index >= 28 && index < 37 { + } else if (28..37).contains(&index) { let area = Area::Hotbar; let slot = index - 28; Some((player, area, slot)) @@ -481,23 +481,23 @@ impl Window { } } Window::Anvil { anvil, player } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::AnvilInput1; - let slot = index - 0; + let slot = index; Some((anvil, area, slot)) - } else if index >= 1 && index < 2 { + } else if (1..2).contains(&index) { let area = Area::AnvilInput2; let slot = index - 1; Some((anvil, area, slot)) - } else if index >= 2 && index < 3 { + } else if (2..3).contains(&index) { let area = Area::AnvilOutput; let slot = index - 2; Some((anvil, area, slot)) - } else if index >= 3 && index < 30 { + } else if (3..30).contains(&index) { let area = Area::Storage; let slot = index - 3; Some((player, area, slot)) - } else if index >= 30 && index < 39 { + } else if (30..39).contains(&index) { let area = Area::Hotbar; let slot = index - 30; Some((player, area, slot)) @@ -506,15 +506,15 @@ impl Window { } } Window::Hopper { hopper, player } => { - if index >= 0 && index < 4 { + if (0..4).contains(&index) { let area = Area::Storage; - let slot = index - 0; + let slot = index; Some((hopper, area, slot)) - } else if index >= 4 && index < 31 { + } else if (4..31).contains(&index) { let area = Area::Storage; let slot = index - 4; Some((player, area, slot)) - } else if index >= 31 && index < 40 { + } else if (31..40).contains(&index) { let area = Area::Hotbar; let slot = index - 31; Some((player, area, slot)) @@ -526,15 +526,15 @@ impl Window { shulker_box, player, } => { - if index >= 0 && index < 27 { + if (0..27).contains(&index) { let area = Area::Storage; - let slot = index - 0; + let slot = index; Some((shulker_box, area, slot)) - } else if index >= 27 && index < 54 { + } else if (27..54).contains(&index) { let area = Area::Storage; let slot = index - 27; Some((player, area, slot)) - } else if index >= 54 && index < 63 { + } else if (54..63).contains(&index) { let area = Area::Hotbar; let slot = index - 54; Some((player, area, slot)) @@ -546,23 +546,23 @@ impl Window { cartography_table, player, } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::CartographyMap; - let slot = index - 0; + let slot = index; Some((cartography_table, area, slot)) - } else if index >= 1 && index < 2 { + } else if (1..2).contains(&index) { let area = Area::CartographyPaper; let slot = index - 1; Some((cartography_table, area, slot)) - } else if index >= 2 && index < 3 { + } else if (2..3).contains(&index) { let area = Area::CartographyOutput; let slot = index - 2; Some((cartography_table, area, slot)) - } else if index >= 3 && index < 30 { + } else if (3..30).contains(&index) { let area = Area::Storage; let slot = index - 3; Some((player, area, slot)) - } else if index >= 30 && index < 39 { + } else if (30..39).contains(&index) { let area = Area::Hotbar; let slot = index - 30; Some((player, area, slot)) @@ -571,23 +571,23 @@ impl Window { } } Window::Grindstone { grindstone, player } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::GrindstoneInput1; - let slot = index - 0; + let slot = index; Some((grindstone, area, slot)) - } else if index >= 1 && index < 2 { + } else if (1..2).contains(&index) { let area = Area::GrindstoneInput2; let slot = index - 1; Some((grindstone, area, slot)) - } else if index >= 2 && index < 3 { + } else if (2..3).contains(&index) { let area = Area::GrindstoneOutput; let slot = index - 2; Some((grindstone, area, slot)) - } else if index >= 3 && index < 30 { + } else if (3..30).contains(&index) { let area = Area::Storage; let slot = index - 3; Some((player, area, slot)) - } else if index >= 30 && index < 39 { + } else if (30..39).contains(&index) { let area = Area::Hotbar; let slot = index - 30; Some((player, area, slot)) @@ -596,15 +596,15 @@ impl Window { } } Window::Lectern { lectern, player } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::LecternBook; - let slot = index - 0; + let slot = index; Some((lectern, area, slot)) - } else if index >= 1 && index < 28 { + } else if (1..28).contains(&index) { let area = Area::Storage; let slot = index - 1; Some((player, area, slot)) - } else if index >= 28 && index < 37 { + } else if (28..37).contains(&index) { let area = Area::Hotbar; let slot = index - 28; Some((player, area, slot)) @@ -613,27 +613,27 @@ impl Window { } } Window::Loom { loom, player } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::LoomBanner; - let slot = index - 0; + let slot = index; Some((loom, area, slot)) - } else if index >= 1 && index < 2 { + } else if (1..2).contains(&index) { let area = Area::LoomDye; let slot = index - 1; Some((loom, area, slot)) - } else if index >= 2 && index < 3 { + } else if (2..3).contains(&index) { let area = Area::LoomPattern; let slot = index - 2; Some((loom, area, slot)) - } else if index >= 3 && index < 4 { + } else if (3..4).contains(&index) { let area = Area::LoomOutput; let slot = index - 3; Some((loom, area, slot)) - } else if index >= 4 && index < 31 { + } else if (4..31).contains(&index) { let area = Area::Storage; let slot = index - 4; Some((player, area, slot)) - } else if index >= 31 && index < 40 { + } else if (31..40).contains(&index) { let area = Area::Hotbar; let slot = index - 31; Some((player, area, slot)) @@ -645,19 +645,19 @@ impl Window { stonecutter, player, } => { - if index >= 0 && index < 1 { + if (0..1).contains(&index) { let area = Area::StonecutterInput; - let slot = index - 0; + let slot = index; Some((stonecutter, area, slot)) - } else if index >= 1 && index < 2 { + } else if (1..2).contains(&index) { let area = Area::StonecutterOutput; let slot = index - 1; Some((stonecutter, area, slot)) - } else if index >= 2 && index < 29 { + } else if (2..29).contains(&index) { let area = Area::Storage; let slot = index - 2; Some((player, area, slot)) - } else if index >= 29 && index < 38 { + } else if (29..38).contains(&index) { let area = Area::Hotbar; let slot = index - 29; Some((player, area, slot)) @@ -676,7 +676,7 @@ impl Window { match self { Window::Player { player } => { if area == Area::CraftingOutput && player.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::CraftingInput && player.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::Helmet && player.ptr_eq(inventory) { @@ -699,7 +699,7 @@ impl Window { } Window::Generic9x1 { block, player } => { if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 9) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -710,7 +710,7 @@ impl Window { } Window::Generic9x2 { block, player } => { if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 18) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -721,7 +721,7 @@ impl Window { } Window::Generic9x3 { block, player } => { if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 27) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -732,7 +732,7 @@ impl Window { } Window::Generic9x4 { block, player } => { if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 36) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -743,7 +743,7 @@ impl Window { } Window::Generic9x5 { block, player } => { if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 45) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -758,7 +758,7 @@ impl Window { player, } => { if area == Area::Storage && left_chest.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && right_chest.ptr_eq(inventory) { Some(slot + 27) } else if area == Area::Storage && player.ptr_eq(inventory) { @@ -771,7 +771,7 @@ impl Window { } Window::Generic3x3 { block, player } => { if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 9) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -785,7 +785,7 @@ impl Window { player, } => { if area == Area::CraftingOutput && crafting_table.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::CraftingInput && crafting_table.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::Storage && player.ptr_eq(inventory) { @@ -798,7 +798,7 @@ impl Window { } Window::Furnace { furnace, player } => { if area == Area::FurnaceIngredient && furnace.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::FurnaceFuel && furnace.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::FurnaceOutput && furnace.ptr_eq(inventory) { @@ -816,7 +816,7 @@ impl Window { player, } => { if area == Area::FurnaceIngredient && blast_furnace.ptr_eq(inventory) { - Some(slot + 0) + 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) { @@ -831,7 +831,7 @@ impl Window { } Window::Smoker { smoker, player } => { if area == Area::FurnaceIngredient && smoker.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::FurnaceFuel && smoker.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::FurnaceOutput && smoker.ptr_eq(inventory) { @@ -849,7 +849,7 @@ impl Window { player, } => { if area == Area::EnchantmentItem && enchantment_table.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::EnchantmentLapis && enchantment_table.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::Storage && player.ptr_eq(inventory) { @@ -865,7 +865,7 @@ impl Window { player, } => { if area == Area::BrewingBottle && brewing_stand.ptr_eq(inventory) { - Some(slot + 0) + 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) { @@ -880,7 +880,7 @@ impl Window { } Window::Beacon { beacon, player } => { if area == Area::BeaconPayment && beacon.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -891,7 +891,7 @@ impl Window { } Window::Anvil { anvil, player } => { if area == Area::AnvilInput1 && anvil.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::AnvilInput2 && anvil.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::AnvilOutput && anvil.ptr_eq(inventory) { @@ -906,7 +906,7 @@ impl Window { } Window::Hopper { hopper, player } => { if area == Area::Storage && hopper.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 4) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -920,7 +920,7 @@ impl Window { player, } => { if area == Area::Storage && shulker_box.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 27) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -934,7 +934,7 @@ impl Window { player, } => { if area == Area::CartographyMap && cartography_table.ptr_eq(inventory) { - Some(slot + 0) + 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) { @@ -949,7 +949,7 @@ impl Window { } Window::Grindstone { grindstone, player } => { if area == Area::GrindstoneInput1 && grindstone.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::GrindstoneInput2 && grindstone.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::GrindstoneOutput && grindstone.ptr_eq(inventory) { @@ -964,7 +964,7 @@ impl Window { } Window::Lectern { lectern, player } => { if area == Area::LecternBook && lectern.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::Storage && player.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::Hotbar && player.ptr_eq(inventory) { @@ -975,7 +975,7 @@ impl Window { } Window::Loom { loom, player } => { if area == Area::LoomBanner && loom.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::LoomDye && loom.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::LoomPattern && loom.ptr_eq(inventory) { @@ -995,7 +995,7 @@ impl Window { player, } => { if area == Area::StonecutterInput && stonecutter.ptr_eq(inventory) { - Some(slot + 0) + Some(slot) } else if area == Area::StonecutterOutput && stonecutter.ptr_eq(inventory) { Some(slot + 1) } else if area == Area::Storage && player.ptr_eq(inventory) { @@ -1052,6 +1052,7 @@ pub enum InventoryBacking { boots: [T; 1], storage: [T; 27], hotbar: [T; 9], + offhand: [T; 1], }, Chest { storage: [T; 27], @@ -1078,6 +1079,7 @@ impl InventoryBacking { boots, storage, hotbar, + offhand, } => match area { Area::CraftingInput => Some(crafting_input.as_ref()), Area::CraftingOutput => Some(crafting_output.as_ref()), @@ -1087,6 +1089,7 @@ impl InventoryBacking { 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 { @@ -1116,7 +1119,7 @@ impl InventoryBacking { pub fn areas(&self) -> &'static [Area] { match self { InventoryBacking::Player { .. } => { - static AREAS: [Area; 8] = [ + static AREAS: [Area; 9] = [ Area::CraftingInput, Area::CraftingOutput, Area::Helmet, @@ -1125,6 +1128,7 @@ impl InventoryBacking { Area::Boots, Area::Storage, Area::Hotbar, + Area::Offhand, ]; &AREAS } @@ -1159,6 +1163,7 @@ impl InventoryBacking { boots: Default::default(), storage: Default::default(), hotbar: Default::default(), + offhand: Default::default(), } } pub fn chest() -> Self diff --git a/libcraft/inventory/src/lib.rs b/libcraft/inventory/src/lib.rs new file mode 100644 index 000000000..a2abc3cb6 --- /dev/null +++ b/libcraft/inventory/src/lib.rs @@ -0,0 +1,113 @@ +mod inventory; + +use parking_lot::{Mutex, MutexGuard}; +use std::{error::Error, sync::Arc}; + +pub use inventory::{Area, InventoryBacking, Window}; + +use libcraft_items::InventorySlot; + +type Slot = Mutex; + +/// A handle to an inventory. +/// +/// An inventory is composed of one or more _areas_, each +/// if which contains one or more item stacks stored in an array. Areas are defined +/// 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 +/// it is cheap and creates a new handle to the same inventory. Interior mutability +/// is used to make this safe. +#[derive(Debug, Clone)] +pub struct Inventory { + backing: Arc>, +} + +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) + } + + /// 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 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 item in items { + let i = item.lock(); + vec.push(i.clone()); + } + } + } + vec + } + + /// Creates a new handle to the same inventory. + /// + /// This operation is the same as calling `clone()`, but it's more explicit + /// in its intent. + pub fn new_handle(&self) -> Inventory { + self.clone() + } +} + +#[derive(Debug)] +pub enum WindowError { + OutOfBounds(usize), +} + +impl std::fmt::Display for WindowError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::OutOfBounds(value) => { + f.write_fmt(format_args!("Slot index {} is out of bounds", value)) + } + } + } +} + +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> { + let (inventory, area, slot) = self + .index_to_slot(index) + .ok_or(WindowError::OutOfBounds(index))?; + inventory + .item(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; + Ok(()) + } + + pub fn to_vec(&self) -> Vec { + let mut i = 0; + let mut vec = Vec::new(); + while let Ok(item) = self.item(i) { + vec.push(item.clone()); + i += 1; + } + vec + } +} diff --git a/libcraft/items/src/enchantment.rs b/libcraft/items/src/enchantment.rs index b6825a525..a06661c8a 100644 --- a/libcraft/items/src/enchantment.rs +++ b/libcraft/items/src/enchantment.rs @@ -5,8 +5,10 @@ use serde::{Deserialize, Serialize}; /// An enchantment attached to an item. #[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Enchantment { + /// The type of the enchantment. #[serde(rename = "id")] kind: EnchantmentKind, + /// Enchantment level, represented by an `i8` for vanilla compatibility #[serde(rename = "lvl")] level: i8, } @@ -21,6 +23,8 @@ impl Enchantment { /// /// The level is capped at `i8::MAX` for compatability /// with Vanilla. + #[must_use] + #[allow(clippy::cast_possible_truncation)] pub fn new(kind: EnchantmentKind, level: u32) -> Self { Self { kind, @@ -29,11 +33,14 @@ impl Enchantment { } /// Gets the kind of this enchantment. - pub fn kind(&self) -> EnchantmentKind { + #[must_use] + pub const fn kind(&self) -> EnchantmentKind { self.kind } /// Gets the level of this enchantment. + #[must_use] + #[allow(clippy::cast_sign_loss)] pub fn level(&self) -> u32 { self.level.max(0) as u32 } @@ -48,6 +55,7 @@ impl Enchantment { /// Sets the level of this enchantment. /// /// The level is capped to `i8::MAX`. + #[allow(clippy::cast_possible_truncation)] pub fn set_level(&mut self, level: u32) { self.level = level.min(i8::MAX as u32) as i8; } diff --git a/libcraft/items/src/inventory_slot.rs b/libcraft/items/src/inventory_slot.rs index 78c681711..7f7e37c2a 100644 --- a/libcraft/items/src/inventory_slot.rs +++ b/libcraft/items/src/inventory_slot.rs @@ -1,9 +1,10 @@ -use crate::item_stack::ItemStackError; -use crate::ItemStack; +use crate::{Item, ItemStack}; use core::mem; +use serde::{Deserialize, Serialize}; /// Represents an Inventory slot. May be empty /// or filled (contains an `ItemStack`). +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub enum InventorySlot { Filled(ItemStack), Empty, @@ -11,40 +12,361 @@ pub enum InventorySlot { impl Default for InventorySlot { fn default() -> Self { - InventorySlot::Empty + Self::Empty + } +} + +impl From> for InventorySlot { + fn from(it: Option) -> Self { + it.map(Self::Filled).unwrap_or_default() + } +} + +impl From for Option { + fn from(it: InventorySlot) -> Self { + it.into_option() } } impl InventorySlot { - /// Tries to take all items from the `InventorySlot`. - /// If the `InventorySlot` is filled returns the `ItemStack`. - /// If the `InventorySlot` is empty returns `None`. - pub fn take_all(&mut self) -> Option { - match mem::take(self) { - Self::Filled(stack) => Some(stack), - Self::Empty => None, - } - } - - /// Tries to take (split) the specified amount from the associated - /// `ItemStack` to this `InventorySlot`. If this `InventorySlot` is - /// empty, the specified amount is zero, or the resulting stack is - /// empty will return the `ItemStackError::EmptyStack` error. If the - /// amount to take is bigger than the current amount it will return - /// the `ItemStackError::NotEnoughAmount` error. On success returns - /// the taken part of the `ItemStack` as a new one. - pub fn take(&mut self, amount: u32) -> Result { - let split = match mem::take(self) { - Self::Empty => return Err(ItemStackError::EmptyStack), - Self::Filled(mut stack) => stack.split(amount), - }; - let (stack, res) = match split { - Ok((original, new)) => (original, Ok(new)), - Err((original, error)) => (Some(original), Err(error)), - }; - if let Some(stack) = stack { - *self = Self::Filled(stack) - } - res + /// Creates a new instance with the type `kind` and `count` items + #[must_use] + #[allow(clippy::missing_panics_doc)] + pub fn new(kind: Item, count: u32) -> Self { + ItemStack::new(kind, count) + .map(Self::Filled) + .unwrap_or_default() + } + + /// If instace of `Self::Filled`, then it returns `Some(stack_size)` + /// where `stack_size` is the biggest number of items allowable + /// for the given item in a stack. + /// If instance of `Self::Empty`, then we can't know the stack + /// size and None is returned. + #[must_use] + pub fn stack_size(&self) -> Option { + self.map_ref(ItemStack::stack_size) + } + + /// Takes all items and makes self empty. + #[must_use] + pub fn take_all(&mut self) -> Self { + mem::take(self) + } + + /// Takes half (rounded down) of the items in self. + #[must_use] + pub fn take_half(&mut self) -> Self { + let half = (self.count() + 1) / 2; + self.try_take(half) + } + + /// Tries to take the specified amount from 'self' + /// and put it into the output. If amount is bigger + /// then what self can provide then this is the same + /// as calling take. + #[must_use] + #[allow(clippy::missing_panics_doc)] + pub fn try_take(&mut self, amount: u32) -> Self { + if amount == 0 { + return Self::Empty; + } + + if let Self::Filled(stack) = self { + if stack.count() <= amount { + // We take all and set self to empty + mem::take(self) + } else { + // We take some of self. + let mut out = stack.clone(); + // `amount` != 0 + out.set_count(amount).unwrap(); + // `stack.count` > amount + stack.remove(amount).unwrap(); + Self::Filled(out) + } + } else { + Self::Empty + } + } + + /// Tries to take the exact specified amount from 'self', + /// but if that is not possible then it returns None. + pub fn take(&mut self, amount: u32) -> Option { + if amount <= self.count() { + Some(self.try_take(amount)) + } else { + None + } + } + + /// Returns the number of items stored in the inventory slot. + #[must_use] + pub fn count(&self) -> u32 { + self.map_ref(ItemStack::count).unwrap_or(0) + } + + /// Should only be called if the caller can guarantee that there is space + /// such that the new could is not greater then `self.stack_size`(). + /// And that the slot actually contains an item. + fn add_count(&mut self, n: u32) { + self.option_mut() + .expect("add count called on empty inventory slot!") + .add(n) + .expect("new item count exceeds stack size"); + } + + /// Transfers up to `n` items from 'self' to `other`. + #[allow(clippy::missing_panics_doc)] + pub fn transfer_to(&mut self, n: u32, other: &mut Self) { + if !self.is_mergable(other) { + return; + } + + match (self.is_filled(), other.is_filled()) { + (true, true) => { + // `other` is guaranteed to be `Filled` + let space_in_other = other.stack_size().unwrap() - other.count(); + let moving = n.min(space_in_other).min(self.count()); + let taken = self.try_take(moving); + other.add_count(taken.count()); + } + (true, false) => { + let taken = self.try_take(n); + *other = taken; + } + (false, _) => {} // No items to move + } + } + + /// Checks if the `InventorySlot` is empty. + #[must_use] + pub const fn is_empty(&self) -> bool { + matches!(self, Self::Empty) + } + + /// Checks if the `InventorySlot` is filled. + #[must_use] + pub const fn is_filled(&self) -> bool { + !self.is_empty() + } + + /// Returns the number of items moved from other to self. + #[allow(clippy::missing_panics_doc)] + pub fn merge(&mut self, other: &mut Self) -> u32 { + if !self.is_mergable(other) { + return 0; + } + match (self.is_filled(), other.is_filled()) { + (true, true) => { + // `self` is `Filled` + let moving = (self.stack_size().unwrap() - self.count()).min(other.count()); + let taken = other.try_take(moving); + self.add_count(taken.count()); + taken.count() + } + (_, false) => 0, + (false, true) => { + mem::swap(self, other); + self.count() + } + } + } + + /// Returns true if either one is empty, or they + /// contain the same `ItemStack` type. Does *not* consider + /// if there is space enough for the move to happen. + #[must_use] + pub fn is_mergable(&self, other: &Self) -> bool { + match (self, other) { + (InventorySlot::Filled(a), InventorySlot::Filled(b)) => a.stackable_types(b), + (InventorySlot::Empty, _) | (_, InventorySlot::Empty) => true, + } + } + + /// Returns the item kind of the inventory slot if it is filled, + /// otherwise it returns None. + #[must_use] + pub fn item_kind(&self) -> Option { + self.map_ref(ItemStack::item) + } + + /// Convert `self` into an `Option` + #[must_use] + pub fn into_option(self) -> Option { + match self { + InventorySlot::Filled(f) => Some(f), + InventorySlot::Empty => None, + } + } + /// Convert a reference to `self` into an `Option<&ItemStack>` + #[must_use] + pub const fn option_ref(&self) -> Option<&ItemStack> { + match self { + InventorySlot::Filled(f) => Some(f), + InventorySlot::Empty => None, + } + } + /// Convert a mutable reference to `self` into an `Option<&mut ItemStack>` + #[must_use] + pub fn option_mut(&mut self) -> Option<&mut ItemStack> { + match self { + InventorySlot::Filled(f) => Some(f), + InventorySlot::Empty => None, + } + } + /// Map `f` over the inner item stack, optionally returning the resulting value. + #[must_use] + pub fn map U, U>(self, f: F) -> Option { + self.into_option().map(f) + } + /// Map `f` over the inner item stack, optionally returning the resulting value. + #[must_use] + pub fn map_ref U, U>(&self, f: F) -> Option { + self.option_ref().map(f) + } + /// Map `f` over the inner item stack, optionally returning the resulting value. + #[must_use] + pub fn map_mut U, U>(&mut self, f: F) -> Option { + self.option_mut().map(f) + } +} + +impl IntoIterator for InventorySlot { + type Item = ItemStack; + + type IntoIter = std::option::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.into_option().into_iter() + } +} +impl<'a> IntoIterator for &'a InventorySlot { + type Item = &'a ItemStack; + + type IntoIter = std::option::IntoIter<&'a ItemStack>; + + fn into_iter(self) -> Self::IntoIter { + self.option_ref().into_iter() + } +} +impl<'a> IntoIterator for &'a mut InventorySlot { + type Item = &'a mut ItemStack; + + type IntoIter = std::option::IntoIter<&'a mut ItemStack>; + + fn into_iter(self) -> Self::IntoIter { + self.option_mut().into_iter() + } +} + +#[cfg(test)] +mod test { + use crate::{InventorySlot, Item}; + + #[test] + fn test_merge() { + let mut a = InventorySlot::new(Item::Stone, 5); + let mut b = InventorySlot::new(Item::Stone, 30); + a.merge(&mut b); + println!("{:?}", a); + assert!(a.is_mergable(&b)); + assert_eq!(a.count(), 35); + assert!(b.is_empty()); + + a = InventorySlot::new(Item::Stone, 60); + b = InventorySlot::new(Item::Stone, 10); + assert_eq!(a.merge(&mut b), 4); + assert_eq!(b.count(), 6); + + a = InventorySlot::new(Item::AcaciaDoor, 1); + b = InventorySlot::new(Item::AcaciaButton, 1); + assert_eq!(a.merge(&mut b), 0); + + a = InventorySlot::new(Item::Stone, 1); + b = InventorySlot::Empty; + assert_eq!(a.merge(&mut b), 0); + + a = InventorySlot::Empty; + b = InventorySlot::new(Item::Stone, 10); + assert_eq!(a.merge(&mut b), 10); + assert!(b.is_empty()); + } + + #[test] + fn take_half() { + let mut a = InventorySlot::new(Item::Stone, 5); + let b = a.take_half(); + assert_eq!(a.count() + b.count(), 5); + assert_eq!(a.count(), 2); + + a = InventorySlot::new(Item::Stone, 1); + let b = a.take_half(); + assert_eq!(a.count(), 0); + assert_eq!(b.count(), 1); + + a = InventorySlot::Empty; + let b = a.take_half(); + assert!(a.is_empty() && b.is_empty()); + } + + #[test] + fn transfer_to() { + let mut a = InventorySlot::new(Item::Stone, 5); + let mut b = InventorySlot::new(Item::Stone, 2); + a.transfer_to(2, &mut b); + assert_eq!(a.count(), 3); + assert_eq!(b.count(), 4); + + a = InventorySlot::new(Item::AcaciaDoor, 3); + b = InventorySlot::new(Item::AcaciaButton, 5); + a.transfer_to(1, &mut b); + assert_eq!(a.count(), 3); + assert_eq!(b.count(), 5); + + a = InventorySlot::new(Item::Stone, 3); + b = InventorySlot::new(Item::Stone, 5); + a.transfer_to(10, &mut b); + assert_eq!(a.count(), 0); + assert_eq!(b.count(), 8); + + a = InventorySlot::new(Item::Stone, 10); + b = InventorySlot::new(Item::Stone, 60); + a.transfer_to(20, &mut b); + assert_eq!(a.count(), 6); + assert_eq!(b.count(), 64); + + a = InventorySlot::new(Item::Stone, 5); + b = InventorySlot::Empty; + a.transfer_to(2, &mut b); + assert_eq!(a.count(), 3); + assert_eq!(b.count(), 2); + + a = InventorySlot::Empty; + b = InventorySlot::new(Item::Stone, 5); + a.transfer_to(2, &mut b); + assert_eq!(a.count(), 0); + assert_eq!(b.count(), 5); + } + + #[test] + fn try_take() { + let mut a = InventorySlot::new(Item::Stone, 64); + assert_eq!(a.try_take(16), InventorySlot::new(Item::Stone, 16)); + assert_eq!(a.try_take(0), InventorySlot::Empty); + assert_eq!(a.try_take(50), InventorySlot::new(Item::Stone, 48)); + assert_eq!(a.try_take(2), InventorySlot::Empty); + a = InventorySlot::new(Item::Stone, 5); + assert_eq!(a.try_take(u32::MAX), InventorySlot::new(Item::Stone, 5)); + } + + #[test] + fn take() { + let mut a = InventorySlot::new(Item::Stone, 64); + assert_eq!(a.take(16), Some(InventorySlot::new(Item::Stone, 16))); + assert_eq!(a.take(0), Some(InventorySlot::Empty)); + assert_eq!(a.take(50), None); + assert_eq!(a.take(48), Some(InventorySlot::new(Item::Stone, 48))); + assert_eq!(a.take(1), None); } } diff --git a/libcraft/items/src/item.rs b/libcraft/items/src/item.rs index db5fa253a..c29fd8b62 100644 --- a/libcraft/items/src/item.rs +++ b/libcraft/items/src/item.rs @@ -7886,11 +7886,9 @@ impl TryFrom for Item { } } -use std::convert::From; - impl From for &'static str { - fn from(item: Item) -> &'static str { - item.name() + fn from(i: Item) -> Self { + i.name() } } diff --git a/libcraft/items/src/item_stack.rs b/libcraft/items/src/item_stack.rs index fdb2fa094..410e6650d 100644 --- a/libcraft/items/src/item_stack.rs +++ b/libcraft/items/src/item_stack.rs @@ -1,9 +1,7 @@ -#![forbid(unsafe_code)] -#![deny(warnings)] - -use crate::{Enchantment, Item}; +use crate::{Enchantment, EnchantmentKind, Item}; use core::fmt::Display; use serde::{Deserialize, Serialize}; +use std::convert::TryInto; use std::error::Error; use std::fmt; use std::num::NonZeroU32; @@ -33,7 +31,7 @@ pub struct ItemStack { /// * Item damage (Optional) /// * Item repair cost (Optional) /// * Item enchantments -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] #[serde(rename_all = "PascalCase")] pub struct ItemStackMeta { /// The displayed title (name) of the associated `ItemStack`. @@ -43,7 +41,7 @@ pub struct ItemStackMeta { lore: String, /// The damage taken by the `ItemStack`. - damage: Option, + damage: Option, /// The cost of repairing the `ItemStack`. repair_cost: Option, @@ -55,17 +53,16 @@ pub struct ItemStackMeta { impl ItemStack { /// Creates a new `ItemStack` with the default name (title) /// no lore, no damage, no repair cost and no enchantments. + /// # Errors + /// Return `ItemStackError::EmptyStack` when `count` is zero. pub fn new(item: Item, count: u32) -> Result { - let count = NonZeroU32::new(count); - if count.is_none() { - return Err(ItemStackError::EmptyStack); - } + let count = NonZeroU32::new(count).ok_or(ItemStackError::EmptyStack)?; Ok(Self { item, - count: count.unwrap(), + count, meta: Some(ItemStackMeta { title: String::from(item.name()), - lore: "".to_string(), + lore: "".to_owned(), damage: None, repair_cost: None, enchantments: vec![], @@ -76,12 +73,14 @@ impl ItemStack { /// Returns whether the given item stack has /// the same type as (but not necessarily the same /// amount as) `self`. + #[must_use] pub fn has_same_type(&self, other: &Self) -> bool { self.item == other.item } /// Returns whether the given item stack has the same damage /// as `self`. + #[must_use] pub fn has_same_damage(&self, other: &Self) -> bool { if let (Some(self_meta), Some(other_meta)) = (self.meta.as_ref(), other.meta.as_ref()) { self_meta.damage == other_meta.damage @@ -93,6 +92,7 @@ impl ItemStack { /// Returns whether the given `ItemStack` has /// the same count as (but not necessarily the same /// type as) `self`. + #[must_use] pub fn has_same_count(&self, other: &Self) -> bool { self.count == other.count } @@ -100,27 +100,34 @@ impl ItemStack { /// Returns whether the given `ItemStack` has the same /// type and count as (but not necessarily the same meta /// as) `self`. + #[must_use] pub fn has_same_type_and_count(&self, other: &Self) -> bool { self.item == other.item && self.count == other.count } /// Returns whether the given `ItemStack` has /// the same type and damage as `self`. + #[must_use] pub fn has_same_type_and_damage(&self, other: &Self) -> bool { self.item == other.item && self.has_same_damage(other) } /// Returns the item type for this `ItemStack`. - pub fn item(&self) -> Item { + #[must_use] + pub const fn item(&self) -> Item { self.item } /// Returns the number of items in this `ItemStack`. - pub fn count(&self) -> u32 { + #[must_use] + pub const fn count(&self) -> u32 { self.count.get() } /// Adds more items to this `ItemStack`. Returns the new count. + /// # Errors + /// Returns `ExceedsStackSize` when the combined amount of items is greater than the stack size. + /// If the new item count cannot be represented as `i32`, returns `ClientOverflow`. pub fn add(&mut self, count: u32) -> Result { self.set_count(self.count.get() + count) } @@ -128,27 +135,29 @@ impl ItemStack { /// Adds more items to this `ItemStack`. Does not check if the /// addition will make the count to be greater than the /// stack size. Does not check count overflows. Returns the new count. + /// # Panics + /// Panics if the new item count is greater than the stack size. pub fn unchecked_add(&mut self, count: u32) -> u32 { self.count = NonZeroU32::new(self.count.get() + count).unwrap(); self.count.get() } - /// Removes some items from this `ItemStack`. + /// Removes some items from this `ItemStack` and return the new item count. + /// # Errors + /// Returns `NotEnoughItems` if the new stack would be empty. + #[allow(clippy::missing_panics_doc)] pub fn remove(&mut self, count: u32) -> Result { if self.count.get() <= count { - return Err(if self.count.get() == count { - ItemStackError::EmptyStack - } else { - ItemStackError::NotEnoughAmount - }); + return Err(ItemStackError::NotEnoughItems); } + // Cannot panic because `self.count` > `count` at this point self.count = NonZeroU32::new(self.count.get() - count).unwrap(); Ok(self.count.get()) } - /// Sets the item type for this `ItemStack`. Returns the new - /// item type or fails if the current item count exceeds the - /// new item type stack size. + /// Change the item type for this `ItemStack` and return the new item. + /// # Errors + /// Returns `ExceedsStackSize` when the new item's stack size is lower than the current amount of items. pub fn set_item(&mut self, item: Item) -> Result { if self.count.get() > item.stack_size() { return Err(ItemStackError::ExceedsStackSize); @@ -157,6 +166,16 @@ impl ItemStack { Ok(self.item) } + /// Gets the `ItemStack` and returns it. + #[allow(clippy::missing_panics_doc)] + #[must_use] + pub fn get_item(&self) -> Self { + Self { + count: 1.try_into().unwrap(), + ..self.clone() + } + } + /// Sets the item type for this `ItemStack`. Does not check if /// the new item type stack size will be lower than the current /// item count. Returns the new item type. @@ -165,28 +184,27 @@ impl ItemStack { self.item } - /// Sets the count for this `ItemStack`. Returns the updated - /// count or fails if the new count would exceed the stack - /// size for that item type. + /// Sets the count for this `ItemStack` and returns the updated count. + /// # Errors + /// Returns `EmptyStack` when `count` is zero and `ExceedsStackSize` when `count` is greater than this item's stack size. + /// If the new item count cannot be represented as `i32`, returns `ClientOverflow`. pub fn set_count(&mut self, count: u32) -> Result { - let count = NonZeroU32::new(count); - if count.is_none() { - return Err(ItemStackError::EmptyStack); - } - let count = count.unwrap(); + let count = NonZeroU32::new(count).ok_or(ItemStackError::EmptyStack)?; if count.get() > self.item.stack_size() { - return Err(ItemStackError::ExceedsStackSize); + Err(ItemStackError::ExceedsStackSize) } else if count.get() > i32::MAX as u32 { - return Err(ItemStackError::ClientOverflow); + Err(ItemStackError::ClientOverflow) + } else { + self.count = count; + Ok(self.count.get()) } - self.count = count; - Ok(self.count.get()) } - /// Sets the count for this `ItemStack`. It will not check if - /// the desired count exceeds the current item type stack size. - /// Does not check count overflows or if the parameter is zero. + /// Sets the count for this `ItemStack`. Does not check if + /// the desired count exceeds the current item type stack size, nor whether it overflows. /// Returns the updated count. + /// # Panics + /// Panics if `count` is zero. pub fn unchecked_set_count(&mut self, count: u32) -> u32 { self.count = NonZeroU32::new(count).unwrap(); self.count.get() @@ -196,74 +214,101 @@ impl ItemStack { /// removed half. If the amount is odd, `self` /// will be left with the least items. Returns the taken /// half. - pub fn split_half(&mut self) -> (Option, ItemStack) { - self.split((self.count.get() + 1) / 2).unwrap() + #[must_use] + #[allow(clippy::missing_panics_doc)] + pub fn take_half(self) -> (Option, Self) { + let half = (self.count.get() + 1) / 2; + // Cannot panic because `half` is always > 0; `self.count` >= 1 -> At minimum (1 + 1) / 2 = 1 + self.take(NonZeroU32::new(half).unwrap()) } /// Splits this `ItemStack` by removing the /// specified amount. Returns the taken part. - pub fn split( - &mut self, - amount: u32, - ) -> Result<(Option, ItemStack), (ItemStack, ItemStackError)> { - let amount = NonZeroU32::new(amount); - if amount.is_none() { - return Err((self.clone(), ItemStackError::EmptyStack)); - } - let amount = amount.unwrap(); - if self.count < amount { - return Err((self.clone(), ItemStackError::NotEnoughAmount)); + #[must_use] + #[allow(clippy::missing_panics_doc)] + pub fn take(mut self, amount: NonZeroU32) -> (Option, Self) { + if self.count <= amount { + return (None, self); } let count_left: u32 = self.count.get() - amount.get(); - let taken = ItemStack { + let taken = Self { count: amount, ..self.clone() }; + // Cannot panic because `self.count` > `amount` -> `self.count` - `amount` > 0 self.count = NonZeroU32::new(count_left).unwrap(); - Ok(( - if count_left == 0 { - None - } else { - Some(self.clone()) - }, - taken, - )) + (Some(self), taken) } /// Merges another `ItemStack` with this one. - pub fn merge_with(&mut self, other: &mut Self) -> Result<(), ItemStackError> { + /// # Errors + /// Returns `IncompatibleStacks` when the two stacks have different item types. + #[allow(clippy::missing_panics_doc)] + pub fn merge_with(&mut self, other: &Self) -> Result<(), ItemStackError> { if !self.has_same_type_and_damage(other) { return Err(ItemStackError::IncompatibleStacks); } let new_count = (self.count.get() + other.count.get()).min(self.item.stack_size()); - let amount_added = new_count - self.count.get(); + // Cannot panic because `self.count` > 0 and `other.count` > 0 -> `self.count` + `other.count` > 0 self.count = NonZeroU32::new(new_count).unwrap(); - other.count = NonZeroU32::new(other.count() - amount_added).unwrap(); + //other.count = NonZeroU32::new(other.count() - amount_added).unwrap(); Ok(()) } /// Transfers up to `n` items to `other`. + /// # Errors + /// Returns `NotEnoughItems` when there aren't enough items to complete the transfer. + /// If the new item count in `other` cannot be represented by `i32`, returns `ClientOverflow`. + #[allow(clippy::missing_panics_doc)] pub fn transfer_to(&mut self, n: u32, other: &mut Self) -> Result<(), ItemStackError> { if self.count.get() <= n || n == 0 { - return Err(if self.count.get() == n || n == 0 { - ItemStackError::EmptyStack - } else { - ItemStackError::NotEnoughAmount - }); + return Err(ItemStackError::NotEnoughItems); } let max_transfer = other.item.stack_size().saturating_sub(other.count.get()); let transfer = max_transfer.min(self.count.get()).min(n); if other.count.get() + transfer > i32::MAX as u32 { return Err(ItemStackError::ClientOverflow); } - self.count = NonZeroU32::new(transfer).unwrap(); + + self.count = NonZeroU32::new(self.count.get() - transfer).unwrap(); other.count = NonZeroU32::new(other.count.get() + transfer).unwrap(); Ok(()) } + /// Move up to `n` items from `self` to `other`. + /// # Errors + /// Returns `IncompatibleStacks` when the two item stacks have different items. + #[allow(clippy::missing_panics_doc)] + pub fn drain_into_bounded( + mut self, + n: u32, + other: &mut Self, + ) -> Result, ItemStackError> { + if !self.has_same_type(other) { + return Err(ItemStackError::IncompatibleStacks); + } + + // Stack size is the same for both self and other because they are the same type. + let stack_size = self.item.stack_size(); + let space_in_other = stack_size - other.count(); + let items_in_self = self.count(); + let moving_items = space_in_other.min(n).min(items_in_self); + + // Guaranteed to be <`self.stack_size` because of `space_in_other` being one of the minimums + other.set_count(moving_items + other.count()).unwrap(); + + if items_in_self - moving_items == 0 { + Ok(None) + } else { + self.set_count(items_in_self - moving_items).unwrap(); + Ok(Some(self)) + } + } + /// Damages the item by the specified amount. /// If this function returns `true`, then the item is broken. - pub fn damage(&mut self, amount: u32) -> bool { + #[allow(clippy::missing_panics_doc)] + pub fn damage(&mut self, amount: i32) -> bool { if self.meta.is_none() { return false; } @@ -271,7 +316,8 @@ impl ItemStack { Some(damage) => { *damage += amount; if let Some(durability) = self.item.durability() { - *damage >= durability + // Convert to a larger type for a safe conversion + i64::from(*damage) >= i64::from(durability) } else { false } @@ -279,6 +325,32 @@ impl ItemStack { None => false, } } + + /// Returns the amount of damage the items have taken. + #[must_use] + pub fn damage_taken(&self) -> Option { + self.meta.as_ref().map_or(Some(0), |meta| meta.damage) + } + + /// Returns true is the contents of other could be merged with the contents + /// of self. This does not look at the item count, just the kind. + /// Items can be merged when they have the same kind, damage, and enchantment. + /// If a item has a stacksize of one then it can never be stacked. + #[must_use] + pub fn stackable_types(&self, other: &Self) -> bool { + self.has_same_type(other) && + // Todo: make this function check that the items have same name + // if you rename a item, then it does not stack with items that + // dont share the rename. Someone need to explore this further. + self.stack_size() > 1 && + other.stack_size() > 1 + } + + /// How many items could be stacked together + #[must_use] + pub fn stack_size(&self) -> u32 { + self.item.stack_size() + } } /// An error type that may be returned when performing @@ -289,13 +361,170 @@ pub enum ItemStackError { EmptyStack, ExceedsStackSize, IncompatibleStacks, - NotEnoughAmount, + NotEnoughItems, } impl Display for ItemStackError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", self) + write!(f, "{:?}", self) } } impl Error for ItemStackError {} + +impl ItemStackMeta { + #[must_use] + pub fn new(item: Item) -> Self { + Self { + title: item.display_name().to_owned(), + lore: "".to_owned(), + damage: None, + repair_cost: None, + enchantments: vec![], + } + } + + /// Get the level of the given enchantment. + pub fn get_enchantment_level(&self, ench: EnchantmentKind) -> Option { + self.enchantments + .iter() + .find(|e| e.kind() == ench) + .map(Enchantment::level) + } + /// Change the level of the given enchantment in-place or add it at the end of the list. + pub fn set_enchantment_level(&mut self, ench: EnchantmentKind, level: u32) { + if let Some(enchant) = self.enchantments.iter_mut().find(|e| e.kind() == ench) { + enchant.set_level(level); + } else { + self.enchantments.push(Enchantment::new(ench, level)); + } + } +} + +pub struct ItemStackBuilder { + item: Item, + count: NonZeroU32, + meta: Option, +} + +impl Default for ItemStackBuilder { + fn default() -> Self { + Self { + item: Item::Stone, + count: 1.try_into().unwrap(), + meta: None, + } + } +} + +impl ItemStackBuilder { + #[must_use] + #[allow(clippy::missing_panics_doc)] + pub fn new() -> Self { + Self { + item: Item::Stone, + count: 1.try_into().unwrap(), + meta: None, + } + } + + #[must_use] + #[allow(clippy::missing_panics_doc)] + pub fn with_item(item: Item) -> Self { + Self { + item, + count: 1.try_into().unwrap(), + meta: None, + } + } + + #[must_use] + pub fn item(self, item: Item) -> Self { + Self { item, ..self } + } + + /// Set the item `count`. + /// # Panics + /// Panics if `count` is zero. + #[must_use] + pub fn count(self, count: u32) -> Self { + Self { + count: count.try_into().expect("`count` cannot be zero"), + ..self + } + } + + /// Set the item `title`. + #[must_use] + pub fn title(mut self, title: impl AsRef) -> Self { + self.get_or_init_meta().title = title.as_ref().to_owned(); + self + } + + /// Set the item `lore`. + #[must_use] + pub fn lore(mut self, lore: impl AsRef) -> Self { + self.get_or_init_meta().lore = lore.as_ref().to_owned(); + self + } + + /// Set the item's repair cost metadata to `repair_cost`. + #[must_use] + pub fn repair_cost(mut self, cost: u32) -> Self { + self.get_or_init_meta().repair_cost = Some(cost); + self + } + + /// Set the item's damage metadata to `damage`. + #[must_use] + pub fn damage(mut self, damage: i32) -> Self { + self.get_or_init_meta().damage = Some(damage); + self + } + + /// Set the item's enchantment metadata to `enchantments` + #[must_use] + pub fn enchantments(mut self, enchantments: Vec) -> Self { + self.get_or_init_meta().enchantments = enchantments; + self + } + + /// If `damage` is some, then its value is applied, else this is a no-op. + #[must_use] + pub fn apply_damage(self, damage: Option) -> Self { + match damage { + Some(damage) => self.damage(damage), + None => self, + } + } + + /// Copy metadate from another item. + #[must_use] + pub fn copy_meta(mut self, other: &Self) -> Self { + self.meta = other.meta.clone(); + self + } + + /// Placeholder for the `Option::get_or_insert_default` funcion, setting the default item name. + fn get_or_init_meta(&mut self) -> &mut ItemStackMeta { + if let Some(ref mut s) = self.meta { + s + } else { + self.meta = Some(ItemStackMeta { + title: self.item.display_name().to_owned(), + ..ItemStackMeta::default() + }); + self.meta.as_mut().unwrap() + } + } +} + +impl From for ItemStack { + fn from(it: ItemStackBuilder) -> Self { + Self { + item: it.item, + count: it.count, + meta: it.meta, + } + } +} diff --git a/libcraft/items/src/lib.rs b/libcraft/items/src/lib.rs index 0333954c4..1fe70d299 100644 --- a/libcraft/items/src/lib.rs +++ b/libcraft/items/src/lib.rs @@ -1,3 +1,10 @@ +#![forbid(unsafe_code)] +#![deny(warnings)] +#![warn(clippy::pedantic)] +#![allow(clippy::module_name_repetitions)] + +//! Libcraft crate for item manipulation. + mod enchantment; mod inventory_slot; mod item; @@ -6,4 +13,4 @@ mod item_stack; pub use enchantment::{Enchantment, EnchantmentKind}; pub use inventory_slot::InventorySlot; pub use item::*; -pub use item_stack::ItemStack; +pub use item_stack::{ItemStack, ItemStackBuilder, ItemStackError, ItemStackMeta}; diff --git a/libcraft/text/src/text.rs b/libcraft/text/src/text.rs index c72cee335..90af776de 100644 --- a/libcraft/text/src/text.rs +++ b/libcraft/text/src/text.rs @@ -316,7 +316,7 @@ impl<'a> From<&Translate> for String { } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -#[serde(tag = "action", content = "value")] +#[serde(tag = "action", content = "value", rename_all = "snake_case")] // TODO: Accept any json primitive as string pub enum Click { OpenUrl(Cow<'static, str>), @@ -1138,14 +1138,14 @@ mod tests { #[test] fn text_text_color() -> Result<(), Box> { - let text_orignal: Text = Text::from("hello world") * Color::DarkRed; + let text_original: Text = Text::from("hello world") * Color::DarkRed; - let text_json = serde_json::to_string(&text_orignal)?; + let text_json = serde_json::to_string(&text_original)?; assert_eq!(&text_json, r#"{"text":"hello world","color":"dark_red"}"#); let text: Text = serde_json::from_str(&text_json)?; - assert_eq!(text_orignal, text); + assert_eq!(text_original, text); Ok(()) } @@ -1201,4 +1201,17 @@ mod tests { assert_eq!(root_json, r#"{"text":"hello"}"#); } + + #[test] + fn text_hover_and_click() -> Result<(), Box> { + let text = Text::from("hello") + .on_hover_show_text("hover") + .on_click_run_command("/say hello"); + assert_eq!( + serde_json::to_string(&text)?, + r#"{"text":"hello","clickEvent":{"action":"run_command","value":"/say hello"},"hoverEvent":{"action":"show_text","value":"hover"}}"# + ); + + Ok(()) + } } diff --git a/libcraft/text/src/text/markdown/lexer.rs b/libcraft/text/src/text/markdown/lexer.rs index 848918935..27e003e3b 100644 --- a/libcraft/text/src/text/markdown/lexer.rs +++ b/libcraft/text/src/text/markdown/lexer.rs @@ -139,7 +139,7 @@ impl<'a> InputIter for Tokens<'a> { where P: Fn(Self::Item) -> bool, { - self.tok.iter().position(|b| predicate(b)) + self.tok.iter().position(predicate) } fn slice_index(&self, count: usize) -> Option { diff --git a/libcraft/text/src/text/markdown/parser.rs b/libcraft/text/src/text/markdown/parser.rs index c4e502b76..60ba2d9c5 100644 --- a/libcraft/text/src/text/markdown/parser.rs +++ b/libcraft/text/src/text/markdown/parser.rs @@ -84,8 +84,8 @@ pub fn tokens_to_text(tokens: Vec) -> Token { for tok in &tokens { match &tok.tok { - LexTokenType::Word(word) => s.push_str(&word), - LexTokenType::Space(space) => s.push_str(&space), + LexTokenType::Word(word) => s.push_str(word), + LexTokenType::Space(space) => s.push_str(space), _ => unreachable!(), } } diff --git a/libcraft/text/src/text/markdown/translator.rs b/libcraft/text/src/text/markdown/translator.rs index e8de1030c..4382cbce0 100644 --- a/libcraft/text/src/text/markdown/translator.rs +++ b/libcraft/text/src/text/markdown/translator.rs @@ -90,7 +90,7 @@ pub fn apply_tokens(tokens: Vec) -> Result { - let ty = parse_event_type_word(&event_name); + let ty = parse_event_type_word(event_name); match &call.args { Some(v) => { let action = parse_event_action_word(&v[0]); diff --git a/libcraft/text/src/title.rs b/libcraft/text/src/title.rs index fc9460e39..a77c4782f 100644 --- a/libcraft/text/src/title.rs +++ b/libcraft/text/src/title.rs @@ -1,10 +1,11 @@ +use crate::Text; use serde::{Deserialize, Serialize}; // Based on https://wiki.vg/index.php?title=Protocol&oldid=16459#Title -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] pub struct Title { - pub title: Option, - pub sub_title: Option, + pub title: Option, + pub sub_title: Option, pub fade_in: u32, pub stay: u32, pub fade_out: u32, @@ -27,15 +28,3 @@ impl Title { fade_out: 0, }; } - -impl Default for Title { - fn default() -> Self { - Title { - title: None, - sub_title: None, - fade_in: 0, - stay: 0, - fade_out: 0, - } - } -} diff --git a/proxy/Cargo.toml b/proxy/Cargo.toml new file mode 100644 index 000000000..e739e7555 --- /dev/null +++ b/proxy/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "proxy" +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" +colored = "2.0.0" +time = { version = "0.3", features = ["local-offset", "formatting", "macros"] } diff --git a/tools/proxy/README.md b/proxy/README.md similarity index 58% rename from tools/proxy/README.md rename to proxy/README.md index 69b6c9ec5..cf14e7075 100644 --- a/tools/proxy/README.md +++ b/proxy/README.md @@ -1,5 +1,3 @@ -### minecraft-proxy - A simple proxy for use during development. It proxies a connection between client and server and prints out packets going over the network. @@ -10,16 +8,16 @@ over the protocol. To set up the proxy with a vanilla server and client: -* Start the vanilla 1.16.3 server. Make sure to set `network-compression-threshold=-1` and `online-mode=false` -or the proxy will not work for the time being. -* Run the proxy with `cargo run --bin minecraft-proxy -- --port 25577 --server-port 25565`. +* Start the vanilla 1.16.5 server. Make sure to set `online-mode=false` + or the proxy will not work for the time being. +* Run the proxy with `cargo run --bin proxy -- --proxy-address 127.0.0.1:25577 --server-address 127.0.0.1:25565`. * Connect your client to `localhost:25577`. To set up the proxy with feather server: * Build and start feather (See main [`README.md`](../../README.md)) -* In the `config.toml` set `online_mode = false` and `compression_threshold = -1`. -* Run the proxy with `cargo run --bin minecraft-proxy -- --port 25577 --server-port 25565`. +* In the `config.toml` set `online_mode = false`. +* Run the proxy with `cargo run --bin proxy -- --proxy-address 127.0.0.1:25577 --server-address 127.0.0.1:25565`. * Connect your client to `localhost:25577`. The proxy supports multiple client connections, in case you need diff --git a/proxy/src/main.rs b/proxy/src/main.rs new file mode 100644 index 000000000..161e747c5 --- /dev/null +++ b/proxy/src/main.rs @@ -0,0 +1,366 @@ +use std::fmt::{Display, Formatter}; +use std::io::{Read, Write}; +use std::net::SocketAddr; +use std::net::{TcpListener, TcpStream}; +use std::num::ParseIntError; +use std::sync::{Arc, Mutex}; + +use anyhow::Context; +use clap::{ArgEnum, Parser}; +use colored::Colorize; +use log::{Level, LevelFilter}; +use time::macros::format_description; +use time::OffsetDateTime; + +use feather_protocol::codec::CompressionThreshold; +use feather_protocol::packets::client::HandshakeState; +use feather_protocol::{ + ClientHandshakePacket, ClientPacket, ClientPacketCodec, ProtocolState, ServerLoginPacket, + ServerPacket, ServerPacketCodec, VarInt, +}; + +/// A simple proxy server that logs transmitted packets +#[derive(Parser)] +#[clap(about, version)] +struct Args { + /// The Minecraft server address (ip:port) + #[clap(short = 'a', long)] + server_address: SocketAddr, + /// The address that the proxy should listen on (ip:port) + #[clap(short, long)] + proxy_address: SocketAddr, + /// Only log clientside/serverside packets + #[clap(arg_enum, short, long, default_value_t)] + side: ConnectionSide, + /// Show the contents of the packets. `-vv` will also display hexdump + #[clap(short, long, parse(from_occurrences))] + verbose: usize, + /// Don't log packets with the specified IDs (hexadecimal, comma-separated) + #[clap(short, long, use_delimiter = true, parse(try_from_str = parse_hex), conflicts_with = "whitelist")] + blacklist: Option>, + /// Log only packets with the specified IDs (hexadecimal, comma-separated) + #[clap(short, long, use_delimiter = true, parse(try_from_str = parse_hex), conflicts_with = "blacklist")] + whitelist: Option>, +} + +fn parse_hex(src: &str) -> Result { + u32::from_str_radix(src, 16) +} + +#[derive(ArgEnum, Copy, Clone)] +enum ConnectionSide { + Client, + Server, + Both, +} + +impl Default for ConnectionSide { + fn default() -> Self { + ConnectionSide::Both + } +} + +fn main() { + let args: Args = Args::parse(); + fern::Dispatch::new() + .format(|out, message, record| { + let level_string = match record.level() { + Level::Error => record.level().to_string().red(), + Level::Warn => record.level().to_string().yellow(), + Level::Info => record.level().to_string().cyan(), + Level::Debug => record.level().to_string().purple(), + Level::Trace => record.level().to_string().normal(), + }; + let target = if !record.target().is_empty() { + record.target() + } else { + record.module_path().unwrap_or_default() + }; + let datetime: OffsetDateTime = + OffsetDateTime::now_local().unwrap_or_else(|_| OffsetDateTime::now_utc()); + out.finish(format_args!( + "{} {:<5} [{}] {}", + datetime + .format(format_description!( + "[year]-[month]-[day] [hour]:[minute]:[second],[subsecond digits:3]" + )) + .unwrap(), + level_string, + target, + message, + )); + }) + .level(match args.verbose { + 0 => LevelFilter::Info, + 1 => LevelFilter::Debug, + _ => LevelFilter::Trace, + }) + .chain(std::io::stdout()) + .apply() + .unwrap(); + + let listener = TcpListener::bind(args.proxy_address).unwrap(); + + log::info!("Listening on {}", args.proxy_address); + while let Ok((client, addr)) = listener.accept() { + log::info!("Accepting connection from {}", addr); + + let server = match TcpStream::connect(args.server_address) { + Ok(server) => server, + Err(err) => { + log::error!( + "failed to connect to server at {}: {}", + args.server_address, + err + ); + continue; + } + }; + + let connection = Arc::new(Mutex::new(Connection { + username: None, + client_codec: ClientPacketCodec::new(), + server_codec: ServerPacketCodec::new(), + })); + + let client_read = client; + let client_write = client_read.try_clone().unwrap(); + let server_read = server; + let server_write = server_read.try_clone().unwrap(); + + std::thread::spawn({ + let connection = connection.clone(); + let blacklist = args.blacklist.clone(); + let whitelist = args.whitelist.clone(); + move || match handle_client( + matches!(args.side, ConnectionSide::Both | ConnectionSide::Client), + blacklist, + whitelist, + &connection, + client_read, + server_write, + ) { + Ok(()) => { + log::info!( + "{}: client disconnected", + connection + .lock() + .unwrap() + .username + .clone() + .unwrap_or_default() + ); + } + Err(err) => { + log::error!("Client error: {:?}", err); + } + } + }); + + std::thread::spawn({ + let connection = connection.clone(); + let blacklist = args.blacklist.clone(); + let whitelist = args.whitelist.clone(); + move || match handle_server( + matches!(args.side, ConnectionSide::Both | ConnectionSide::Server), + blacklist, + whitelist, + &connection, + server_read, + client_write, + ) { + Ok(()) => { + log::info!( + "{}: server disconnected", + connection + .lock() + .unwrap() + .username + .clone() + .unwrap_or_default() + ) + } + Err(err) => { + log::error!("Server error: {:?}", err); + } + } + }); + } +} + +struct Connection { + /// The client's username. + username: Option, + client_codec: ClientPacketCodec, + server_codec: ServerPacketCodec, +} + +impl Connection { + fn set_state(&mut self, state: ProtocolState) { + log::info!( + "{}: switching to state {:?}", + self.username.clone().unwrap_or_default(), + state + ); + self.client_codec.set_state(state); + self.server_codec.set_state(state); + } + + fn set_compression(&mut self, threshold: CompressionThreshold) { + self.client_codec.set_compression(threshold); + self.server_codec.set_compression(threshold); + } +} + +#[derive(Clone)] +struct PlayerName(String); + +impl Default for PlayerName { + fn default() -> Self { + PlayerName("".to_string()) + } +} + +impl Display for PlayerName { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.write_str(&self.0) + } +} + +fn handle_client( + log: bool, + blacklist: Option>, + whitelist: Option>, + connection: &Arc>, + mut client_read: TcpStream, + mut server_write: TcpStream, +) -> anyhow::Result<()> { + loop { + let length = VarInt::read_from(&mut client_read) + .map(|var_int| var_int.0) + .unwrap_or_default(); + if length == 0 { + break; + } + let mut buf = vec![0; length as usize]; + client_read.read_exact(&mut buf)?; + let mut vec = Vec::new(); + VarInt(length).write_to(&mut vec)?; + vec.extend(buf); + if vec.is_empty() { + break; + } + + 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)); + } + + // 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(()) +} + +fn handle_server( + log: bool, + blacklist: Option>, + whitelist: Option>, + connection: &Arc>, + mut server_read: TcpStream, + mut client_write: TcpStream, +) -> anyhow::Result<()> { + loop { + let length = VarInt::read_from(&mut server_read) + .map(|var_int| var_int.0) + .unwrap_or_default(); + if length == 0 { + break; + } + let mut buf = vec![0; length as usize]; + server_read.read_exact(&mut buf)?; + let mut vec = Vec::new(); + VarInt(length).write_to(&mut vec)?; + vec.extend(buf); + if vec.is_empty() { + break; + } + + 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); + } + // 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)?; + } + } + Ok(()) +} + +fn hide(packet_id: u32, blacklist: Option<&Vec>, whitelist: Option<&Vec>) -> bool { + if let Some(blacklist) = blacklist { + blacklist.contains(&packet_id) + } else if let Some(whitelist) = whitelist { + !whitelist.contains(&packet_id) + } else { + false + } +} diff --git a/quill/api/Cargo.toml b/quill/api/Cargo.toml index 387239dba..33dfdc59c 100644 --- a/quill/api/Cargo.toml +++ b/quill/api/Cargo.toml @@ -5,6 +5,7 @@ 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" } @@ -15,4 +16,6 @@ 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 new file mode 100644 index 000000000..b16c64f64 --- /dev/null +++ b/quill/api/plugin-macro/Cargo.toml @@ -0,0 +1,11 @@ +[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 new file mode 100644 index 000000000..15ef5b4ed --- /dev/null +++ b/quill/api/plugin-macro/src/lib.rs @@ -0,0 +1,108 @@ +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/entity.rs b/quill/api/src/entity.rs index 2c7afb148..5d2ddcaa7 100644 --- a/quill/api/src/entity.rs +++ b/quill/api/src/entity.rs @@ -1,3 +1,4 @@ +use libcraft_text::Text; use std::{marker::PhantomData, ptr}; use quill_common::{Component, Pointer, PointerMut}; @@ -70,11 +71,11 @@ impl Entity { } } - /// Sets or replaces a component of this entity. + /// Inserts or replaces a component of this entity. /// /// If the entity already has this component, /// the component is overwritten. - pub fn set(&self, component: T) { + pub fn insert(&self, component: T) { let host_component = T::host_component(); let bytes = component.to_cow_bytes(); @@ -88,12 +89,30 @@ impl Entity { } } + /// 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 AsRef) { - let message = message.as_ref(); + 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) } @@ -101,7 +120,7 @@ impl Entity { /// Sends the given title to this entity. pub fn send_title(&self, title: &libcraft_text::Title) { - let title = bincode::serialize(title).expect("failed to serialize 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); } diff --git a/quill/api/src/game.rs b/quill/api/src/game.rs index 751e81d0a..7fd5657c8 100644 --- a/quill/api/src/game.rs +++ b/quill/api/src/game.rs @@ -4,6 +4,7 @@ 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}, @@ -40,7 +41,7 @@ pub struct Game { impl Game { /// For Quill internal use only. Do not call. #[doc(hidden)] - #[allow(clippy::clippy::new_without_default)] + #[allow(clippy::new_without_default)] pub fn new() -> Self { Self { _not_send_sync: PhantomData, @@ -109,7 +110,7 @@ impl Game { /// println!("Found an entity with position {:?} and UUID {}", position, uuid); /// } /// ``` - pub fn query(&self) -> QueryIter { + pub fn query(&mut self) -> QueryIter { QueryIter::new() } @@ -218,6 +219,16 @@ impl Game { ) } } + + /// 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> { diff --git a/quill/api/src/lib.rs b/quill/api/src/lib.rs index 727e80599..3334382ad 100644 --- a/quill/api/src/lib.rs +++ b/quill/api/src/lib.rs @@ -32,6 +32,8 @@ 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. @@ -55,98 +57,3 @@ pub trait Plugin: Sized { /// the server is shutting down when this method is called. fn disable(self, game: &mut Game); } - -/// Invoke this macro in your plugin's main.rs. -/// -/// Give it the name of your struct implementing `Plugin`. -/// -/// # Example -/// ```no_run -/// // main.rs -/// use quill::{Plugin, Setup, Game}; -/// -/// quill::plugin!(MyPlugin); -/// -/// 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... -/// } -/// } -/// ``` -#[macro_export] -macro_rules! plugin { - ($plugin:ident) => { - // `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<$plugin> = 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: $plugin = - quill::Plugin::enable(&mut $crate::Game::new(), &mut $crate::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> = - $crate::bincode::deserialize(vtable_bytes).expect("invalid vtable"); - - $crate::sys::init_host_context(context); - $crate::sys::init_host_vtable(&vtable) - .expect("invalid vtable (check that the plugin and host are up to date)"); - - let plugin: $plugin = - quill::Plugin::enable(&mut $crate::Game::new(), &mut $crate::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 $crate::Game::new()); - } - - /// Never called by Quill, but this is needed - /// to avoid linker errors with WASI. - #[doc(hidden)] - fn main() {} - }; -} diff --git a/quill/api/src/query.rs b/quill/api/src/query.rs index 64da4919e..3602c25cc 100644 --- a/quill/api/src/query.rs +++ b/quill/api/src/query.rs @@ -1,9 +1,15 @@ //! Query for all entities with a certain set of components. -use std::{marker::PhantomData, mem::MaybeUninit}; +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. @@ -11,9 +17,12 @@ use crate::{Entity, EntityId}; /// 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. @@ -24,7 +33,8 @@ pub trait Query { data: &QueryData, component_index: &mut usize, component_offsets: &mut [usize], - ) -> Self::Item; + entity: Entity, + ) -> Self::Target; } impl<'a, T> Query for &'a T @@ -33,16 +43,22 @@ where [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], - ) -> T { + _: 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(); @@ -62,20 +78,69 @@ where } } +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]) -> Self::Item { + 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) + $query::get_unchecked(data, component_index, component_offsets, Entity::new(entity.id())) ),* ) } @@ -112,6 +177,15 @@ where 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( @@ -138,26 +212,60 @@ impl Iterator for QueryIter where Q: Query, { - type Item = (Entity, Q::Item); + 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()), ) }; - let entity_id = unsafe { *(self.data.entities_ptr.as_mut_ptr()).add(self.entity_index) }; - let entity = Entity::new(EntityId(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 index 0e6e83128..0b555b25f 100644 --- a/quill/api/src/setup.rs +++ b/quill/api/src/setup.rs @@ -12,7 +12,7 @@ pub struct Setup { impl Setup { /// For Quill internal use only. Do not call. #[doc(hidden)] - #[allow(clippy::clippy::new_without_default)] + #[allow(clippy::new_without_default)] pub fn new() -> Self { Self { _marker: PhantomData, diff --git a/quill/cargo-quill/src/main.rs b/quill/cargo-quill/src/main.rs index 7d3e2f7ee..404c76118 100644 --- a/quill/cargo-quill/src/main.rs +++ b/quill/cargo-quill/src/main.rs @@ -72,8 +72,8 @@ impl Build { } 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 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 { "" }; diff --git a/quill/common/Cargo.toml b/quill/common/Cargo.toml index c03eb0166..a01736a76 100644 --- a/quill/common/Cargo.toml +++ b/quill/common/Cargo.toml @@ -7,6 +7,7 @@ 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" } diff --git a/quill/common/src/component.rs b/quill/common/src/component.rs index 9d80223ea..11e4c4651 100644 --- a/quill/common/src/component.rs +++ b/quill/common/src/component.rs @@ -188,8 +188,24 @@ host_component_enum! { 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, } } @@ -352,3 +368,12 @@ 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/components.rs b/quill/common/src/components.rs index 3d6cec3d8..352c45b69 100644 --- a/quill/common/src/components.rs +++ b/quill/common/src/components.rs @@ -3,16 +3,26 @@ //! See the [entities module](crate::entities) for entity-specific //! components. -use std::{ - fmt::Display, - ops::{Deref, DerefMut}, -}; +use std::fmt::Display; use serde::{Deserialize, Serialize}; use smartstring::{LazyCompact, SmartString}; +use libcraft_core::Gamemode; + /// Whether an entity is touching the ground. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Deref, + derive_more::DerefMut, +)] pub struct OnGround(pub bool); bincode_component_impl!(OnGround); @@ -24,7 +34,7 @@ bincode_component_impl!(OnGround); /// /// Non-player entities cannot have this component. See [`CustomName`] /// if you need to name an entity. -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize, derive_more::Deref)] pub struct Name(SmartString); bincode_component_impl!(Name); @@ -39,14 +49,6 @@ impl Name { } } -impl Deref for Name { - type Target = str; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - impl Display for Name { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { self.0.fmt(f) @@ -59,7 +61,7 @@ impl Display for Name { /// will give it a custom name, visible on the client. /// /// Giving a player a custom name has no effect. -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize, derive_more::Deref, derive_more::DerefMut)] pub struct CustomName(SmartString); bincode_component_impl!(CustomName); @@ -79,33 +81,206 @@ impl CustomName { } } -impl Deref for CustomName { - type Target = str; - - fn deref(&self) -> &Self::Target { - &self.0 +impl Display for CustomName { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) } } -impl DerefMut for CustomName { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 +/// A player's walk speed +#[derive( + Copy, Clone, Debug, PartialEq, Serialize, Deserialize, derive_more::Deref, derive_more::DerefMut, +)] +pub struct WalkSpeed(pub f32); + +bincode_component_impl!(WalkSpeed); + +impl Default for WalkSpeed { + fn default() -> Self { + WalkSpeed(0.1) } } -impl Display for CustomName { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) +/// A player's fly speed +#[derive( + Copy, Clone, Debug, PartialEq, Serialize, Deserialize, derive_more::Deref, derive_more::DerefMut, +)] +pub struct CreativeFlyingSpeed(pub f32); + +bincode_component_impl!(CreativeFlyingSpeed); + +impl Default for CreativeFlyingSpeed { + fn default() -> Self { + CreativeFlyingSpeed(0.05) } } -/// Whether an entity is flying (like in creative mode, so it does not reflect if the player is flying by other means) -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +/// Whether a player can fly like in creative mode +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Deref, + derive_more::DerefMut, +)] +pub struct CanCreativeFly(pub bool); + +bincode_component_impl!(CanCreativeFly); + +/// Whether a player is flying (like in creative mode, so it does not reflect if the player is flying by other means) +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Deref, + derive_more::DerefMut, +)] pub struct CreativeFlying(pub bool); bincode_component_impl!(CreativeFlying); -/// Wheather an entity is sneaking, like in pressing shift. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +/// Whether a player can place and destroy blocks +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Deref, + derive_more::DerefMut, +)] +pub struct CanBuild(pub bool); + +bincode_component_impl!(CanBuild); + +/// Whether a player breaks blocks instantly (like in creative mode) +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Deref, + derive_more::DerefMut, +)] +pub struct Instabreak(pub bool); + +bincode_component_impl!(Instabreak); + +/// Whether a player is immune to damage +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Deref, + derive_more::DerefMut, +)] +pub struct Invulnerable(pub bool); + +bincode_component_impl!(Invulnerable); + +/// Whether an entity is sneaking, like in pressing shift. +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Deref, + derive_more::DerefMut, +)] pub struct Sneaking(pub bool); bincode_component_impl!(Sneaking); + +/// A player's previous gamemode +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Deref, + derive_more::DerefMut, +)] +pub struct PreviousGamemode(pub Option); + +bincode_component_impl!(PreviousGamemode); + +impl PreviousGamemode { + /// Gets a previous gamemode from its ID. + pub fn from_id(id: i8) -> Self { + PreviousGamemode(match id { + 0 => Some(Gamemode::Survival), + 1 => Some(Gamemode::Creative), + 2 => Some(Gamemode::Adventure), + 3 => Some(Gamemode::Spectator), + _ => None, + }) + } + + /// Gets this gamemode's id + pub fn id(&self) -> i8 { + match self.0 { + Some(Gamemode::Survival) => 0, + Some(Gamemode::Creative) => 1, + Some(Gamemode::Adventure) => 2, + Some(Gamemode::Spectator) => 3, + None => -1, + } + } +} + +/// Represents an entity's health +#[derive( + Copy, Clone, Debug, PartialEq, Serialize, Deserialize, derive_more::Deref, derive_more::DerefMut, +)] +pub struct Health(pub f32); +bincode_component_impl!(Health); + +/// A component on players that tracks if they are sprinting or not. +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Deref, + derive_more::DerefMut, +)] +pub struct Sprinting(pub bool); +impl Sprinting { + pub fn new(value: bool) -> Self { + Sprinting(value) + } +} +bincode_component_impl!(Sprinting); diff --git a/quill/common/src/events.rs b/quill/common/src/events.rs index 4517ef7d6..e253da176 100644 --- a/quill/common/src/events.rs +++ b/quill/common/src/events.rs @@ -1,7 +1,12 @@ +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; - -pub use block_interact::{BlockInteractEvent, BlockPlacementEvent}; -pub use change::{CreativeFlyingEvent, SneakEvent}; -pub use interact_entity::InteractEntityEvent; diff --git a/quill/common/src/events/change.rs b/quill/common/src/events/change.rs index ca4f1ad81..266846160 100644 --- a/quill/common/src/events/change.rs +++ b/quill/common/src/events/change.rs @@ -1,7 +1,9 @@ /* -All events in this file are triggerd when there is a change in a certain value. +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 serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, Clone)] @@ -29,3 +31,36 @@ impl SneakEvent { } } } + +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct SprintEvent { + pub is_sprinting: bool, +} + +impl SprintEvent { + pub fn new(changed_to: bool) -> Self { + Self { + is_sprinting: changed_to, + } + } +} + +/// 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); + +/// This event is called when player's ability to instantly break blocks changes. +#[derive(Debug, Serialize, Deserialize, Clone, Deref)] +pub struct InstabreakEvent(pub bool); + +/// This event is called when player's ability to fly changes. +#[derive(Debug, Serialize, Deserialize, Clone, Deref)] +pub struct FlyingAbilityEvent(pub bool); + +/// 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); + +/// This event is called when player's invulnerability property changes. +#[derive(Debug, Serialize, Deserialize, Clone, Deref)] +pub struct InvulnerabilityEvent(pub bool); diff --git a/quill/common/src/events/entity.rs b/quill/common/src/events/entity.rs new file mode 100644 index 000000000..073feb61a --- /dev/null +++ b/quill/common/src/events/entity.rs @@ -0,0 +1,16 @@ +use serde::{Deserialize, Serialize}; + +/// Triggered when a player joins the `Game`. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct PlayerJoinEvent; + +/// Triggered when an entity is removed from the world. +/// +/// The entity will remain alive for one tick after it is +/// destroyed to allow systems to observe this event. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct EntityRemoveEvent; + +/// Triggered when an entity is added into the world. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct EntityCreateEvent; diff --git a/quill/example-plugins/block-access/src/lib.rs b/quill/example-plugins/block-access/src/lib.rs index 33f3ad798..9813d2b36 100644 --- a/quill/example-plugins/block-access/src/lib.rs +++ b/quill/example-plugins/block-access/src/lib.rs @@ -2,8 +2,7 @@ use quill::{entities::Player, BlockState, Game, Plugin, Position}; -quill::plugin!(BlockAccess); - +#[quill::plugin] pub struct BlockAccess; impl Plugin for BlockAccess { diff --git a/quill/example-plugins/block-place/src/lib.rs b/quill/example-plugins/block-place/src/lib.rs index fa1be6692..19913eb7f 100644 --- a/quill/example-plugins/block-place/src/lib.rs +++ b/quill/example-plugins/block-place/src/lib.rs @@ -2,8 +2,7 @@ use quill::{events::BlockPlacementEvent, Game, Plugin}; -quill::plugin!(BlockPlace); - +#[quill::plugin] pub struct BlockPlace; impl Plugin for BlockPlace { diff --git a/quill/example-plugins/observe-creativemode-flight-event/src/lib.rs b/quill/example-plugins/observe-creativemode-flight-event/src/lib.rs index 151eac1a5..9d84f159d 100644 --- a/quill/example-plugins/observe-creativemode-flight-event/src/lib.rs +++ b/quill/example-plugins/observe-creativemode-flight-event/src/lib.rs @@ -4,18 +4,19 @@ flying. */ use quill::{ + components::Sprinting, events::{CreativeFlyingEvent, SneakEvent}, Game, Plugin, Setup, }; -quill::plugin!(FlightPlugin); - +#[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 {} } @@ -41,3 +42,11 @@ fn sneak_observer_system(_plugin: &mut FlightPlugin, game: &mut Game) { } } } + +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/src/lib.rs b/quill/example-plugins/particle-example/src/lib.rs index e35c35f3c..bd84bb58d 100644 --- a/quill/example-plugins/particle-example/src/lib.rs +++ b/quill/example-plugins/particle-example/src/lib.rs @@ -1,7 +1,6 @@ use quill::{Game, Particle, ParticleKind, Plugin, Position}; -quill::plugin!(ParticleExample); - +#[quill::plugin] struct ParticleExample {} impl Plugin for ParticleExample { diff --git a/quill/example-plugins/plugin-message/src/lib.rs b/quill/example-plugins/plugin-message/src/lib.rs index 5efb7ea77..9b66f8c7a 100644 --- a/quill/example-plugins/plugin-message/src/lib.rs +++ b/quill/example-plugins/plugin-message/src/lib.rs @@ -2,8 +2,7 @@ //! send a player to a server named lobby. use quill::{entities::Player, BlockPosition, Game, Plugin, Position}; -quill::plugin!(PluginMessage); - +#[quill::plugin] pub struct PluginMessage; impl Plugin for PluginMessage { diff --git a/quill/example-plugins/query-entities/src/lib.rs b/quill/example-plugins/query-entities/src/lib.rs index c5851b0af..527fd7546 100644 --- a/quill/example-plugins/query-entities/src/lib.rs +++ b/quill/example-plugins/query-entities/src/lib.rs @@ -4,8 +4,7 @@ use quill::{entities::PiglinBrute, EntityInit, Game, Plugin, Position}; use rand::Rng; -quill::plugin!(QueryEntities); - +#[quill::plugin] struct QueryEntities { tick_counter: u64, } @@ -38,13 +37,7 @@ impl Plugin for QueryEntities { fn query_system(plugin: &mut QueryEntities, game: &mut Game) { // Make the piglin brutes float into the air. plugin.tick_counter += 1; - for (entity, (position, _piglin_brute)) in game.query::<(&Position, &PiglinBrute)>() { - // Mutable access to components through queries - // is not yet implemented, so we have to set - // the component directly. - entity.set(Position { - y: position.y + 0.1 * ((plugin.tick_counter as f64 / 20.0).sin() + 1.0), - ..position - }); + 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/src/lib.rs b/quill/example-plugins/simple/src/lib.rs index 650bb8904..d6ac19dae 100644 --- a/quill/example-plugins/simple/src/lib.rs +++ b/quill/example-plugins/simple/src/lib.rs @@ -5,8 +5,7 @@ use quill::{ }; use rand::Rng; -quill::plugin!(SimplePlugin); - +#[quill::plugin] struct SimplePlugin { tick_counter: u64, } @@ -40,12 +39,10 @@ fn test_system(plugin: &mut SimplePlugin, game: &mut Game) { .finish(); } } - for (entity, (position, _cow)) in game.query::<(&Position, &Cow)>() { - entity.set(Position { - y: position.y + 0.1, - ..position - }); + for (_, (mut position, _)) in game.query::<(&mut Position, &Cow)>() { + position.y += 0.1; } + plugin.tick_counter += 1; } diff --git a/quill/example-plugins/titles/src/lib.rs b/quill/example-plugins/titles/src/lib.rs index f7ab938ce..634f5b003 100644 --- a/quill/example-plugins/titles/src/lib.rs +++ b/quill/example-plugins/titles/src/lib.rs @@ -1,7 +1,6 @@ use quill::{entities::Player, Game, Plugin, Text, TextComponent, TextComponentBuilder, Title}; -quill::plugin!(TitleExample); - +#[quill::plugin] struct TitleExample { tick_count: u32, title_active: bool, @@ -28,8 +27,8 @@ fn title_system(plugin: &mut TitleExample, game: &mut Game) { // Create a title to send to the player let title = Title { - title: Some(Text::from(title_component).to_string()), - sub_title: Some(Text::from(component).to_string()), + title: Some(Text::from(title_component)), + sub_title: Some(Text::from(component)), fade_in: 5, stay: 400, fade_out: 5, diff --git a/quill/sys/src/lib.rs b/quill/sys/src/lib.rs index 14e6e6176..c0b6d8f79 100644 --- a/quill/sys/src/lib.rs +++ b/quill/sys/src/lib.rs @@ -76,7 +76,6 @@ extern "C" { /// 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, @@ -85,6 +84,26 @@ extern "C" { 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. @@ -97,7 +116,7 @@ extern "C" { /// 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_ptr: Pointer, title_len: u32); + pub fn entity_send_title(entity: EntityId, title_json_ptr: Pointer, title_len: u32); /// Creates an empty entity builder. /// diff --git a/tools/proxy/Cargo.toml b/tools/proxy/Cargo.toml deleted file mode 100644 index 0ae47cf96..000000000 --- a/tools/proxy/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "minecraft-proxy" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[dependencies] -feather-protocol = { path = "../../feather/protocol", features = ["proxy"] } -async-executor = "1" -async-io = "1" -futures-lite = "1" -argh = "0.1" -anyhow = "1" -log = "0.4" -simple_logger = "1" -either = "1" diff --git a/tools/proxy/src/main.rs b/tools/proxy/src/main.rs deleted file mode 100644 index 9eec5d2b4..000000000 --- a/tools/proxy/src/main.rs +++ /dev/null @@ -1,218 +0,0 @@ -use std::net::{SocketAddr, TcpListener, TcpStream}; - -use anyhow::{bail, Context}; -use argh::FromArgs; -use async_executor::Executor; -use async_io::{block_on, Async}; -use either::Either; -use feather_protocol::{ - packets::client::HandshakeState, ClientHandshakePacket, ClientPacket, ClientPacketCodec, - ProtocolState, ServerLoginPacket, ServerPacket, ServerPacketCodec, -}; -use futures_lite::FutureExt; -use futures_lite::{AsyncReadExt, AsyncWriteExt}; -use simple_logger::SimpleLogger; - -/// A proxy for debugging and inspecting the Minecraft protocol. -#[derive(Debug, FromArgs)] -struct Args { - /// the port to listen on. Must be different from - /// the vanilla server's port. - #[argh(option, short = 'p')] - port: u16, - /// the port of the server to proxy to. - #[argh(option, short = 's')] - server_port: u16, -} - -fn main() -> anyhow::Result<()> { - SimpleLogger::new() - .with_level(log::LevelFilter::Debug) - .init() - .unwrap(); - let args: Args = argh::from_env(); - - let addr = format!("127.0.0.1:{}", args.port); - let listener = TcpListener::bind(&addr) - .with_context(|| format!("failed to bind to port {}", args.port))?; - let mut listener = Async::new(listener)?; - - log::info!("Listening on {}", addr); - - let executor = Executor::new(); - block_on(executor.run(async { - accept_connections(&executor, &mut listener, args.server_port).await; - })); - - Ok(()) -} - -async fn accept_connections( - executor: &Executor<'static>, - listener: &mut Async, - server_port: u16, -) { - loop { - let (stream, addr) = match listener.accept().await { - Ok(con) => con, - Err(e) => { - log::error!("Failed to accept connection: {}", e); - continue; - } - }; - log::info!("Accepting connection from {}", addr); - - executor - .spawn(async move { - if let Err(e) = handle_connection(stream, server_port).await { - log::error!("Connection dropped: {:?}", e); - } - }) - .detach(); - } -} - -struct Connection { - /// The client's username. - username: String, - - client_buffer: [u8; 256], - client_codec: ClientPacketCodec, - client: Async, - - server_buffer: [u8; 256], - server_codec: ServerPacketCodec, - server: Async, -} - -impl Connection { - fn set_state(&mut self, state: ProtocolState) { - log::info!("{}: switching to state {:?}", self.username, state); - self.client_codec.set_state(state); - self.server_codec.set_state(state); - } -} - -const MAX_PACKET_DISPLAY: usize = 4000; - -async fn handle_connection(client: Async, server_port: u16) -> anyhow::Result<()> { - let server = - Async::::connect(format!("127.0.0.1:{}", server_port).parse::()?) - .await - .with_context(|| format!("failed to connect to server at localhost:{}", server_port))?; - - let mut connection = Connection { - username: String::from(""), - - client_buffer: [0; 256], - client_codec: ClientPacketCodec::new(), - client, - - server_buffer: [0; 256], - server_codec: ServerPacketCodec::new(), - server, - }; - - let mut buffer = Vec::new(); - - loop { - let client = &mut connection.client; - let client_buffer = &mut connection.client_buffer; - let server = &mut connection.server; - let server_buffer = &mut connection.server_buffer; - - // Attempt to read data from either the server or the client. - let recv_client = async { Either::Left(client.read(client_buffer).await) }; - let recv_server = async { Either::Right(server.read(server_buffer).await) }; - match recv_client.race(recv_server).await { - Either::Left(client) => { - let mut bytes_read = client?; - if bytes_read == 0 { - bail!("disconnected from client"); - } - - while let Some(packet) = connection - .client_codec - .decode(&connection.client_buffer[..bytes_read]) - .context("failed to decode client packet")? - { - bytes_read = 0; - let mut packet_str = format!("{:?}", packet); - if packet_str.len() > MAX_PACKET_DISPLAY { - packet_str = format!("{} ", &packet_str[..MAX_PACKET_DISPLAY]); - } - log::info!("client @ {}: {}", connection.username, packet_str); - - // Attempt to 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) - } - - // Forward the packet to the server. - connection.client_codec.encode(&packet, &mut buffer); - connection.server.write_all(&buffer).await?; - buffer.clear(); - } - } - Either::Right(server) => { - let mut bytes_read = server?; - if bytes_read == 9 { - bail!("disconnected from server"); - } - - while let Some(packet) = connection - .server_codec - .decode(&connection.server_buffer[..bytes_read]) - .context("failed to decode server packet")? - { - bytes_read = 0; - let mut packet_str = format!("{:?}", packet); - if packet_str.len() > MAX_PACKET_DISPLAY { - packet_str = format!("{} ", &packet_str[..MAX_PACKET_DISPLAY]); - } - log::info!("server @ {}: {}", connection.username, packet_str); - - // Attempt to detect state switches. - if let ServerPacket::Login(ServerLoginPacket::LoginSuccess(packet)) = &packet { - connection.username = packet.username.clone(); - connection.set_state(ProtocolState::Play); - } - - // Forward the packet to the client. - connection.server_codec.encode(&packet, &mut buffer); - connection.client.write_all(&buffer).await?; - buffer.clear(); - } - } - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn parse_cli_args() { - let args = Args::from_args(&["minecraft-proxy"], &["-p", "25565", "-s", "25566"]).unwrap(); - assert_eq!(args.port, 25565); - assert_eq!(args.server_port, 25566); - } - - #[test] - fn parse_cli_args_long_port() { - let args = Args::from_args( - &["minecraft-proxy"], - &["--port", "25565", "--server-port", "25566"], - ) - .unwrap(); - assert_eq!(args.port, 25565); - assert_eq!(args.server_port, 25566); - } -}