diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index cef6a14..0000000 --- a/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!/Cargo.* -!/src -!/crates diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index a0e58cf..b09d620 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -1,14 +1,5 @@ name: 'MinedMap' -on: - push: - branches: - - 'main' - tags: - - 'v*' - pull_request: - branches: - - 'main' - workflow_dispatch: {} +on: ['push', 'pull_request', 'workflow_dispatch'] env: RUSTFLAGS: -Dwarnings @@ -16,7 +7,7 @@ env: jobs: viewer: - runs-on: 'ubuntu-latest' + runs-on: 'ubuntu-20.04' steps: - name: 'Checkout' @@ -34,10 +25,9 @@ jobs: pkgdir='build/pkg/MinedMap-${{ steps.tag.outputs.tag }}-viewer' mkdir -p "$pkgdir" cp -r viewer/* "$pkgdir"/ - rm "$pkgdir"/Dockerfile - name: 'Archive' - uses: 'actions/upload-artifact@v4' + uses: 'actions/upload-artifact@v3' with: name: 'MinedMap-${{ steps.tag.outputs.tag }}-viewer' path: 'build/pkg' @@ -48,7 +38,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.88' + toolchain: stable components: rustfmt - run: cargo fmt --all -- --check @@ -58,7 +48,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.88' + toolchain: stable components: clippy - uses: swatinem/rust-cache@v2 - uses: actions-rs/clippy-check@v1 @@ -72,7 +62,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.88' + toolchain: stable components: rust-docs - uses: swatinem/rust-cache@v2 - run: cargo doc --workspace --no-deps --document-private-items @@ -83,11 +73,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macOS-latest] + rust: [stable] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.88' + toolchain: ${{ matrix.rust }} - uses: swatinem/rust-cache@v2 - run: cargo test --workspace - run: cargo test --workspace --no-default-features @@ -100,9 +91,9 @@ jobs: fail-fast: false matrix: include: - - os: 'macos-13' + - os: 'macos-11' target: 'aarch64-apple-darwin' - - os: 'macos-13' + - os: 'macos-11' target: 'x86_64-apple-darwin' - os: 'windows-2019' target: 'x86_64-pc-windows-msvc' @@ -110,7 +101,7 @@ jobs: - os: 'windows-2019' target: 'i686-pc-windows-msvc' ext: '.exe' - - os: 'ubuntu-22.04' + - os: 'ubuntu-20.04' target: 'x86_64-unknown-linux-gnu' steps: @@ -127,12 +118,10 @@ jobs: - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.88' + toolchain: stable targets: '${{ matrix.target }}' - uses: swatinem/rust-cache@v2 - with: - key: '${{ matrix.target }}' - name: 'Build' shell: 'bash' @@ -145,94 +134,7 @@ jobs: cp target/${{ matrix.target }}/release/minedmap${{ matrix.ext }} "$pkgdir"/ - name: 'Archive' - uses: 'actions/upload-artifact@v4' + uses: 'actions/upload-artifact@v3' with: name: 'MinedMap-${{ steps.tag.outputs.tag }}-${{ matrix.target }}' path: 'target/pkg' - - build-container: - runs-on: ubuntu-latest - needs: - - test - steps: - - name: 'Checkout' - uses: 'actions/checkout@v4' - - - name: 'Get version' - id: 'tag' - run: | - set -o pipefail - git fetch --prune --unshallow --tags -f - echo "tag=$(git describe --abbrev=7 --match='v*' | sed 's/^v//')" >> $GITHUB_OUTPUT - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ghcr.io/neocturne/minedmap/minedmap - tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=ref,event=branch - type=ref,event=branch,suffix=-{{sha}} - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - - - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - uses: docker/setup-buildx-action@v3 - - - name: Build - uses: docker/build-push-action@v6 - with: - build-args: | - MINEDMAP_VERSION=${{ steps.tag.outputs.tag }} - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - viewer-container: - runs-on: ubuntu-latest - needs: - - test - steps: - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ghcr.io/neocturne/minedmap/viewer - tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=ref,event=branch - type=ref,event=branch,suffix=-{{sha}} - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - - - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - uses: docker/setup-buildx-action@v3 - - - name: Build - uses: docker/build-push-action@v6 - with: - context: "{{defaultContext}}:viewer" - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f1f0234..b3b134e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,126 +2,6 @@ ## [Unreleased] - ReleaseDate -## [2.6.0] - 2025-06-30 - -### Added - -- Added support for Minecraft 1.21.5 to 1.21.7 - - Added new block types and handling for changed sign text storage format. - -## [2.5.0] - 2025-03-16 - -### Added - -- Added experimental watch mode - - Passing `--watch` will cause MinedMap to run continuously instead of exiting - after map generation, regenerating tiles whenever they change. - - `--watch-delay` can be used to configure the delay between detecting a change - and runing the map generation, also limiting how often the regeneration - happens. This defaults to `30s`; significantly smaller values probably don't - make sense because Minecraft writes out changes in batches anyways. - - Finally, `--jobs-initial` can be used to configure the number of parallel - generation threads for the initial cycle separately from the value used for - subsequent cycles after a change is detected (`-j`/`--jobs`). Subsequent - cycles usually need to regenerate only a small number of tiles, so setting - `--jobs` to a smaller value than `--jobs-initial` may be advantageous. - -- Added jemalloc support to fix performace on musl targets - - The global allocator can be switched to jemalloc by enabling the `jemalloc` - cargo feature now. This is not the default because it is not always faster - than the default system allocator; in particular, the glibc allocator has - slightly better performance in multithreaded mode. In addition, jemalloc - uses a bit more memory. - - In addition, the `jemalloc-auto` feature has been introduced, which is enabled - by default and sets the global allocator to jemalloc on platforms where it is - clearly advantageous. For now, this is only done on musl-based targets, as - musl's default allocator is very slow in multithreaded operation (which was - making higher thread counts like `-j8` basically useless due to 7-8x - slowdowns). With the new default, performance on musl is basically identical - to glibc. - - Note that some platforms like `msvc` are unsupported by jemalloc, and trying - to enable the `jemalloc` feature on these platforms may break the MinedMap - build or cause issues at runtime. -- Docker images can be downloaded from the GitHub Container registry - - Two images are provided, one for the tile renderer and one with the viewer - and a web server. A `docker-compose.yml` example can be found in the - repository as a starting point. - -### Changed - -- Unknown biome types (from not yet supported or modded versions of Minecraft) - will now use plains biome colors as a fallback instead of resulting in water, - grass and foliage blocks to be rendered as transparent pixels -- Switched from zlib-ng to zlib-rs - - This should have no noticable effect on the usage of MinedMap, but avoids - an external build dependency on CMake. -- Small (1-block) seagrass is now visible on the map - - 1-block seagrass in 1-block deep water would previously result in the ground - to be shown instead of water, as MinedMap currently doesn't handle the - "waterlogged" block status. As 1-block seagrass is relatively big compared to - other "small" plants, just considering it opaque seems like a good enough - solution that avoids having to implement advanced block status flags. -- Use Bincode 2 for storage of intermediate data - - The update from Bincode 1 to 2 slightly reduces the size of the `processed` - directory used for intermediate data. At least Rust 1.85 is now required to - build MinedMap. - -## [2.4.0] - 2025-01-11 - -### Added - -- Added support for rendering tiles in WebP format using the `--image-format` option - -## [2.3.1] - 2025-01-06 - -### Fixed - -- Fix text colors for signs modified using dye -- Fix text colors specified using `#rrggbb` CSS syntax in JSON text - -Only named colors specified via JSON text were working as intended. - -The mapping of color names to values is now handled by the generator. Both the generator and the -viewer must be updated for sign text colors to work. - -## [2.3.0] - 2025-01-02 - -### Added - -- Added support for Minecraft 1.21.4 block types -- Added support for Minecraft 1.21.4 Pale Garden biome -- viewer: added images for pale oak signs - -## [2.2.0] - 2024-06-23 - -### Added - -- Added support for Minecraft 1.21 block types - -## [2.1.1] - 2024-06-14 - -### Fixed - -- Fix crash due to incorrect counting in info message - - The calculation of the number of skipped regions could underflow when more invalid than valid - regions were encountered. -- Ignore empty region files instead of treating them as invalid - - Minecraft generates empty region files in some cases. Just ignore them instead of printing an - error message every time. - ## [2.1.0] - 2024-01-27 ### Added @@ -196,14 +76,7 @@ intermediate data. Full support for custom biomes datapacks might be added in a future release. -[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.6.0...HEAD -[2.6.0]: https://github.com/neocturne/MinedMap/compare/v2.5.0...v2.6.0 -[2.5.0]: https://github.com/neocturne/MinedMap/compare/v2.4.0...v2.5.0 -[2.4.0]: https://github.com/neocturne/MinedMap/compare/v2.3.1...v2.4.0 -[2.3.1]: https://github.com/neocturne/MinedMap/compare/v2.3.0...v2.3.1 -[2.3.0]: https://github.com/neocturne/MinedMap/compare/v2.2.0...v2.3.0 -[2.2.0]: https://github.com/neocturne/MinedMap/compare/v2.1.1...v2.2.0 -[2.1.1]: https://github.com/neocturne/MinedMap/compare/v2.1.0...v2.1.1 +[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.1.0...HEAD [2.1.0]: https://github.com/neocturne/MinedMap/compare/v2.0.2...v2.1.0 [2.0.2]: https://github.com/neocturne/MinedMap/compare/v2.0.1...v2.0.2 [2.0.1]: https://github.com/neocturne/MinedMap/compare/v2.0.0...v2.0.1 diff --git a/Cargo.lock b/Cargo.lock index a000b9d..2a88179 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,132 +1,131 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +version = 3 [[package]] name = "addr2line" -version = "0.24.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] [[package]] -name = "adler2" -version = "2.0.1" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.21" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "anstream" -version = "0.6.19" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.11" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.7" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.9" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "once_cell_polyfill", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.98" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "autocfg" -version = "1.5.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.75" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", + "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", ] [[package]] name = "bincode" -version = "2.0.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "bincode_derive", "serde", - "unty", -] - -[[package]] -name = "bincode_derive" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" -dependencies = [ - "virtue", ] [[package]] @@ -137,15 +136,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bytemuck" -version = "1.23.1" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" [[package]] name = "byteorder" @@ -153,21 +152,14 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "byteorder-lite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" - [[package]] name = "cc" -version = "1.2.27" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", - "shlex", ] [[package]] @@ -178,15 +170,15 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfg-if" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.40" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -194,9 +186,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.40" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -207,9 +199,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.40" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", @@ -219,30 +211,45 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.5" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "colorchoice" -version = "1.0.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-deque" -version = "0.8.6" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -259,50 +266,31 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "either" -version = "1.15.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "enum-map" -version = "2.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" -dependencies = [ - "enum-map-derive", -] - -[[package]] -name = "enum-map-derive" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "enumflags2" -version = "0.7.12" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" dependencies = [ "enumflags2_derive", + "serde", ] [[package]] name = "enumflags2_derive" -version = "0.7.12" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", @@ -311,25 +299,25 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.13" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] name = "fastnbt" -version = "2.5.0" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4a73a95dc65551ccd98e1ecd1adb5d1ba5361146963b31f481ca42fc0520a3" +checksum = "3369bd70629bccfda7e344883c9ae3ab7f3b10a357bcf8b0f69caa7256bcf188" dependencies = [ "byteorder", "cesu8", @@ -337,70 +325,37 @@ dependencies = [ "serde_bytes", ] -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - [[package]] name = "fdeflate" -version = "0.3.7" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" dependencies = [ "simd-adler32", ] -[[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys 0.59.0", -] - [[package]] name = "flate2" -version = "1.1.2" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", - "libz-rs-sys", + "libz-ng-sys", "miniz_oxide", ] -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - -[[package]] -name = "fsevent-sys" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" -dependencies = [ - "libc", -] - [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -409,15 +364,15 @@ dependencies = [ [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-macro", @@ -427,23 +382,11 @@ dependencies = [ "slab", ] -[[package]] -name = "getrandom" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", -] - [[package]] name = "gimli" -version = "0.31.1" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "git-version" @@ -467,186 +410,113 @@ dependencies = [ [[package]] name = "glam" -version = "0.30.4" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50a99dbe56b72736564cfa4b85bf9a33079f16ae8b74983ab06af3b1a3696b11" +checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" [[package]] name = "hashbrown" -version = "0.15.4" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ + "ahash", "allocator-api2", - "equivalent", - "foldhash", ] [[package]] name = "heck" -version = "0.5.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.5.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - -[[package]] -name = "humantime" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "image" -version = "0.25.6" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" dependencies = [ "bytemuck", - "byteorder-lite", - "image-webp", + "byteorder", + "color_quant", "num-traits", "png", ] -[[package]] -name = "image-webp" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6970fe7a5300b4b42e62c52efa0187540a5bef546c60edaf554ef595d2e6f0b" -dependencies = [ - "byteorder-lite", - "quick-error", -] - [[package]] name = "indexmap" -version = "2.10.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", "hashbrown", + "serde", ] -[[package]] -name = "inotify" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" -dependencies = [ - "bitflags 2.9.1", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - [[package]] name = "itertools" -version = "0.14.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.33" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ - "getrandom", - "libc", -] - -[[package]] -name = "kqueue" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" -dependencies = [ - "kqueue-sys", - "libc", -] - -[[package]] -name = "kqueue-sys" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" -dependencies = [ - "bitflags 1.3.2", "libc", ] [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.174" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] -name = "libredox" -version = "0.1.4" +name = "libz-ng-sys" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" +checksum = "c6409efc61b12687963e602df8ecf70e8ddacf95bc6576bcf16e3ac6328083c5" dependencies = [ - "bitflags 2.9.1", + "cmake", "libc", - "redox_syscall", -] - -[[package]] -name = "libz-rs-sys" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "172a788537a2221661b480fee8dc5f96c580eb34fa88764d3205dc356c7e4221" -dependencies = [ - "zlib-rs", ] [[package]] name = "linux-raw-sys" -version = "0.9.4" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.13" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -654,49 +524,43 @@ dependencies = [ [[package]] name = "log" -version = "0.4.27" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" -version = "0.15.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0281c2e25e62316a5c9d98f2d2e9e95a37841afdaf4383c177dbb5c1dfab0568" +checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" dependencies = [ "hashbrown", ] [[package]] name = "memchr" -version = "2.7.5" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "minedmap" -version = "2.6.0" +version = "2.1.0" dependencies = [ "anyhow", "bincode", "clap", - "enum-map", "fastnbt", - "flate2", "futures-util", "git-version", - "humantime", "image", "indexmap", "lru", - "minedmap-default-alloc", "minedmap-nbt", "minedmap-resource", "minedmap-types", - "notify", "num-integer", "num_cpus", - "phf", "rayon", "regex", "rustc-hash", @@ -708,16 +572,9 @@ dependencies = [ "zstd", ] -[[package]] -name = "minedmap-default-alloc" -version = "0.1.0" -dependencies = [ - "tikv-jemallocator", -] - [[package]] name = "minedmap-nbt" -version = "0.2.0" +version = "0.1.1" dependencies = [ "anyhow", "bytemuck", @@ -730,68 +587,31 @@ dependencies = [ [[package]] name = "minedmap-resource" -version = "0.8.0" +version = "0.3.0" dependencies = [ - "bincode", "enumflags2", "glam", + "serde", ] [[package]] name = "minedmap-types" -version = "0.2.0" +version = "0.1.2" dependencies = [ - "bincode", "itertools", + "serde", ] [[package]] name = "miniz_oxide" -version = "0.8.9" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ - "adler2", + "adler", "simd-adler32", ] -[[package]] -name = "mio" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" -dependencies = [ - "libc", - "log", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", -] - -[[package]] -name = "notify" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" -dependencies = [ - "bitflags 2.9.1", - "filetime", - "fsevent-sys", - "inotify", - "kqueue", - "libc", - "log", - "mio", - "notify-types", - "walkdir", - "windows-sys 0.59.0", -] - -[[package]] -name = "notify-types" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -804,27 +624,28 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.46" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ + "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.19" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.17.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", @@ -832,24 +653,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.7" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.21.3" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" - -[[package]] -name = "once_cell_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "overload" @@ -859,9 +674,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.4" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", @@ -869,65 +684,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.11" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "phf" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7" -dependencies = [ - "phf_macros", - "phf_shared", - "serde", -] - -[[package]] -name = "phf_generator" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cbb1126afed61dd6368748dae63b1ee7dc480191c6262a3b4ff1e29d86a6c5b" -dependencies = [ - "fastrand", - "phf_shared", -] - -[[package]] -name = "phf_macros" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713258393a82f091ead52047ca779d37e5766226d009de21696c4e667044368" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "phf_shared" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981" -dependencies = [ - "siphasher", + "windows-targets 0.48.5", ] [[package]] name = "pin-project-lite" -version = "0.2.16" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -937,15 +709,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.32" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "png" -version = "0.17.16" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -956,39 +728,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - [[package]] name = "quote" -version = "1.0.40" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - [[package]] name = "rayon" -version = "1.10.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -1006,18 +766,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.13" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags 2.9.1", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -1027,9 +787,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -1038,49 +798,40 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustc-demangle" -version = "0.1.25" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" -version = "2.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "1.0.7" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "scopeguard" @@ -1090,27 +841,27 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.17" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", @@ -1119,12 +870,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", - "memchr", "ryu", "serde", ] @@ -1138,47 +888,38 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "simd-adler32" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - [[package]] name = "slab" -version = "0.4.10" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" -version = "1.15.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "strsim" -version = "0.11.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "2.0.104" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1187,48 +928,29 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ "rustix", - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] name = "thread_local" -version = "1.1.9" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ "cfg-if", -] - -[[package]] -name = "tikv-jemalloc-sys" -version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "tikv-jemallocator" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865" -dependencies = [ - "libc", - "tikv-jemalloc-sys", + "once_cell", ] [[package]] name = "tokio" -version = "1.45.1" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "parking_lot", @@ -1237,9 +959,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -1248,9 +970,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.30" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -1259,9 +981,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.34" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -1280,9 +1002,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.19" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "nu-ansi-term", "sharded-slab", @@ -1294,58 +1016,27 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "unty" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "utf8parse" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "valuable" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] -name = "virtue" -version = "0.0.18" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" -dependencies = [ - "wit-bindgen-rt", -] +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "winapi" @@ -1363,15 +1054,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -1380,188 +1062,179 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] name = "windows-sys" -version = "0.60.2" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.53.2", + "windows-targets 0.52.0", ] [[package]] name = "windows-targets" -version = "0.52.6" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.53.2" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.6" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.53.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.52.6" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.53.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.52.6" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.53.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.52.6" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.53.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.52.6" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.53.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.6" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.53.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.52.6" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.53.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "zerocopy" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "bitflags 2.9.1", + "zerocopy-derive", ] [[package]] -name = "zlib-rs" -version = "0.5.1" +name = "zerocopy-derive" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626bd9fa9734751fc50d6060752170984d7053f5a39061f524cda68023d4db8a" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "zstd" -version = "0.13.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.2.4" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.15+zstd.1.5.7" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index f0c2bc0..082c5b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ members = ["crates/*"] [workspace.package] -edition = "2024" +edition = "2021" license = "MIT" readme = "README.md" repository = "https://github.com/neocturne/MinedMap" @@ -13,7 +13,7 @@ pre-release-commit-message = "{{crate_name}} {{version}}" [package] name = "minedmap" -version = "2.6.0" +version = "2.1.0" description = "Generate browsable maps from Minecraft save data" edition.workspace = true license.workspace = true @@ -38,29 +38,23 @@ pre-release-replacements = [ [dependencies] anyhow = "1.0.68" -bincode = "2.0.1" +bincode = "1.3.3" clap = { version = "4.1.4", features = ["derive", "wrap_help"] } -enum-map = "2.7.3" fastnbt = "2.3.2" -flate2 = { version = "1.1.0", features = ["zlib-rs"] } futures-util = "0.3.28" git-version = "0.3.5" -humantime = "2.1.0" -image = { version = "0.25.1", default-features = false, features = ["png", "webp"] } -indexmap = "2.0.0" -lru = "0.15.0" -minedmap-default-alloc = { version = "0.1.0", path = "crates/default-alloc", optional = true } -minedmap-nbt = { version = "0.2.0", path = "crates/nbt", default-features = false } -minedmap-resource = { version = "0.8.0", path = "crates/resource" } -minedmap-types = { version = "0.2.0", path = "crates/types" } -notify = "8.0.0" +image = { version = "0.24.5", default-features = false, features = ["png"] } +indexmap = { version = "2.0.0", features = ["serde"] } +lru = "0.12.0" +minedmap-nbt = { version = "0.1.1", path = "crates/nbt", default-features = false } +minedmap-resource = { version = "0.3.0", path = "crates/resource" } +minedmap-types = { version = "0.1.2", path = "crates/types" } num-integer = "0.1.45" num_cpus = "1.16.0" -phf = { version = "0.12.1", features = ["macros"] } rayon = "1.7.0" regex = "1.10.2" -rustc-hash = "2.0.0" -serde = { version = "1.0.152", features = ["derive"] } +rustc-hash = "1.1.0" +serde = { version = "1.0.152", features = ["rc", "derive"] } serde_json = "1.0.99" tokio = { version = "1.31.0", features = ["rt", "parking_lot", "sync"] } tracing = "0.1.37" @@ -68,6 +62,5 @@ tracing-subscriber = "0.3.17" zstd = "0.13.0" [features] -default = ["jemalloc-auto"] -jemalloc-auto = ["dep:minedmap-default-alloc"] -jemalloc = ["jemalloc-auto", "minedmap-default-alloc/jemalloc"] +default = ["zlib-ng"] +zlib-ng = ["minedmap-nbt/zlib-ng"] diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4b9de31..0000000 --- a/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM docker.io/library/rust:1.88.0-alpine AS builder - -WORKDIR /build -RUN apk add --no-cache build-base tini-static - -ARG MINEDMAP_VERSION - -COPY . . -RUN cargo build -r -RUN strip target/release/minedmap - -FROM scratch - -COPY --from=builder /sbin/tini-static /build/target/release/minedmap /bin/ -ENTRYPOINT [ "/bin/tini-static", "--", "/bin/minedmap" ] - -USER 1000:1000 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 2f9ad3f..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2015 Matthias Schiffer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index cd30c8b..b857454 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ * Render beautiful maps of your [Minecraft](https://minecraft.net/) worlds! * Put them on a webserver and view them in your browser! -* Compatible with unmodified Minecraft Java Edition 1.8 up to 1.21.7 (no mod installation required!) +* Compatible with unmodified Minecraft Java Edition 1.8 up to 1.20 (no mod installation necessary!) * Illumination layer: the world at night * Fast: create a full map for a huge 3GB savegame in less than 5 minutes in single-threaded operation * Multi-threading support: pass `-j N` to the renderer to use `N` parallel threads for generation @@ -22,20 +22,13 @@ based on [Leaflet](https://leafletjs.com/). The map renderer is heavily inspired ## How to use -Download the binary release that matches your platform from the Github release -page (or install from source using `cargo`), as well as the platform-independent -viewer archive. Extract the viewer archive. The extracted directory contains the -HTML and JavaScript to operate the viewer and will be made publicly accessible -on a web server. The image data generated by MinedMap will be stored in the -`data` subdirectory of the extracted viewer. - Minecraft stores its save data in a directory `~/.minecraft/saves` on Linux, and `C:\Users\\AppData\Roaming\.minecraft\saves`. To generate MinedMap tile data from a save game called "World", use the a command like the following -(replacing the first argument with the path to your save data; `` refers +(replacing the first argument with the path to your save data; `viewer` refers to the directory where you unpacked the MinedMap viewer): ```shell -minedmap ~/.minecraft/saves/World /data +minedmap ~/.minecraft/saves/World viewer/data ``` The first map generation might take a while for big worlds, but subsequent calls will @@ -54,19 +47,6 @@ This test server is very slow and cannot handle multiple requests concurrently, a proper webserver like [nginx](https://nginx.org/) or upload the viewer together with the generated map files to public webspace to make the map available to others. -If you are uploading the directory to a remote webserver, you do not need to upload the -`/data/processed` directory, as it is only used locally to allow processing -updates more quickly. - -### Image formats - -MinedMap renders map tiles as PNG by default. Pass `--image-format webp` to select -WebP instead. For typical Minecraft worlds, using WebP reduces file sizes by 20-25% -without increasing processing time. - -MinedMap always uses lossless compression for tile images, regardless of the -image format. - ### Signs ![Sign screenshot](https://raw.githubusercontent.com/neocturne/MinedMap/e5d9c813ba3118d04dc7e52e3dc6f48808a69120/docs/images/signs.png) @@ -98,14 +78,9 @@ matches. Finally, `--sign-transform` allows to specify sed-style replacement patterns to modify the text displayed on the map. This can be used if the text matched by `--sign-prefix` or `--sign-filter` should not be displayed: -`--sign-transform 's/\[Map\]//'` would replace each occurence of "\[Map\]" with +`--sign-filter 's/\[Map\]//'` would replace each occurence of "\[Map\]" with the empty string. -**Note:** On Windows, double quotes (`"`) must be used for arguments instead -of single quotes (`'`), and all backslashes in the arguments must be escaped -by doubling them. This can make regular expressions somewhat difficult to -write and to read. - ## Installation Binary builds of the map generator for Linux and Windows, as well as an archive @@ -117,11 +92,11 @@ or newer). The following command can be used to build the current development ve cargo install --git 'https://github.com/neocturne/MinedMap.git' ``` +In addition, CMake is needed to build the zlib-ng library. If you do not have +CMake installed, you can disable the zlib-ng feature by passing `--no-default-features` +to cargo. A pure-Rust zlib implementation will be used, which is more portable, +but slower than zlib-ng. + If you are looking for the older C++ implementation of the MinedMap tile renderer, see the [v1.19.1](https://github.com/neocturne/MinedMap/tree/v1.19.1) tag. -## See also - -Other projects using MinedMap: - -- [minecraft\_map\_marker](https://github.com/christopher-besch/minecraft_map_marker) diff --git a/crates/default-alloc/Cargo.toml b/crates/default-alloc/Cargo.toml deleted file mode 100644 index b03a871..0000000 --- a/crates/default-alloc/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "minedmap-default-alloc" -version = "0.1.0" -description = "Helper crate for target-specific selection of global allocator default" -edition.workspace = true -license.workspace = true -readme.workspace = true -repository.workspace = true - -[dependencies] -tikv-jemallocator = { version = "0.6.0", optional = true } - -[target.'cfg(target_env = "musl")'.dependencies] -tikv-jemallocator = "0.6.0" - -[features] -jemalloc = ["dep:tikv-jemallocator"] diff --git a/crates/default-alloc/src/lib.rs b/crates/default-alloc/src/lib.rs deleted file mode 100644 index 0797a5f..0000000 --- a/crates/default-alloc/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -#[cfg(any(target_env = "musl", feature = "jemalloc"))] -#[global_allocator] -static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; diff --git a/crates/nbt/Cargo.toml b/crates/nbt/Cargo.toml index 07a5fd7..2c817c6 100644 --- a/crates/nbt/Cargo.toml +++ b/crates/nbt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-nbt" -version = "0.2.0" +version = "0.1.1" description = "MinedMap's handling of Minecraft NBT data and region files" edition.workspace = true license.workspace = true @@ -11,10 +11,12 @@ repository.workspace = true anyhow = "1.0.75" bytemuck = "1.13.1" fastnbt = "2.4.4" -flate2 = "1.1.0" -minedmap-types = { version = "0.2.0", path = "../types" } +flate2 = "1.0.27" +minedmap-types = { version = "0.1.2", path = "../types" } serde = "1.0.183" +[features] +zlib-ng = ["flate2/zlib-ng"] + [dev-dependencies] clap = { version = "4.3.23", features = ["derive"] } -flate2 = { version = "1.1.0", features = ["zlib-rs"] } diff --git a/crates/nbt/examples/nbtdump.rs b/crates/nbt/examples/nbtdump.rs index 8b61693..66aaa2a 100644 --- a/crates/nbt/examples/nbtdump.rs +++ b/crates/nbt/examples/nbtdump.rs @@ -20,7 +20,7 @@ fn main() -> Result<()> { let args = Args::parse(); let value: fastnbt::Value = minedmap_nbt::data::from_file(args.file.as_path())?; - println!("{value:#x?}"); + println!("{:#x?}", value); Ok(()) } diff --git a/crates/nbt/examples/regiondump.rs b/crates/nbt/examples/regiondump.rs index 7cece8c..9315022 100644 --- a/crates/nbt/examples/regiondump.rs +++ b/crates/nbt/examples/regiondump.rs @@ -21,7 +21,7 @@ fn main() -> Result<()> { minedmap_nbt::region::from_file(args.file.as_path())?.foreach_chunk( |coords, value: fastnbt::Value| { - println!("Chunk {coords:?}: {value:#x?}"); + println!("Chunk {:?}: {:#x?}", coords, value); Ok(()) }, ) diff --git a/crates/nbt/src/region.rs b/crates/nbt/src/region.rs index 6a79a39..8a52b9d 100644 --- a/crates/nbt/src/region.rs +++ b/crates/nbt/src/region.rs @@ -2,11 +2,11 @@ use std::{ fs::File, - io::{SeekFrom, prelude::*}, + io::{prelude::*, SeekFrom}, path::Path, }; -use anyhow::{Context, Result, bail}; +use anyhow::{bail, Context, Result}; use flate2::read::ZlibDecoder; use serde::de::DeserializeOwned; @@ -124,7 +124,7 @@ impl Region { let mut len_buf = [0u8; 4]; reader .read_exact(&mut len_buf) - .with_context(|| format!("Failed to read length for chunk {coords:?}"))?; + .with_context(|| format!("Failed to read length for chunk {:?}", coords))?; let byte_len = u32::from_be_bytes(len_buf) as usize; if byte_len < 1 || byte_len > (len as usize) * BLOCKSIZE - 4 { bail!("Invalid length for chunk {:?}", coords); @@ -133,9 +133,9 @@ impl Region { let mut buffer = vec![0; byte_len]; reader .read_exact(&mut buffer) - .with_context(|| format!("Failed to read data for chunk {coords:?}"))?; + .with_context(|| format!("Failed to read data for chunk {:?}", coords))?; let chunk = decode_chunk(&buffer) - .with_context(|| format!("Failed to decode data for chunk {coords:?}"))?; + .with_context(|| format!("Failed to decode data for chunk {:?}", coords))?; f(coords, chunk)?; } diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index b59492c..364ac85 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-resource" -version = "0.8.0" +version = "0.3.0" description = "Data describing Minecraft biomes and block types" edition.workspace = true license.workspace = true @@ -8,6 +8,6 @@ readme.workspace = true repository.workspace = true [dependencies] -bincode = "2.0.1" -enumflags2 = "0.7.7" -glam = "0.30.0" +enumflags2 = { version = "0.7.7", features = ["serde"] } +glam = "0.25.0" +serde = { version = "1.0.183", features = ["derive"] } diff --git a/crates/resource/src/biomes.rs b/crates/resource/src/biomes.rs index 55c5e74..61f8339 100644 --- a/crates/resource/src/biomes.rs +++ b/crates/resource/src/biomes.rs @@ -1,117 +1,437 @@ -//! Biome data -//! -//! This file is generated using resource/biomes.py, do not edit +//! Biome data structures -use super::*; -use BiomeGrassColorModifier::*; +use serde::{Deserialize, Serialize}; -/// List if known biomes and their properties -pub const BIOMES: &[(&str, Biome)] = &[ +use super::Color; + +/// Grass color modifier used by a biome +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum BiomeGrassColorModifier { + /// Grass color modifier used by the dark forest biome + DarkForest, + /// Grass color modifier used by swamp biomes + Swamp, +} + +/// A biome specification +/// +/// A Biome contains all information about a biome necessary to compute a block +/// color given a block type and depth +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct Biome { + /// Temperature value + /// + /// For more efficient storage, the temperature is stored as an integer + /// after mutiplying the raw value by 20 + pub temp: i8, + /// Downfall value + /// + /// For more efficient storage, the downfall is stored as an integer + /// after mutiplying the raw value by 20 + pub downfall: i8, + /// Water color override + pub water_color: Option, + /// Foliage color override + pub foliage_color: Option, + /// Grass color override + pub grass_color: Option, + /// Grass color modifier + pub grass_color_modifier: Option, +} + +impl Biome { + /// Constructs a new Biome + const fn new(temp: i16, downfall: i16) -> Biome { + /// Helper to encode temperature and downfall values + /// + /// Converts temperatue and downfall from the input format + /// (mutiplied by 100) to i8 range for more efficient storage. + const fn encode(v: i16) -> i8 { + (v / 5) as i8 + } + Biome { + temp: encode(temp), + downfall: encode(downfall), + grass_color_modifier: None, + water_color: None, + foliage_color: None, + grass_color: None, + } + } + + /// Builder function to override the biome water color + const fn water(self, water_color: [u8; 3]) -> Biome { + Biome { + water_color: Some(Color(water_color)), + ..self + } + } + + /// Builder function to override the biome foliage color + const fn foliage(self, foliage_color: [u8; 3]) -> Biome { + Biome { + foliage_color: Some(Color(foliage_color)), + ..self + } + } + + /// Builder function to override the biome grass color + const fn grass(self, grass_color: [u8; 3]) -> Biome { + Biome { + grass_color: Some(Color(grass_color)), + ..self + } + } + + /// Builder function to set a grass color modifier + const fn modify(self, grass_color_modifier: BiomeGrassColorModifier) -> Biome { + Biome { + grass_color_modifier: Some(grass_color_modifier), + ..self + } + } + + /// Decodes a temperature or downfall value from the storage format to + /// f32 for further calculation + fn decode(val: i8) -> f32 { + f32::from(val) / 20.0 + } + + /// Returns the biome's temperature decoded to its original float value + pub fn temp(&self) -> f32 { + Self::decode(self.temp) + } + + /// Returns the biome's downfall decoded to its original float value + pub fn downfall(&self) -> f32 { + Self::decode(self.downfall) + } +} + +/// Standard biome specifications +pub const BIOMES: &[(&str, Biome)] = { + use BiomeGrassColorModifier::*; + + // Data extracted from Minecraft code decompiled using https://github.com/Hexeption/MCP-Reborn + + // We can't use floats in const functions, to temperature and downfall values + // are specified multipled by 100. The underscore is used in place of the decimal point + // of the original values. + + #[allow(clippy::zero_prefixed_literal)] + &[ + // Overworld + ( + "badlands", + Biome::new(2_00, 0_00) + .foliage([158, 129, 77]) + .grass([144, 129, 77]), + ), + ("bamboo_jungle", Biome::new(0_95, 0_90)), + ("beach", Biome::new(0_80, 0_40)), + ("birch_forest", Biome::new(0_60, 0_60)), + ( + "cherry_grove", + Biome::new(0_50, 0_80) + .water([93, 183, 239]) + .grass([182, 219, 97]) + .foliage([182, 219, 97]), + ), + ("cold_ocean", Biome::new(0_50, 0_50).water([61, 87, 214])), + ("dark_forest", Biome::new(0_70, 0_80).modify(DarkForest)), + ( + "deep_cold_ocean", + Biome::new(0_50, 0_50).water([61, 87, 214]), + ), + ("deep_dark", Biome::new(0_80, 0_40)), + ( + "deep_frozen_ocean", + Biome::new(0_50, 0_50).water([57, 56, 201]), + ), + ( + "deep_lukewarm_ocean", + Biome::new(0_50, 0_50).water([69, 173, 242]), + ), + ("deep_ocean", Biome::new(0_50, 0_50)), + ("desert", Biome::new(2_00, 0_00)), + ("dripstone_caves", Biome::new(0_80, 0_40)), + ( + "eroded_badlands", + Biome::new(2_00, 0_00) + .foliage([158, 129, 77]) + .grass([144, 129, 77]), + ), + ("flower_forest", Biome::new(0_70, 0_80)), + ("forest", Biome::new(0_70, 0_80)), + ("frozen_ocean", Biome::new(0_00, 0_50).water([57, 56, 201])), + ("frozen_peaks", Biome::new(-0_70, 0_90)), + ("frozen_river", Biome::new(0_00, 0_50).water([57, 56, 201])), + ("grove", Biome::new(-0_20, 0_80)), + ("ice_spikes", Biome::new(0_00, 0_50)), + ("jagged_peaks", Biome::new(-0_70, 0_90)), + ("jungle", Biome::new(0_95, 0_90)), + ( + "lukewarm_ocean", + Biome::new(0_50, 0_50).water([69, 173, 242]), + ), + ("lush_caves", Biome::new(0_50, 0_50)), + ( + "mangrove_swamp", + Biome::new(0_80, 0_90) + .water([58, 122, 106]) + .foliage([141, 177, 39]) + .modify(Swamp), + ), + ("meadow", Biome::new(0_50, 0_80).water([14, 78, 207])), + ("mushroom_fields", Biome::new(0_90, 1_00)), + ("ocean", Biome::new(0_50, 0_50)), + ("old_growth_birch_forest", Biome::new(0_60, 0_60)), + ("old_growth_pine_taiga", Biome::new(0_30, 0_80)), + ("old_growth_spruce_taiga", Biome::new(0_25, 0_80)), + ("plains", Biome::new(0_80, 0_40)), + ("river", Biome::new(0_50, 0_50)), + ("savanna", Biome::new(2_00, 0_00)), + ("savanna_plateau", Biome::new(2_00, 0_00)), + ("snowy_beach", Biome::new(0_05, 0_30).water([61, 87, 214])), + ("snowy_plains", Biome::new(0_00, 0_50)), + ("snowy_slopes", Biome::new(-0_30, 0_90)), + ("snowy_taiga", Biome::new(-0_50, 0_40).water([61, 87, 214])), + ("sparse_jungle", Biome::new(0_95, 0_80)), + ("stony_peaks", Biome::new(1_00, 0_30)), + ("stony_shore", Biome::new(0_20, 0_30)), + ("sunflower_plains", Biome::new(0_80, 0_40)), + ( + "swamp", + Biome::new(0_80, 0_90) + .water([97, 123, 100]) + .foliage([106, 112, 57]) + .modify(Swamp), + ), + ("taiga", Biome::new(0_25, 0_80)), + ("the_void", Biome::new(0_50, 0_50)), + ("warm_ocean", Biome::new(0_50, 0_50).water([67, 213, 238])), + ("windswept_forest", Biome::new(0_20, 0_30)), + ("windswept_gravelly_hills", Biome::new(0_20, 0_30)), + ("windswept_hills", Biome::new(0_20, 0_30)), + ("windswept_savanna", Biome::new(2_00, 0_00)), + ( + "wooded_badlands", + Biome::new(2_00, 0_00) + .foliage([158, 129, 77]) + .grass([144, 129, 77]), + ), + // Nether + ("basalt_deltas", Biome::new(2_00, 0_00)), + ("crimson_forest", Biome::new(2_00, 0_00)), + ("nether_wastes", Biome::new(2_00, 0_00)), + ("soul_sand_valley", Biome::new(2_00, 0_00)), + ("warped_forest", Biome::new(2_00, 0_00)), + // End + ("end_barrens", Biome::new(0_50, 0_50)), + ("end_highlands", Biome::new(0_50, 0_50)), + ("end_midlands", Biome::new(0_50, 0_50)), + ("small_end_islands", Biome::new(0_50, 0_50)), + ("the_end", Biome::new(0_50, 0_50)), + ] +}; + +/// Biome ID aliases +/// +/// Some biomes have been renamed or merged in recent Minecraft versions. +/// Maintain a list of aliases to support chunks saved by older versions. +pub const BIOME_ALIASES: &[(&str, &str)] = &[ + // Biomes fix + ("beaches", "beach"), + ("cold_beach", "snowy_beach"), + ("cold_deep_ocean", "deep_cold_ocean"), + ("extreme_hills", "mountains"), + ("extreme_hills_with_trees", "wooded_mountains"), + ("forest_hills", "wooded_hills"), + ("frozen_deep_ocean", "deep_frozen_ocean"), + ("hell", "nether_wastes"), + ("ice_flats", "snowy_tundra"), + ("ice_mountains", "snowy_mountains"), + ("lukewarm_deep_ocean", "deep_lukewarm_ocean"), + ("mesa", "badlands"), + ("mesa_clear_rock", "badlands_plateau"), + ("mesa_rock", "wooded_badlands_plateau"), + ("mushroom_island", "mushroom_fields"), + ("mushroom_island_shore", "mushroom_field_shore"), + ("mutated_birch_forest", "tall_birch_forest"), + ("mutated_birch_forest_hills", "tall_birch_hills"), + ("mutated_desert", "desert_lakes"), + ("mutated_extreme_hills", "gravelly_mountains"), ( - "badlands", - Biome::new(200, 0) - .foliage([158, 129, 77]) - .grass([144, 129, 77]), - ), - ("bamboo_jungle", Biome::new(95, 90)), - ("basalt_deltas", Biome::new(200, 0)), - ("beach", Biome::new(80, 40)), - ("birch_forest", Biome::new(60, 60)), - ( - "cherry_grove", - Biome::new(50, 80) - .foliage([182, 219, 97]) - .grass([182, 219, 97]) - .water([93, 183, 239]), - ), - ("cold_ocean", Biome::new(50, 50).water([61, 87, 214])), - ("crimson_forest", Biome::new(200, 0)), - ("dark_forest", Biome::new(70, 80).modify(DarkForest)), - ("deep_cold_ocean", Biome::new(50, 50).water([61, 87, 214])), - ("deep_dark", Biome::new(80, 40)), - ("deep_frozen_ocean", Biome::new(50, 50).water([57, 56, 201])), - ( - "deep_lukewarm_ocean", - Biome::new(50, 50).water([69, 173, 242]), - ), - ("deep_ocean", Biome::new(50, 50)), - ("desert", Biome::new(200, 0)), - ("dripstone_caves", Biome::new(80, 40)), - ("end_barrens", Biome::new(50, 50)), - ("end_highlands", Biome::new(50, 50)), - ("end_midlands", Biome::new(50, 50)), - ( - "eroded_badlands", - Biome::new(200, 0) - .foliage([158, 129, 77]) - .grass([144, 129, 77]), - ), - ("flower_forest", Biome::new(70, 80)), - ("forest", Biome::new(70, 80)), - ("frozen_ocean", Biome::new(0, 50).water([57, 56, 201])), - ("frozen_peaks", Biome::new(-70, 90)), - ("frozen_river", Biome::new(0, 50).water([57, 56, 201])), - ("grove", Biome::new(-20, 80)), - ("ice_spikes", Biome::new(0, 50)), - ("jagged_peaks", Biome::new(-70, 90)), - ("jungle", Biome::new(95, 90)), - ("lukewarm_ocean", Biome::new(50, 50).water([69, 173, 242])), - ("lush_caves", Biome::new(50, 50)), - ( - "mangrove_swamp", - Biome::new(80, 90) - .foliage([141, 177, 39]) - .modify(Swamp) - .water([58, 122, 106]), - ), - ("meadow", Biome::new(50, 80).water([14, 78, 207])), - ("mushroom_fields", Biome::new(90, 100)), - ("nether_wastes", Biome::new(200, 0)), - ("ocean", Biome::new(50, 50)), - ("old_growth_birch_forest", Biome::new(60, 60)), - ("old_growth_pine_taiga", Biome::new(30, 80)), - ("old_growth_spruce_taiga", Biome::new(25, 80)), - ( - "pale_garden", - Biome::new(70, 80) - .foliage([135, 141, 118]) - .grass([119, 130, 114]) - .water([118, 136, 157]), - ), - ("plains", Biome::new(80, 40)), - ("river", Biome::new(50, 50)), - ("savanna", Biome::new(200, 0)), - ("savanna_plateau", Biome::new(200, 0)), - ("small_end_islands", Biome::new(50, 50)), - ("snowy_beach", Biome::new(5, 30).water([61, 87, 214])), - ("snowy_plains", Biome::new(0, 50)), - ("snowy_slopes", Biome::new(-30, 90)), - ("snowy_taiga", Biome::new(-50, 40).water([61, 87, 214])), - ("soul_sand_valley", Biome::new(200, 0)), - ("sparse_jungle", Biome::new(95, 80)), - ("stony_peaks", Biome::new(100, 30)), - ("stony_shore", Biome::new(20, 30)), - ("sunflower_plains", Biome::new(80, 40)), - ( - "swamp", - Biome::new(80, 90) - .foliage([106, 112, 57]) - .modify(Swamp) - .water([97, 123, 100]), - ), - ("taiga", Biome::new(25, 80)), - ("the_end", Biome::new(50, 50)), - ("the_void", Biome::new(50, 50)), - ("warm_ocean", Biome::new(50, 50).water([67, 213, 238])), - ("warped_forest", Biome::new(200, 0)), - ("windswept_forest", Biome::new(20, 30)), - ("windswept_gravelly_hills", Biome::new(20, 30)), - ("windswept_hills", Biome::new(20, 30)), - ("windswept_savanna", Biome::new(200, 0)), - ( - "wooded_badlands", - Biome::new(200, 0) - .foliage([158, 129, 77]) - .grass([144, 129, 77]), + "mutated_extreme_hills_with_trees", + "modified_gravelly_mountains", ), + ("mutated_forest", "flower_forest"), + ("mutated_ice_flats", "ice_spikes"), + ("mutated_jungle", "modified_jungle"), + ("mutated_jungle_edge", "modified_jungle_edge"), + ("mutated_mesa", "eroded_badlands"), + ("mutated_mesa_clear_rock", "modified_badlands_plateau"), + ("mutated_mesa_rock", "modified_wooded_badlands_plateau"), + ("mutated_plains", "sunflower_plains"), + ("mutated_redwood_taiga", "giant_spruce_taiga"), + ("mutated_redwood_taiga_hills", "giant_spruce_taiga_hills"), + ("mutated_roofed_forest", "dark_forest_hills"), + ("mutated_savanna", "shattered_savanna"), + ("mutated_savanna_rock", "shattered_savanna_plateau"), + ("mutated_swampland", "swamp_hills"), + ("mutated_taiga", "taiga_mountains"), + ("mutated_taiga_cold", "snowy_taiga_mountains"), + ("redwood_taiga", "giant_tree_taiga"), + ("redwood_taiga_hills", "giant_tree_taiga_hills"), + ("roofed_forest", "dark_forest"), + ("savanna_rock", "savanna_plateau"), + ("sky", "the_end"), + ("sky_island_barren", "end_barrens"), + ("sky_island_high", "end_highlands"), + ("sky_island_low", "small_end_islands"), + ("sky_island_medium", "end_midlands"), + ("smaller_extreme_hills", "mountain_edge"), + ("stone_beach", "stone_shore"), + ("swampland", "swamp"), + ("taiga_cold", "snowy_taiga"), + ("taiga_cold_hills", "snowy_taiga_hills"), + ("void", "the_void"), + ("warm_deep_ocean", "deep_warm_ocean"), + // Nether biome rename + ("nether", "nether_wastes"), + // Caves and Cliffs biome renames + ("badlands_plateau", "badlands"), + ("bamboo_jungle_hills", "bamboo_jungle"), + ("birch_forest_hills", "birch_forest"), + ("dark_forest_hills", "dark_forest"), + ("desert_hills", "desert"), + ("desert_lakes", "desert"), + ("giant_spruce_taiga", "old_growth_spruce_taiga"), + ("giant_spruce_taiga_hills", "old_growth_spruce_taiga"), + ("giant_tree_taiga", "old_growth_pine_taiga"), + ("giant_tree_taiga_hills", "old_growth_pine_taiga"), + ("gravelly_mountains", "windswept_gravelly_hills"), + ("jungle_edge", "sparse_jungle"), + ("jungle_hills", "jungle"), + ("lofty_peaks", "jagged_peaks"), + ("modified_badlands_plateau", "badlands"), + ("modified_gravelly_mountains", "windswept_gravelly_hills"), + ("modified_jungle", "jungle"), + ("modified_jungle_edge", "sparse_jungle"), + ("modified_wooded_badlands_plateau", "wooded_badlands"), + ("mountain_edge", "windswept_hills"), + ("mountains", "windswept_hills"), + ("mushroom_field_shore", "mushroom_fields"), + ("shattered_savanna", "windswept_savanna"), + ("shattered_savanna_plateau", "windswept_savanna"), + ("snowcapped_peaks", "frozen_peaks"), + ("snowy_mountains", "snowy_plains"), + ("snowy_taiga_hills", "snowy_taiga"), + ("snowy_taiga_mountains", "snowy_taiga"), + ("snowy_tundra", "snowy_plains"), + ("stone_shore", "stony_shore"), + ("swamp_hills", "swamp"), + ("taiga_hills", "taiga"), + ("taiga_mountains", "taiga"), + ("tall_birch_forest", "old_growth_birch_forest"), + ("tall_birch_hills", "old_growth_birch_forest"), + ("wooded_badlands_plateau", "wooded_badlands"), + ("wooded_hills", "forest"), + ("wooded_mountains", "windswept_forest"), + // Remove Deep Warm Ocean + ("deep_warm_ocean", "warm_ocean"), ]; + +/// Maps old numeric biome IDs to new string IDs +pub fn legacy_biome(index: u8) -> &'static str { + match index { + 0 => "ocean", + 1 => "plains", + 2 => "desert", + 3 => "mountains", + 4 => "forest", + 5 => "taiga", + 6 => "swamp", + 7 => "river", + 8 => "nether_wastes", + 9 => "the_end", + 10 => "frozen_ocean", + 11 => "frozen_river", + 12 => "snowy_tundra", + 13 => "snowy_mountains", + 14 => "mushroom_fields", + 15 => "mushroom_field_shore", + 16 => "beach", + 17 => "desert_hills", + 18 => "wooded_hills", + 19 => "taiga_hills", + 20 => "mountain_edge", + 21 => "jungle", + 22 => "jungle_hills", + 23 => "jungle_edge", + 24 => "deep_ocean", + 25 => "stone_shore", + 26 => "snowy_beach", + 27 => "birch_forest", + 28 => "birch_forest_hills", + 29 => "dark_forest", + 30 => "snowy_taiga", + 31 => "snowy_taiga_hills", + 32 => "giant_tree_taiga", + 33 => "giant_tree_taiga_hills", + 34 => "wooded_mountains", + 35 => "savanna", + 36 => "savanna_plateau", + 37 => "badlands", + 38 => "wooded_badlands_plateau", + 39 => "badlands_plateau", + 40 => "small_end_islands", + 41 => "end_midlands", + 42 => "end_highlands", + 43 => "end_barrens", + 44 => "warm_ocean", + 45 => "lukewarm_ocean", + 46 => "cold_ocean", + 47 => "deep_warm_ocean", + 48 => "deep_lukewarm_ocean", + 49 => "deep_cold_ocean", + 50 => "deep_frozen_ocean", + 127 => "the_void", + 129 => "sunflower_plains", + 130 => "desert_lakes", + 131 => "gravelly_mountains", + 132 => "flower_forest", + 133 => "taiga_mountains", + 134 => "swamp_hills", + 140 => "ice_spikes", + 149 => "modified_jungle", + 151 => "modified_jungle_edge", + 155 => "tall_birch_forest", + 156 => "tall_birch_hills", + 157 => "dark_forest_hills", + 158 => "snowy_taiga_mountains", + 160 => "giant_spruce_taiga", + 161 => "giant_spruce_taiga_hills", + 162 => "modified_gravelly_mountains", + 163 => "shattered_savanna", + 164 => "shattered_savanna_plateau", + 165 => "eroded_badlands", + 166 => "modified_wooded_badlands_plateau", + 167 => "modified_badlands_plateau", + 168 => "bamboo_jungle", + 169 => "bamboo_jungle_hills", + 170 => "soul_sand_valley", + 171 => "crimson_forest", + 172 => "warped_forest", + 173 => "basalt_deltas", + 174 => "dripstone_caves", + 175 => "lush_caves", + 177 => "meadow", + 178 => "grove", + 179 => "snowy_slopes", + 180 => "snowcapped_peaks", + 181 => "lofty_peaks", + 182 => "stony_peaks", + _ => "ocean", + } +} diff --git a/crates/resource/src/block_types.rs b/crates/resource/src/block_types.rs index 9419690..6229016 100644 --- a/crates/resource/src/block_types.rs +++ b/crates/resource/src/block_types.rs @@ -1,12 +1,7 @@ -//! Block type information -//! -//! This file is generated using resource/generate.py, do not edit - use enumflags2::make_bitflags; use super::*; -/// List if known block types and their properties pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ ( "acacia_button", @@ -1488,16 +1483,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "bush", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque|Grass}), - color: Color([119, 120, 119]), - }, - sign_material: None, - }, - ), ( "cactus", ConstBlockType { @@ -1508,16 +1493,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "cactus_flower", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([209, 120, 135]), - }, - sign_material: None, - }, - ), ( "cake", ConstBlockType { @@ -1868,16 +1843,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "chiseled_copper", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([184, 100, 73]), - }, - sign_material: None, - }, - ), ( "chiseled_deepslate", ConstBlockType { @@ -1893,7 +1858,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ ConstBlockType { block_color: BlockColor { flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([45, 22, 27]), + color: Color([47, 23, 28]), }, sign_material: None, }, @@ -1928,16 +1893,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "chiseled_resin_bricks", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([200, 84, 24]), - }, - sign_material: None, - }, - ), ( "chiseled_sandstone", ConstBlockType { @@ -1958,26 +1913,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "chiseled_tuff", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([89, 94, 86]), - }, - sign_material: None, - }, - ), - ( - "chiseled_tuff_bricks", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([110, 113, 106]), - }, - sign_material: None, - }, - ), ( "chorus_flower", ConstBlockType { @@ -2008,16 +1943,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "closed_eyeblossom", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: None, - }, - ), ( "coal_block", ConstBlockType { @@ -2198,36 +2123,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "copper_bulb", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([156, 86, 57]), - }, - sign_material: None, - }, - ), - ( - "copper_door", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([192, 109, 82]), - }, - sign_material: None, - }, - ), - ( - "copper_grate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([191, 107, 79]), - }, - sign_material: None, - }, - ), ( "copper_ore", ConstBlockType { @@ -2238,16 +2133,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "copper_trapdoor", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([190, 106, 79]), - }, - sign_material: None, - }, - ), ( "cornflower", ConstBlockType { @@ -2308,16 +2193,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "crafter", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([112, 98, 99]), - }, - sign_material: None, - }, - ), ( "crafting_table", ConstBlockType { @@ -2328,16 +2203,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "creaking_heart", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([73, 59, 54]), - }, - sign_material: None, - }, - ), ( "creeper_head", ConstBlockType { @@ -3508,16 +3373,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "dried_ghast", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([179, 168, 168]), - }, - sign_material: None, - }, - ), ( "dried_kelp_block", ConstBlockType { @@ -3678,16 +3533,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "exposed_chiseled_copper", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([154, 119, 100]), - }, - sign_material: None, - }, - ), ( "exposed_copper", ConstBlockType { @@ -3698,46 +3543,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "exposed_copper_bulb", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([135, 107, 89]), - }, - sign_material: None, - }, - ), - ( - "exposed_copper_door", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([164, 123, 106]), - }, - sign_material: None, - }, - ), - ( - "exposed_copper_grate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([161, 125, 104]), - }, - sign_material: None, - }, - ), - ( - "exposed_copper_trapdoor", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([161, 125, 104]), - }, - sign_material: None, - }, - ), ( "exposed_cut_copper", ConstBlockType { @@ -3838,16 +3643,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "firefly_bush", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([87, 83, 43]), - }, - sign_material: None, - }, - ), ( "fletching_table", ConstBlockType { @@ -4388,16 +4183,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "heavy_core", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([82, 86, 94]), - }, - sign_material: None, - }, - ), ( "heavy_weighted_pressure_plate", ConstBlockType { @@ -4918,16 +4703,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "leaf_litter", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: None, - }, - ), ( "lectern", ConstBlockType { @@ -6338,16 +6113,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "open_eyeblossom", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: None, - }, - ), ( "orange_banner", ConstBlockType { @@ -6508,16 +6273,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "oxidized_chiseled_copper", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([83, 161, 132]), - }, - sign_material: None, - }, - ), ( "oxidized_copper", ConstBlockType { @@ -6528,46 +6283,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "oxidized_copper_bulb", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([70, 132, 109]), - }, - sign_material: None, - }, - ), - ( - "oxidized_copper_door", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([82, 160, 132]), - }, - sign_material: None, - }, - ), - ( - "oxidized_copper_grate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([82, 161, 131]), - }, - sign_material: None, - }, - ), - ( - "oxidized_copper_trapdoor", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([83, 161, 132]), - }, - sign_material: None, - }, - ), ( "oxidized_cut_copper", ConstBlockType { @@ -6618,206 +6333,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "pale_hanging_moss", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: None, - }, - ), - ( - "pale_moss_block", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([106, 112, 104]), - }, - sign_material: None, - }, - ), - ( - "pale_moss_carpet", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([106, 112, 104]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_button", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_door", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([216, 208, 206]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_fence", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([227, 217, 216]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_fence_gate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([227, 217, 216]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_hanging_sign", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: Some("pale_oak"), - }, - ), - ( - "pale_oak_leaves", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([116, 121, 114]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_log", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([198, 189, 187]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_planks", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([227, 217, 216]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_pressure_plate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([227, 217, 216]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_sapling", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([109, 105, 99]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_sign", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: Some("pale_oak"), - }, - ), - ( - "pale_oak_slab", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([227, 217, 216]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_stairs", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([227, 217, 216]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_trapdoor", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([229, 220, 218]), - }, - sign_material: None, - }, - ), - ( - "pale_oak_wall_hanging_sign", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{WallSign}), - color: Color([0, 0, 0]), - }, - sign_material: Some("pale_oak"), - }, - ), - ( - "pale_oak_wall_sign", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{WallSign}), - color: Color([0, 0, 0]), - }, - sign_material: Some("pale_oak"), - }, - ), - ( - "pale_oak_wood", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([87, 77, 75]), - }, - sign_material: None, - }, - ), ( "pearlescent_froglight", ConstBlockType { @@ -7348,46 +6863,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "polished_tuff", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([97, 104, 99]), - }, - sign_material: None, - }, - ), - ( - "polished_tuff_slab", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([97, 104, 99]), - }, - sign_material: None, - }, - ), - ( - "polished_tuff_stairs", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([97, 104, 99]), - }, - sign_material: None, - }, - ), - ( - "polished_tuff_wall", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([97, 104, 99]), - }, - sign_material: None, - }, - ), ( "poppy", ConstBlockType { @@ -7508,16 +6983,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "potted_closed_eyeblossom", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([108, 98, 101]), - }, - sign_material: None, - }, - ), ( "potted_cornflower", ConstBlockType { @@ -7638,16 +7103,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "potted_open_eyeblossom", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([133, 124, 127]), - }, - sign_material: None, - }, - ), ( "potted_orange_tulip", ConstBlockType { @@ -7668,16 +7123,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "potted_pale_oak_sapling", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([109, 105, 99]), - }, - sign_material: None, - }, - ), ( "potted_pink_tulip", ConstBlockType { @@ -8518,66 +7963,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "resin_block", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([217, 99, 25]), - }, - sign_material: None, - }, - ), - ( - "resin_brick_slab", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([205, 88, 24]), - }, - sign_material: None, - }, - ), - ( - "resin_brick_stairs", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([205, 88, 24]), - }, - sign_material: None, - }, - ), - ( - "resin_brick_wall", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([205, 88, 24]), - }, - sign_material: None, - }, - ), - ( - "resin_bricks", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([205, 88, 24]), - }, - sign_material: None, - }, - ), - ( - "resin_clump", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: None, - }, - ), ( "respawn_anchor", ConstBlockType { @@ -8742,18 +8127,8 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "seagrass", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([50, 126, 8]), - }, - sign_material: None, - }, - ), - ( - "short_dry_grass", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([187, 158, 108]), + flags: make_bitflags!(BlockFlag::{}), + color: Color([0, 0, 0]), }, sign_material: None, }, @@ -9568,26 +8943,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "stripped_pale_oak_log", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([235, 226, 225]), - }, - sign_material: None, - }, - ), - ( - "stripped_pale_oak_wood", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([245, 238, 236]), - }, - sign_material: None, - }, - ), ( "stripped_spruce_log", ConstBlockType { @@ -9698,16 +9053,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "tall_dry_grass", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([196, 171, 122]), - }, - sign_material: None, - }, - ), ( "tall_grass", ConstBlockType { @@ -9748,26 +9093,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "test_block", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: None, - }, - ), - ( - "test_instance_block", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: None, - }, - ), ( "tinted_glass", ConstBlockType { @@ -9828,16 +9153,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "trial_spawner", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([56, 82, 98]), - }, - sign_material: None, - }, - ), ( "tripwire", ConstBlockType { @@ -9908,76 +9223,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "tuff_brick_slab", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([98, 102, 95]), - }, - sign_material: None, - }, - ), - ( - "tuff_brick_stairs", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([98, 102, 95]), - }, - sign_material: None, - }, - ), - ( - "tuff_brick_wall", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([98, 102, 95]), - }, - sign_material: None, - }, - ), - ( - "tuff_bricks", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([98, 102, 95]), - }, - sign_material: None, - }, - ), - ( - "tuff_slab", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([108, 109, 102]), - }, - sign_material: None, - }, - ), - ( - "tuff_stairs", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([108, 109, 102]), - }, - sign_material: None, - }, - ), - ( - "tuff_wall", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([108, 109, 102]), - }, - sign_material: None, - }, - ), ( "turtle_egg", ConstBlockType { @@ -10008,16 +9253,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "vault", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([54, 69, 79]), - }, - sign_material: None, - }, - ), ( "verdant_froglight", ConstBlockType { @@ -10278,16 +9513,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "waxed_chiseled_copper", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([184, 100, 73]), - }, - sign_material: None, - }, - ), ( "waxed_copper_block", ConstBlockType { @@ -10298,46 +9523,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "waxed_copper_bulb", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([156, 86, 57]), - }, - sign_material: None, - }, - ), - ( - "waxed_copper_door", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([192, 109, 82]), - }, - sign_material: None, - }, - ), - ( - "waxed_copper_grate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([191, 107, 79]), - }, - sign_material: None, - }, - ), - ( - "waxed_copper_trapdoor", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([190, 106, 79]), - }, - sign_material: None, - }, - ), ( "waxed_cut_copper", ConstBlockType { @@ -10368,16 +9553,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "waxed_exposed_chiseled_copper", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([154, 119, 100]), - }, - sign_material: None, - }, - ), ( "waxed_exposed_copper", ConstBlockType { @@ -10388,46 +9563,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "waxed_exposed_copper_bulb", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([135, 107, 89]), - }, - sign_material: None, - }, - ), - ( - "waxed_exposed_copper_door", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([164, 123, 106]), - }, - sign_material: None, - }, - ), - ( - "waxed_exposed_copper_grate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([161, 125, 104]), - }, - sign_material: None, - }, - ), - ( - "waxed_exposed_copper_trapdoor", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([161, 125, 104]), - }, - sign_material: None, - }, - ), ( "waxed_exposed_cut_copper", ConstBlockType { @@ -10458,16 +9593,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "waxed_oxidized_chiseled_copper", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([83, 161, 132]), - }, - sign_material: None, - }, - ), ( "waxed_oxidized_copper", ConstBlockType { @@ -10478,46 +9603,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "waxed_oxidized_copper_bulb", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([70, 132, 109]), - }, - sign_material: None, - }, - ), - ( - "waxed_oxidized_copper_door", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([82, 160, 132]), - }, - sign_material: None, - }, - ), - ( - "waxed_oxidized_copper_grate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([82, 161, 131]), - }, - sign_material: None, - }, - ), - ( - "waxed_oxidized_copper_trapdoor", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([83, 161, 132]), - }, - sign_material: None, - }, - ), ( "waxed_oxidized_cut_copper", ConstBlockType { @@ -10548,16 +9633,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "waxed_weathered_chiseled_copper", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([104, 150, 111]), - }, - sign_material: None, - }, - ), ( "waxed_weathered_copper", ConstBlockType { @@ -10568,46 +9643,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "waxed_weathered_copper_bulb", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([92, 126, 99]), - }, - sign_material: None, - }, - ), - ( - "waxed_weathered_copper_door", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([110, 150, 109]), - }, - sign_material: None, - }, - ), - ( - "waxed_weathered_copper_grate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([106, 152, 110]), - }, - sign_material: None, - }, - ), - ( - "waxed_weathered_copper_trapdoor", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([108, 153, 110]), - }, - sign_material: None, - }, - ), ( "waxed_weathered_cut_copper", ConstBlockType { @@ -10638,16 +9673,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "weathered_chiseled_copper", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([104, 150, 111]), - }, - sign_material: None, - }, - ), ( "weathered_copper", ConstBlockType { @@ -10658,46 +9683,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "weathered_copper_bulb", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([92, 126, 99]), - }, - sign_material: None, - }, - ), - ( - "weathered_copper_door", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([110, 150, 109]), - }, - sign_material: None, - }, - ), - ( - "weathered_copper_grate", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([106, 152, 110]), - }, - sign_material: None, - }, - ), - ( - "weathered_copper_trapdoor", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([108, 153, 110]), - }, - sign_material: None, - }, - ), ( "weathered_cut_copper", ConstBlockType { @@ -10918,16 +9903,6 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), - ( - "wildflowers", - ConstBlockType { - block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), - }, - sign_material: None, - }, - ), ( "wither_rose", ConstBlockType { diff --git a/crates/resource/src/legacy_biomes.rs b/crates/resource/src/legacy_biomes.rs deleted file mode 100644 index d980823..0000000 --- a/crates/resource/src/legacy_biomes.rs +++ /dev/null @@ -1,202 +0,0 @@ -//! Manually maintained biome data (aliases and legacy biome IDs) - -/// Biome ID aliases -/// -/// Some biomes have been renamed or merged in recent Minecraft versions. -/// Maintain a list of aliases to support chunks saved by older versions. -pub const BIOME_ALIASES: &[(&str, &str)] = &[ - // Biomes fix - ("beaches", "beach"), - ("cold_beach", "snowy_beach"), - ("cold_deep_ocean", "deep_cold_ocean"), - ("extreme_hills", "mountains"), - ("extreme_hills_with_trees", "wooded_mountains"), - ("forest_hills", "wooded_hills"), - ("frozen_deep_ocean", "deep_frozen_ocean"), - ("hell", "nether_wastes"), - ("ice_flats", "snowy_tundra"), - ("ice_mountains", "snowy_mountains"), - ("lukewarm_deep_ocean", "deep_lukewarm_ocean"), - ("mesa", "badlands"), - ("mesa_clear_rock", "badlands_plateau"), - ("mesa_rock", "wooded_badlands_plateau"), - ("mushroom_island", "mushroom_fields"), - ("mushroom_island_shore", "mushroom_field_shore"), - ("mutated_birch_forest", "tall_birch_forest"), - ("mutated_birch_forest_hills", "tall_birch_hills"), - ("mutated_desert", "desert_lakes"), - ("mutated_extreme_hills", "gravelly_mountains"), - ( - "mutated_extreme_hills_with_trees", - "modified_gravelly_mountains", - ), - ("mutated_forest", "flower_forest"), - ("mutated_ice_flats", "ice_spikes"), - ("mutated_jungle", "modified_jungle"), - ("mutated_jungle_edge", "modified_jungle_edge"), - ("mutated_mesa", "eroded_badlands"), - ("mutated_mesa_clear_rock", "modified_badlands_plateau"), - ("mutated_mesa_rock", "modified_wooded_badlands_plateau"), - ("mutated_plains", "sunflower_plains"), - ("mutated_redwood_taiga", "giant_spruce_taiga"), - ("mutated_redwood_taiga_hills", "giant_spruce_taiga_hills"), - ("mutated_roofed_forest", "dark_forest_hills"), - ("mutated_savanna", "shattered_savanna"), - ("mutated_savanna_rock", "shattered_savanna_plateau"), - ("mutated_swampland", "swamp_hills"), - ("mutated_taiga", "taiga_mountains"), - ("mutated_taiga_cold", "snowy_taiga_mountains"), - ("redwood_taiga", "giant_tree_taiga"), - ("redwood_taiga_hills", "giant_tree_taiga_hills"), - ("roofed_forest", "dark_forest"), - ("savanna_rock", "savanna_plateau"), - ("sky", "the_end"), - ("sky_island_barren", "end_barrens"), - ("sky_island_high", "end_highlands"), - ("sky_island_low", "small_end_islands"), - ("sky_island_medium", "end_midlands"), - ("smaller_extreme_hills", "mountain_edge"), - ("stone_beach", "stone_shore"), - ("swampland", "swamp"), - ("taiga_cold", "snowy_taiga"), - ("taiga_cold_hills", "snowy_taiga_hills"), - ("void", "the_void"), - ("warm_deep_ocean", "deep_warm_ocean"), - // Nether biome rename - ("nether", "nether_wastes"), - // Caves and Cliffs biome renames - ("badlands_plateau", "badlands"), - ("bamboo_jungle_hills", "bamboo_jungle"), - ("birch_forest_hills", "birch_forest"), - ("dark_forest_hills", "dark_forest"), - ("desert_hills", "desert"), - ("desert_lakes", "desert"), - ("giant_spruce_taiga", "old_growth_spruce_taiga"), - ("giant_spruce_taiga_hills", "old_growth_spruce_taiga"), - ("giant_tree_taiga", "old_growth_pine_taiga"), - ("giant_tree_taiga_hills", "old_growth_pine_taiga"), - ("gravelly_mountains", "windswept_gravelly_hills"), - ("jungle_edge", "sparse_jungle"), - ("jungle_hills", "jungle"), - ("lofty_peaks", "jagged_peaks"), - ("modified_badlands_plateau", "badlands"), - ("modified_gravelly_mountains", "windswept_gravelly_hills"), - ("modified_jungle", "jungle"), - ("modified_jungle_edge", "sparse_jungle"), - ("modified_wooded_badlands_plateau", "wooded_badlands"), - ("mountain_edge", "windswept_hills"), - ("mountains", "windswept_hills"), - ("mushroom_field_shore", "mushroom_fields"), - ("shattered_savanna", "windswept_savanna"), - ("shattered_savanna_plateau", "windswept_savanna"), - ("snowcapped_peaks", "frozen_peaks"), - ("snowy_mountains", "snowy_plains"), - ("snowy_taiga_hills", "snowy_taiga"), - ("snowy_taiga_mountains", "snowy_taiga"), - ("snowy_tundra", "snowy_plains"), - ("stone_shore", "stony_shore"), - ("swamp_hills", "swamp"), - ("taiga_hills", "taiga"), - ("taiga_mountains", "taiga"), - ("tall_birch_forest", "old_growth_birch_forest"), - ("tall_birch_hills", "old_growth_birch_forest"), - ("wooded_badlands_plateau", "wooded_badlands"), - ("wooded_hills", "forest"), - ("wooded_mountains", "windswept_forest"), - // Remove Deep Warm Ocean - ("deep_warm_ocean", "warm_ocean"), -]; - -/// Maps old numeric biome IDs to new string IDs -pub fn legacy_biome(index: u8) -> &'static str { - match index { - 0 => "ocean", - 1 => "plains", - 2 => "desert", - 3 => "mountains", - 4 => "forest", - 5 => "taiga", - 6 => "swamp", - 7 => "river", - 8 => "nether_wastes", - 9 => "the_end", - 10 => "frozen_ocean", - 11 => "frozen_river", - 12 => "snowy_tundra", - 13 => "snowy_mountains", - 14 => "mushroom_fields", - 15 => "mushroom_field_shore", - 16 => "beach", - 17 => "desert_hills", - 18 => "wooded_hills", - 19 => "taiga_hills", - 20 => "mountain_edge", - 21 => "jungle", - 22 => "jungle_hills", - 23 => "jungle_edge", - 24 => "deep_ocean", - 25 => "stone_shore", - 26 => "snowy_beach", - 27 => "birch_forest", - 28 => "birch_forest_hills", - 29 => "dark_forest", - 30 => "snowy_taiga", - 31 => "snowy_taiga_hills", - 32 => "giant_tree_taiga", - 33 => "giant_tree_taiga_hills", - 34 => "wooded_mountains", - 35 => "savanna", - 36 => "savanna_plateau", - 37 => "badlands", - 38 => "wooded_badlands_plateau", - 39 => "badlands_plateau", - 40 => "small_end_islands", - 41 => "end_midlands", - 42 => "end_highlands", - 43 => "end_barrens", - 44 => "warm_ocean", - 45 => "lukewarm_ocean", - 46 => "cold_ocean", - 47 => "deep_warm_ocean", - 48 => "deep_lukewarm_ocean", - 49 => "deep_cold_ocean", - 50 => "deep_frozen_ocean", - 127 => "the_void", - 129 => "sunflower_plains", - 130 => "desert_lakes", - 131 => "gravelly_mountains", - 132 => "flower_forest", - 133 => "taiga_mountains", - 134 => "swamp_hills", - 140 => "ice_spikes", - 149 => "modified_jungle", - 151 => "modified_jungle_edge", - 155 => "tall_birch_forest", - 156 => "tall_birch_hills", - 157 => "dark_forest_hills", - 158 => "snowy_taiga_mountains", - 160 => "giant_spruce_taiga", - 161 => "giant_spruce_taiga_hills", - 162 => "modified_gravelly_mountains", - 163 => "shattered_savanna", - 164 => "shattered_savanna_plateau", - 165 => "eroded_badlands", - 166 => "modified_wooded_badlands_plateau", - 167 => "modified_badlands_plateau", - 168 => "bamboo_jungle", - 169 => "bamboo_jungle_hills", - 170 => "soul_sand_valley", - 171 => "crimson_forest", - 172 => "warped_forest", - 173 => "basalt_deltas", - 174 => "dripstone_caves", - 175 => "lush_caves", - 177 => "meadow", - 178 => "grove", - 179 => "snowy_slopes", - 180 => "snowcapped_peaks", - 181 => "lofty_peaks", - 182 => "stony_peaks", - _ => "ocean", - } -} diff --git a/crates/resource/src/legacy_block_types.rs b/crates/resource/src/legacy_block_types.rs index 0c4814d..c027ac3 100644 --- a/crates/resource/src/legacy_block_types.rs +++ b/crates/resource/src/legacy_block_types.rs @@ -13,7 +13,6 @@ const DEF: &str = "air"; const EMPTY: [&str; 16] = simple(DEF); /// Mapping from each numeric block type and damage/subtype ID to new string ID -#[allow(clippy::large_const_arrays)] pub const LEGACY_BLOCK_TYPES: [[&str; 16]; 256] = [ /* 0 */ simple("air"), diff --git a/crates/resource/src/lib.rs b/crates/resource/src/lib.rs index 86cfb0f..1baffda 100644 --- a/crates/resource/src/lib.rs +++ b/crates/resource/src/lib.rs @@ -4,19 +4,20 @@ mod biomes; mod block_color; -mod block_types; -mod legacy_biomes; mod legacy_block_types; +#[allow(clippy::missing_docs_in_private_items)] // Generated module +mod block_types; + use std::collections::HashMap; -use bincode::{BorrowDecode, Decode, Encode}; -use enumflags2::{BitFlags, bitflags}; +use enumflags2::{bitflags, BitFlags}; +use serde::{Deserialize, Serialize}; /// Flags describing special properties of [BlockType]s #[bitflags] #[repr(u8)] -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] pub enum BlockFlag { /// The block type is opaque Opaque, @@ -38,14 +39,14 @@ pub enum BlockFlag { } /// An RGB color with u8 components -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Encode, Decode)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Color(pub [u8; 3]); /// An RGB color with f32 components pub type Colorf = glam::Vec3; /// A block type specification -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize)] pub struct BlockColor { /// Bit set of [BlockFlag]s describing special properties of the block type pub flags: BitFlags, @@ -61,43 +62,6 @@ impl BlockColor { } } -impl Encode for BlockColor { - fn encode( - &self, - encoder: &mut E, - ) -> Result<(), bincode::error::EncodeError> { - bincode::Encode::encode(&self.flags.bits(), encoder)?; - bincode::Encode::encode(&self.color, encoder)?; - Ok(()) - } -} - -impl Decode for BlockColor { - fn decode>( - decoder: &mut D, - ) -> Result { - Ok(BlockColor { - flags: BitFlags::from_bits(bincode::Decode::decode(decoder)?).or(Err( - bincode::error::DecodeError::Other("invalid block flags"), - ))?, - color: bincode::Decode::decode(decoder)?, - }) - } -} - -impl<'de, Context> BorrowDecode<'de, Context> for BlockColor { - fn borrow_decode>( - decoder: &mut D, - ) -> Result { - Ok(BlockColor { - flags: BitFlags::from_bits(bincode::BorrowDecode::borrow_decode(decoder)?).or(Err( - bincode::error::DecodeError::Other("invalid block flags"), - ))?, - color: bincode::BorrowDecode::borrow_decode(decoder)?, - }) - } -} - /// A block type specification (for use in constants) #[derive(Debug, Clone)] struct ConstBlockType { @@ -171,112 +135,9 @@ impl BlockTypes { } } +pub use biomes::{Biome, BiomeGrassColorModifier}; pub use block_color::{block_color, needs_biome}; -/// Grass color modifier used by a biome -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Encode, Decode)] -pub enum BiomeGrassColorModifier { - /// Grass color modifier used by the dark forest biome - DarkForest, - /// Grass color modifier used by swamp biomes - Swamp, -} - -/// A biome specification -/// -/// A Biome contains all information about a biome necessary to compute a block -/// color given a block type and depth -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Encode, Decode)] -pub struct Biome { - /// Temperature value - /// - /// For more efficient storage, the temperature is stored as an integer - /// after mutiplying the raw value by 20 - pub temp: i8, - /// Downfall value - /// - /// For more efficient storage, the downfall is stored as an integer - /// after mutiplying the raw value by 20 - pub downfall: i8, - /// Water color override - pub water_color: Option, - /// Foliage color override - pub foliage_color: Option, - /// Grass color override - pub grass_color: Option, - /// Grass color modifier - pub grass_color_modifier: Option, -} - -impl Biome { - /// Constructs a new Biome - const fn new(temp: i16, downfall: i16) -> Biome { - /// Helper to encode temperature and downfall values - /// - /// Converts temperatue and downfall from the input format - /// (mutiplied by 100) to i8 range for more efficient storage. - const fn encode(v: i16) -> i8 { - (v / 5) as i8 - } - Biome { - temp: encode(temp), - downfall: encode(downfall), - grass_color_modifier: None, - water_color: None, - foliage_color: None, - grass_color: None, - } - } - - /// Builder function to override the biome water color - const fn water(self, water_color: [u8; 3]) -> Biome { - Biome { - water_color: Some(Color(water_color)), - ..self - } - } - - /// Builder function to override the biome foliage color - const fn foliage(self, foliage_color: [u8; 3]) -> Biome { - Biome { - foliage_color: Some(Color(foliage_color)), - ..self - } - } - - /// Builder function to override the biome grass color - const fn grass(self, grass_color: [u8; 3]) -> Biome { - Biome { - grass_color: Some(Color(grass_color)), - ..self - } - } - - /// Builder function to set a grass color modifier - const fn modify(self, grass_color_modifier: BiomeGrassColorModifier) -> Biome { - Biome { - grass_color_modifier: Some(grass_color_modifier), - ..self - } - } - - /// Decodes a temperature or downfall value from the storage format to - /// f32 for further calculation - fn decode(val: i8) -> f32 { - f32::from(val) / 20.0 - } - - /// Returns the biome's temperature decoded to its original float value - pub fn temp(&self) -> f32 { - Self::decode(self.temp) - } - - /// Returns the biome's downfall decoded to its original float value - pub fn downfall(&self) -> f32 { - Self::decode(self.downfall) - } -} - /// Used to look up standard Minecraft biome types #[derive(Debug)] pub struct BiomeTypes { @@ -284,8 +145,6 @@ pub struct BiomeTypes { biome_map: HashMap, /// Array used to look up old numeric biome IDs legacy_biomes: Box<[&'static Biome; 256]>, - /// Fallback for unknown (new/modded) biomes - fallback_biome: &'static Biome, } impl Default for BiomeTypes { @@ -295,7 +154,7 @@ impl Default for BiomeTypes { .map(|(k, v)| (String::from(*k), v)) .collect(); - for &(old, new) in legacy_biomes::BIOME_ALIASES.iter().rev() { + for &(old, new) in biomes::BIOME_ALIASES.iter().rev() { let biome = biome_map .get(new) .copied() @@ -305,19 +164,16 @@ impl Default for BiomeTypes { let legacy_biomes = (0..=255) .map(|index| { - let id = legacy_biomes::legacy_biome(index); + let id = biomes::legacy_biome(index); *biome_map.get(id).expect("Unknown legacy biome") }) .collect::>() .try_into() .unwrap(); - let fallback_biome = *biome_map.get("plains").expect("Plains biome undefined"); - Self { biome_map, legacy_biomes, - fallback_biome, } } } @@ -335,10 +191,4 @@ impl BiomeTypes { pub fn get_legacy(&self, id: u8) -> Option<&Biome> { Some(self.legacy_biomes[id as usize]) } - - /// Returns the fallback for unknown (new/modded) biomes - #[inline] - pub fn get_fallback(&self) -> &Biome { - self.fallback_biome - } } diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index 34caa1c..e67d824 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-types" -version = "0.2.0" +version = "0.1.2" description = "Common types used by several MinedMap crates" edition.workspace = true license.workspace = true @@ -8,5 +8,5 @@ readme.workspace = true repository.workspace = true [dependencies] -bincode = "2.0.1" -itertools = "0.14.0" +itertools = "0.12.0" +serde = { version = "1.0.183", features = ["derive"] } diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index f2dc0e1..e219a97 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -8,8 +8,8 @@ use std::{ ops::{Index, IndexMut}, }; -use bincode::{Decode, Encode}; use itertools::iproduct; +use serde::{Deserialize, Serialize}; /// Const generic AXIS arguments for coordinate types pub mod axis { @@ -47,11 +47,12 @@ macro_rules! coord_type { /// Returns an iterator over all possible values of the type #[inline] - pub fn iter() -> impl DoubleEndedIterator> - + ExactSizeIterator - + FusedIterator - + Clone - + Debug { + pub fn iter() -> impl Iterator> + + DoubleEndedIterator + + ExactSizeIterator + + FusedIterator + + Clone + + Debug { (0..Self::MAX as u8).map($t) } } @@ -110,7 +111,7 @@ impl LayerBlockCoords { /// Generic array for data stored per block of a chunk layer /// /// Includes various convenient iteration functions. -#[derive(Debug, Clone, Copy, Default, Encode, Decode)] +#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)] pub struct LayerBlockArray(pub [[T; BLOCKS_PER_CHUNK]; BLOCKS_PER_CHUNK]); impl Index for LayerBlockArray { @@ -196,7 +197,7 @@ impl Debug for ChunkCoords { /// Generic array for data stored per chunk of a region /// /// Includes various convenient iteration functions. -#[derive(Debug, Clone, Copy, Default, Encode, Decode)] +#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)] pub struct ChunkArray(pub [[T; CHUNKS_PER_REGION]; CHUNKS_PER_REGION]); impl ChunkArray { diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index c725ae2..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,51 +0,0 @@ -# This is an example docker-compose configuration providing a Minecraft server, -# map generator and webserver. Visit http://localhost:8080 to view the map. -# -# See https://docker-minecraft-server.readthedocs.io/ for more information on -# the itzg/minecraft-server image and its configuration. - -services: - mc: - image: docker.io/itzg/minecraft-server - environment: - EULA: 'true' - ports: - - '25565:25565' - volumes: - - data:/data - stdin_open: true - tty: true - restart: unless-stopped - - minedmap: - image: ghcr.io/neocturne/minedmap/minedmap - command: - - '--jobs-initial=2' - - '--image-format=webp' - - '--sign-filter=\[Map\]' - - '--sign-transform=s/\[Map\]//' - - '--watch' - - '/input/world' - - '/output' - volumes: - - data:/input:ro - - output:/output - - processed:/output/processed - network_mode: 'none' - depends_on: - mc: - condition: service_healthy - restart: unless-stopped - - viewer: - image: ghcr.io/neocturne/minedmap/viewer - ports: - - '8080:80' - volumes: - - output:/usr/share/nginx/html/data:ro - restart: unless-stopped - -volumes: - data: {} - processed: {} - output: {} diff --git a/resource/README.md b/resource/README.md index 12302ec..ab9d5ea 100644 --- a/resource/README.md +++ b/resource/README.md @@ -11,15 +11,13 @@ work. - `extract.py`: Takes the block type information from `blocks.json` and texture data from an unpacked Minecraft JAR, storing the result in `colors.json` - `generate.py`: Generates `block_types.rs` from `colors.json` -- `biomes.py`: Generates `biomes.rs` from biome JSON files of an unpacked - Minecraft JAR - `sign_textures.py`: Generates all needed sign graphics from Minecraft assets In addition to these scripts, the JSON processor *jq* is a useful tool to work with MinedMap's resource metadata. -## How to add support for block IDs and biomes of a new Minecraft version +## How to add support for block IDs of a new Minecraft version 1. Download the Minecraft version you want to support as well as the previous version currently supported by MinedMap. You can use the Minecraft launcher @@ -71,17 +69,6 @@ with MinedMap's resource metadata. cargo fmt --all ``` -8. Update the source code for new biome data: - - ```sh - ./biomes.py data/new ../crates/resource/src/biomes.rs - cargo fmt --all - ``` - - After regenerating, check if only new biomes were added. If entries - got removed, biomes may have been renamed or merged, requiring updates - to the alias list in `crates/resource/src/legacy_biomes.rs`. - After the update, the new version should be tested with old savegames (both before and after migration by the new version) as well as newly generated worlds. Use creative mode to add the new block types to your test world. diff --git a/resource/biomes.py b/resource/biomes.py deleted file mode 100755 index 4e3bc51..0000000 --- a/resource/biomes.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python3 - -import json -import os -import sys - - -if len(sys.argv) != 3: - sys.exit('Usage: biomes.py ') - -biomes = {} - -for file in os.scandir(os.path.join(sys.argv[1], 'data/minecraft/worldgen/biome')): - (name, ext) = os.path.splitext(file.name) - if ext != '.json': - continue - with open(file) as f: - data = json.load(f) - biomes[name] = { - 'downfall': data['downfall'], - 'temperature': data['temperature'], - 'foliage_color': data['effects'].get('foliage_color'), - 'grass_color': data['effects'].get('grass_color'), - 'grass_color_modifier': data['effects'].get('grass_color_modifier'), - 'water_color': data['effects'].get('water_color'), - } - -def color(v): - return f'[{v>>16}, {(v>>8)&0xff}, {v&0xff}]' - -# Converts the snake_case grass color modifier to CamelCase -def modify(v): - return ''.join([s.capitalize() for s in v.split('_')]) - -def gen_biome(name, info, f): - temp = round(100*info['temperature']) - downfall = round(100*info['downfall']) - foliage_color = info['foliage_color'] - grass_color = info['grass_color'] - grass_color_modifier = info['grass_color_modifier'] - water_color = info['water_color'] - - print(f'\t("{name}", Biome::new({temp}, {downfall})', file=f) - - if foliage_color is not None: - print(f'\t\t.foliage({color(foliage_color)})', file=f) - if grass_color is not None: - print(f'\t\t.grass({color(grass_color)})', file=f) - if grass_color_modifier is not None: - print(f'\t\t.modify({modify(grass_color_modifier)})', file=f) - if water_color is not None and water_color != 0x3f76e4: - print(f'\t\t.water({color(water_color)})', file=f) - - print('\t),', file=f) - -with open(sys.argv[2], 'w') as f: - print('//! Biome data', file=f); - print('//!', file=f); - print('//! This file is generated using resource/biomes.py, do not edit', file=f); - print('', file=f) - print('use super::*;', file=f) - print('use BiomeGrassColorModifier::*;', file=f) - print('', file=f) - print('/// List if known biomes and their properties', file=f); - print('pub const BIOMES: &[(&str, Biome)] = &[', file=f) - - for name in sorted(biomes): - gen_biome(name, biomes[name], f) - - print('];', file=f) diff --git a/resource/blocks.json b/resource/blocks.json index 15dae2b..f8b0165 100644 --- a/resource/blocks.json +++ b/resource/blocks.json @@ -316,13 +316,9 @@ "bubble_coral_fan": null, "bubble_coral_wall_fan": null, "budding_amethyst": {}, - "bush": { - "grass": true - }, "cactus": { "texture": "cactus_top" }, - "cactus_flower": {}, "cake": { "texture": "cake_top" }, @@ -412,7 +408,6 @@ "chiseled_bookshelf": { "texture": "chiseled_bookshelf_top" }, - "chiseled_copper": {}, "chiseled_deepslate": {}, "chiseled_nether_bricks": {}, "chiseled_polished_blackstone": {}, @@ -420,19 +415,13 @@ "chiseled_red_sandstone": { "texture": "red_sandstone_top" }, - "chiseled_resin_bricks": {}, "chiseled_sandstone": { "texture": "sandstone_top" }, "chiseled_stone_bricks": {}, - "chiseled_tuff": {}, - "chiseled_tuff_bricks": { - "texture": "chiseled_tuff_bricks_top" - }, "chorus_flower": {}, "chorus_plant": {}, "clay": {}, - "closed_eyeblossom": null, "coal_block": {}, "coal_ore": {}, "coarse_dirt": {}, @@ -469,28 +458,16 @@ }, "conduit": {}, "copper_block": {}, - "copper_bulb": {}, - "copper_door": { - "texture": "copper_door_top" - }, - "copper_grate": {}, "copper_ore": {}, - "copper_trapdoor": {}, "cornflower": null, "cracked_deepslate_bricks": {}, "cracked_deepslate_tiles": {}, "cracked_nether_bricks": {}, "cracked_polished_blackstone_bricks": {}, "cracked_stone_bricks": {}, - "crafter": { - "texture": "crafter_top" - }, "crafting_table": { "texture": "crafting_table_top" }, - "creaking_heart": { - "texture": "creaking_heart_top" - }, "creeper_head": null, "creeper_wall_head": null, "crimson_button": null, @@ -720,9 +697,6 @@ "dragon_egg": {}, "dragon_head": null, "dragon_wall_head": null, - "dried_ghast": { - "texture": "dried_ghast_hydration_1_top" - }, "dried_kelp_block": { "texture": "dried_kelp_top" }, @@ -759,14 +733,7 @@ "ender_chest": { "texture": "obsidian" }, - "exposed_chiseled_copper": {}, "exposed_copper": {}, - "exposed_copper_bulb": {}, - "exposed_copper_door": { - "texture": "exposed_copper_door_top" - }, - "exposed_copper_grate": {}, - "exposed_copper_trapdoor": {}, "exposed_cut_copper": {}, "exposed_cut_copper_slab": { "texture": "exposed_cut_copper" @@ -785,7 +752,6 @@ "fire_coral_block": {}, "fire_coral_fan": null, "fire_coral_wall_fan": null, - "firefly_bush": {}, "fletching_table": { "texture": "fletching_table_top" }, @@ -877,7 +843,6 @@ "hay_block": { "texture": "hay_block_top" }, - "heavy_core": {}, "heavy_weighted_pressure_plate": { "texture": "iron_block" }, @@ -995,7 +960,6 @@ "lava_cauldron": { "texture": "cauldron_top" }, - "leaf_litter": null, "lectern": { "texture": "lectern_top" }, @@ -1283,7 +1247,6 @@ "ochre_froglight": { "texture": "ochre_froglight_top" }, - "open_eyeblossom": null, "orange_banner": null, "orange_bed": null, "orange_candle": null, @@ -1306,14 +1269,7 @@ "orange_wall_banner": null, "orange_wool": {}, "oxeye_daisy": null, - "oxidized_chiseled_copper": {}, "oxidized_copper": {}, - "oxidized_copper_bulb": {}, - "oxidized_copper_door": { - "texture": "oxidized_copper_door_top" - }, - "oxidized_copper_grate": {}, - "oxidized_copper_trapdoor": {}, "oxidized_cut_copper": {}, "oxidized_cut_copper_slab": { "texture": "oxidized_cut_copper" @@ -1323,56 +1279,6 @@ }, "packed_ice": {}, "packed_mud": {}, - "pale_hanging_moss": null, - "pale_moss_block": {}, - "pale_moss_carpet": {}, - "pale_oak_button": null, - "pale_oak_door": { - "texture": "pale_oak_door_top" - }, - "pale_oak_fence": { - "texture": "pale_oak_planks" - }, - "pale_oak_fence_gate": { - "texture": "pale_oak_planks" - }, - "pale_oak_hanging_sign": { - "sign_material": "pale_oak", - "texture": null - }, - "pale_oak_leaves": {}, - "pale_oak_log": { - "texture": "pale_oak_log_top" - }, - "pale_oak_planks": {}, - "pale_oak_pressure_plate": { - "texture": "pale_oak_planks" - }, - "pale_oak_sapling": {}, - "pale_oak_sign": { - "sign_material": "pale_oak", - "texture": null - }, - "pale_oak_slab": { - "texture": "pale_oak_planks" - }, - "pale_oak_stairs": { - "texture": "pale_oak_planks" - }, - "pale_oak_trapdoor": {}, - "pale_oak_wall_hanging_sign": { - "sign_material": "pale_oak", - "texture": null, - "wall_sign": true - }, - "pale_oak_wall_sign": { - "sign_material": "pale_oak", - "texture": null, - "wall_sign": true - }, - "pale_oak_wood": { - "texture": "pale_oak_log" - }, "pearlescent_froglight": { "texture": "pearlescent_froglight_top" }, @@ -1484,16 +1390,6 @@ "polished_granite_stairs": { "texture": "polished_granite" }, - "polished_tuff": {}, - "polished_tuff_slab": { - "texture": "polished_tuff" - }, - "polished_tuff_stairs": { - "texture": "polished_tuff" - }, - "polished_tuff_wall": { - "texture": "polished_tuff" - }, "poppy": null, "potatoes": { "texture": "potatoes_stage3" @@ -1528,9 +1424,6 @@ "potted_cherry_sapling": { "texture": "cherry_sapling" }, - "potted_closed_eyeblossom": { - "texture": "closed_eyeblossom" - }, "potted_cornflower": { "texture": "cornflower" }, @@ -1568,18 +1461,12 @@ "potted_oak_sapling": { "texture": "oak_sapling" }, - "potted_open_eyeblossom": { - "texture": "open_eyeblossom" - }, "potted_orange_tulip": { "texture": "orange_tulip" }, "potted_oxeye_daisy": { "texture": "oxeye_daisy" }, - "potted_pale_oak_sapling": { - "texture": "pale_oak_sapling" - }, "potted_pink_tulip": { "texture": "pink_tulip" }, @@ -1742,18 +1629,6 @@ "repeating_command_block": { "texture": "repeating_command_block_front" }, - "resin_block": {}, - "resin_brick_slab": { - "texture": "resin_bricks" - }, - "resin_brick_stairs": { - "texture": "resin_bricks" - }, - "resin_brick_wall": { - "texture": "resin_bricks" - }, - "resin_bricks": {}, - "resin_clump": null, "respawn_anchor": { "texture": "respawn_anchor_top" }, @@ -1790,8 +1665,7 @@ "sculk_vein": {}, "sea_lantern": {}, "sea_pickle": {}, - "seagrass": {}, - "short_dry_grass": {}, + "seagrass": null, "short_grass": null, "shroomlight": {}, "shulker_box": {}, @@ -1990,12 +1864,6 @@ "stripped_oak_wood": { "texture": "stripped_oak_log" }, - "stripped_pale_oak_log": { - "texture": "stripped_pale_oak_log_top" - }, - "stripped_pale_oak_wood": { - "texture": "stripped_pale_oak_log" - }, "stripped_spruce_log": { "texture": "stripped_spruce_log_top" }, @@ -2023,7 +1891,6 @@ "sweet_berry_bush": { "texture": "sweet_berry_bush_stage3" }, - "tall_dry_grass": {}, "tall_grass": { "grass": true, "texture": "tall_grass_top" @@ -2035,8 +1902,6 @@ "texture": "target_top" }, "terracotta": {}, - "test_block": null, - "test_instance_block": null, "tinted_glass": {}, "tnt": { "texture": "tnt_top" @@ -2047,9 +1912,6 @@ "trapped_chest": { "texture": "oak_planks" }, - "trial_spawner": { - "texture": "trial_spawner_top_inactive" - }, "tripwire": null, "tripwire_hook": null, "tube_coral": null, @@ -2057,31 +1919,9 @@ "tube_coral_fan": null, "tube_coral_wall_fan": null, "tuff": {}, - "tuff_brick_slab": { - "texture": "tuff_bricks" - }, - "tuff_brick_stairs": { - "texture": "tuff_bricks" - }, - "tuff_brick_wall": { - "texture": "tuff_bricks" - }, - "tuff_bricks": {}, - "tuff_slab": { - "texture": "tuff" - }, - "tuff_stairs": { - "texture": "tuff" - }, - "tuff_wall": { - "texture": "tuff" - }, "turtle_egg": {}, "twisting_vines": {}, "twisting_vines_plant": {}, - "vault": { - "texture": "vault_top" - }, "verdant_froglight": { "texture": "verdant_froglight_top" }, @@ -2151,24 +1991,9 @@ "water_cauldron": { "texture": "cauldron_top" }, - "waxed_chiseled_copper": { - "texture": "chiseled_copper" - }, "waxed_copper_block": { "texture": "copper_block" }, - "waxed_copper_bulb": { - "texture": "copper_bulb" - }, - "waxed_copper_door": { - "texture": "copper_door_top" - }, - "waxed_copper_grate": { - "texture": "copper_grate" - }, - "waxed_copper_trapdoor": { - "texture": "copper_trapdoor" - }, "waxed_cut_copper": { "texture": "cut_copper" }, @@ -2178,24 +2003,9 @@ "waxed_cut_copper_stairs": { "texture": "cut_copper" }, - "waxed_exposed_chiseled_copper": { - "texture": "exposed_chiseled_copper" - }, "waxed_exposed_copper": { "texture": "exposed_copper" }, - "waxed_exposed_copper_bulb": { - "texture": "exposed_copper_bulb" - }, - "waxed_exposed_copper_door": { - "texture": "exposed_copper_door_top" - }, - "waxed_exposed_copper_grate": { - "texture": "exposed_copper_grate" - }, - "waxed_exposed_copper_trapdoor": { - "texture": "exposed_copper_trapdoor" - }, "waxed_exposed_cut_copper": { "texture": "exposed_cut_copper" }, @@ -2205,24 +2015,9 @@ "waxed_exposed_cut_copper_stairs": { "texture": "exposed_cut_copper" }, - "waxed_oxidized_chiseled_copper": { - "texture": "oxidized_chiseled_copper" - }, "waxed_oxidized_copper": { "texture": "oxidized_copper" }, - "waxed_oxidized_copper_bulb": { - "texture": "oxidized_copper_bulb" - }, - "waxed_oxidized_copper_door": { - "texture": "oxidized_copper_door_top" - }, - "waxed_oxidized_copper_grate": { - "texture": "oxidized_copper_grate" - }, - "waxed_oxidized_copper_trapdoor": { - "texture": "oxidized_copper_trapdoor" - }, "waxed_oxidized_cut_copper": { "texture": "oxidized_cut_copper" }, @@ -2232,24 +2027,9 @@ "waxed_oxidized_cut_copper_stairs": { "texture": "oxidized_cut_copper" }, - "waxed_weathered_chiseled_copper": { - "texture": "weathered_chiseled_copper" - }, "waxed_weathered_copper": { "texture": "weathered_copper" }, - "waxed_weathered_copper_bulb": { - "texture": "weathered_copper_bulb" - }, - "waxed_weathered_copper_door": { - "texture": "weathered_copper_door_top" - }, - "waxed_weathered_copper_grate": { - "texture": "weathered_copper_grate" - }, - "waxed_weathered_copper_trapdoor": { - "texture": "weathered_copper_trapdoor" - }, "waxed_weathered_cut_copper": { "texture": "weathered_cut_copper" }, @@ -2259,14 +2039,7 @@ "waxed_weathered_cut_copper_stairs": { "texture": "weathered_cut_copper" }, - "weathered_chiseled_copper": {}, "weathered_copper": {}, - "weathered_copper_bulb": {}, - "weathered_copper_door": { - "texture": "weathered_copper_door_top" - }, - "weathered_copper_grate": {}, - "weathered_copper_trapdoor": {}, "weathered_cut_copper": {}, "weathered_cut_copper_slab": { "texture": "weathered_cut_copper" @@ -2301,7 +2074,6 @@ "white_tulip": null, "white_wall_banner": null, "white_wool": {}, - "wildflowers": null, "wither_rose": null, "wither_skeleton_skull": null, "wither_skeleton_wall_skull": null, diff --git a/resource/generate.py b/resource/generate.py index ab91324..8064482 100755 --- a/resource/generate.py +++ b/resource/generate.py @@ -14,15 +14,10 @@ with open(sys.argv[1]) as f: output = {} with open(sys.argv[2], 'w') as f: - print('//! Block type information', file=f); - print('//!', file=f); - print('//! This file is generated using resource/generate.py, do not edit', file=f); - print('', file=f) print('use enumflags2::make_bitflags;', file=f); print('', file=f) print('use super::*;', file=f) print('', file=f) - print('/// List if known block types and their properties', file=f); print('pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[', file=f) for name, info in colors.items(): diff --git a/resource/sign_textures.py b/resource/sign_textures.py index 846ab3e..e0b548d 100755 --- a/resource/sign_textures.py +++ b/resource/sign_textures.py @@ -15,7 +15,6 @@ MATERIALS = [ 'jungle', 'mangrove', 'oak', - 'pale_oak', 'spruce', 'warped', ] diff --git a/src/core/common.rs b/src/core/common.rs index 094d567..9a94496 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -3,15 +3,13 @@ use std::{ collections::{BTreeMap, BTreeSet}, fmt::Debug, - hash::Hash, path::{Path, PathBuf}, }; use anyhow::{Context, Result}; -use bincode::{Decode, Encode}; -use clap::ValueEnum; +use indexmap::IndexSet; use regex::{Regex, RegexSet}; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use crate::{ io::fs::FileMetaVersion, @@ -20,13 +18,13 @@ use crate::{ world::{block_entity::BlockEntity, layer}, }; -// Increase to force regeneration of all output files +/// Increase to force regeneration of all output files /// MinedMap processed region data version number /// /// Increase when the generation of processed regions from region data changes /// (usually because of updated resource data) -pub const REGION_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(8); +pub const REGION_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(1); /// MinedMap map tile data version number /// @@ -38,7 +36,7 @@ pub const MAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(0); /// /// Increase when the generation of lightmap tiles from region data changes /// (usually because of updated resource data) -pub const LIGHTMAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(6); +pub const LIGHTMAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(1); /// MinedMap mipmap data version number /// @@ -48,7 +46,7 @@ pub const MIPMAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(0); /// MinedMap processed entity data version number /// /// Increase when entity collection changes bacause of code changes. -pub const ENTITIES_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(3); +pub const ENTITIES_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(0); /// Coordinate pair of a generated tile /// @@ -87,7 +85,7 @@ impl TileCoordMap { } /// Data structure for storing chunk data between processing and rendering steps -#[derive(Debug, Encode, Decode)] +#[derive(Debug, Serialize, Deserialize)] pub struct ProcessedChunk { /// Block type data pub blocks: Box, @@ -98,18 +96,18 @@ pub struct ProcessedChunk { } /// Data structure for storing region data between processing and rendering steps -#[derive(Debug, Default, Encode, Decode)] +#[derive(Debug, Default, Serialize, Deserialize)] pub struct ProcessedRegion { /// List of biomes used in the region /// /// Indexed by [ProcessedChunk] biome data - pub biome_list: Vec, + pub biome_list: IndexSet, /// Processed chunk data pub chunks: ChunkArray>>, } /// Data structure for storing entity data between processing and collection steps -#[derive(Debug, Default, Encode, Decode)] +#[derive(Debug, Default, Serialize, Deserialize)] pub struct ProcessedEntities { /// List of block entities pub block_entities: Vec, @@ -136,14 +134,10 @@ pub enum TileKind { pub struct Config { /// Number of threads for parallel processing pub num_threads: usize, - /// Number of threads for initial parallel processing - pub num_threads_initial: usize, /// Path of input region directory pub region_dir: PathBuf, /// Path of input `level.dat` file pub level_dat_path: PathBuf, - /// Path of input `level.dat_old` file - pub level_dat_old_path: PathBuf, /// Base path for storage of rendered tile data pub output_dir: PathBuf, /// Path for storage of intermediate processed data files @@ -156,8 +150,6 @@ pub struct Config { pub viewer_info_path: PathBuf, /// Path of viewer entities file pub viewer_entities_path: PathBuf, - /// Format of generated map tiles - pub image_format: ImageFormat, /// Sign text filter patterns pub sign_patterns: RegexSet, /// Sign text transformation pattern @@ -172,13 +164,9 @@ impl Config { Some(threads) => threads, None => 1, }; - let num_threads_initial = args.jobs_initial.unwrap_or(num_threads); let region_dir = [&args.input_dir, Path::new("region")].iter().collect(); let level_dat_path = [&args.input_dir, Path::new("level.dat")].iter().collect(); - let level_dat_old_path = [&args.input_dir, Path::new("level.dat_old")] - .iter() - .collect(); let processed_dir: PathBuf = [&args.output_dir, Path::new("processed")].iter().collect(); let entities_dir: PathBuf = [&processed_dir, Path::new("entities")].iter().collect(); let entities_path_final = [&entities_dir, Path::new("entities.bin")].iter().collect(); @@ -193,17 +181,14 @@ impl Config { Ok(Config { num_threads, - num_threads_initial, region_dir, level_dat_path, - level_dat_old_path, output_dir: args.output_dir.clone(), processed_dir, entities_dir, entities_path_final, viewer_info_path, viewer_entities_path, - image_format: args.image_format, sign_patterns, sign_transforms, }) @@ -237,7 +222,7 @@ impl Config { fn sign_transform(splitter: &Regex, transform: &str) -> Result<(Regex, String)> { let captures = splitter .captures(transform) - .with_context(|| format!("Invalid transform pattern '{transform}'"))?; + .with_context(|| format!("Invalid transform pattern '{}'", transform))?; let regexp = Regex::new(&captures[1])?; let replacement = captures[2].to_string(); Ok((regexp, replacement)) @@ -275,43 +260,18 @@ impl Config { TileKind::Map => "map", TileKind::Lightmap => "light", }; - let dir = format!("{prefix}/{level}"); + let dir = format!("{}/{}", prefix, level); [&self.output_dir, Path::new(&dir)].iter().collect() } - /// Returns the file extension for the configured image format - pub fn tile_extension(&self) -> &'static str { - match self.image_format { - ImageFormat::Png => "png", - ImageFormat::Webp => "webp", - } - } - /// Returns the configurured image format for the image library - pub fn tile_image_format(&self) -> image::ImageFormat { - match self.image_format { - ImageFormat::Png => image::ImageFormat::Png, - ImageFormat::Webp => image::ImageFormat::WebP, - } - } - /// Constructs the path of an output tile image pub fn tile_path(&self, kind: TileKind, level: usize, coords: TileCoords) -> PathBuf { - let filename = coord_filename(coords, self.tile_extension()); + let filename = coord_filename(coords, "png"); let dir = self.tile_dir(kind, level); [Path::new(&dir), Path::new(&filename)].iter().collect() } } -/// Format of generated map tiles -#[derive(Debug, Clone, Copy, Default, ValueEnum)] -pub enum ImageFormat { - /// Generate PNG images - #[default] - Png, - /// Generate WebP images - Webp, -} - /// Copies a chunk image into a region tile pub fn overlay_chunk(image: &mut I, chunk: &J, coords: ChunkCoords) where diff --git a/src/core/entity_collector.rs b/src/core/entity_collector.rs index 0d18090..3d9b6ab 100644 --- a/src/core/entity_collector.rs +++ b/src/core/entity_collector.rs @@ -16,7 +16,7 @@ pub struct EntityCollector<'a> { regions: &'a [TileCoords], } -impl TileMerger for EntityCollector<'_> { +impl<'a> TileMerger for EntityCollector<'a> { fn file_meta_version(&self) -> fs::FileMetaVersion { ENTITIES_FILE_META_VERSION } @@ -34,7 +34,7 @@ impl TileMerger for EntityCollector<'_> { } } -impl TileCollector for EntityCollector<'_> { +impl<'a> TileCollector for EntityCollector<'a> { type CollectOutput = (); fn tiles(&self) -> &[TileCoords] { @@ -78,22 +78,23 @@ impl<'a> EntityCollector<'a> { let mut output = ProcessedEntities::default(); for source_path in sources { - let mut source: ProcessedEntities = match storage::read_file(source_path.as_ref()) { - Ok(source) => source, - Err(err) => { - warn!( - "Failed to read entity data file {}: {:?}", - source_path.as_ref().display(), - err, - ); - continue; - } - }; + let mut source: ProcessedEntities = + match storage::read_file(source_path.as_ref(), storage::Format::Json) { + Ok(source) => source, + Err(err) => { + warn!( + "Failed to read entity data file {}: {:?}", + source_path.as_ref().display(), + err, + ); + continue; + } + }; output.block_entities.append(&mut source.block_entities); } - storage::write(file, &output).context("Failed to write entity data") + storage::write(file, &output, storage::Format::Json).context("Failed to write entity data") } /// Runs the mipmap generation diff --git a/src/core/metadata_writer.rs b/src/core/metadata_writer.rs index 40c5796..0ea1f65 100644 --- a/src/core/metadata_writer.rs +++ b/src/core/metadata_writer.rs @@ -61,8 +61,6 @@ struct Metadata<'t> { spawn: Spawn, /// Enabled MinedMap features features: Features, - /// Format of generated map tiles - tile_extension: &'static str, } /// Viewer entity JSON data structure @@ -124,14 +122,7 @@ impl<'a> MetadataWriter<'a> { /// Reads and deserializes the `level.dat` of the Minecraft save data fn read_level_dat(&self) -> Result { - let res = crate::nbt::data::from_file(&self.config.level_dat_path); - if res.is_err() { - if let Ok(level_dat_old) = crate::nbt::data::from_file(&self.config.level_dat_old_path) - { - return Ok(level_dat_old); - } - } - res.context("Failed to read level.dat") + crate::nbt::data::from_file(&self.config.level_dat_path).context("Failed to read level.dat") } /// Generates [Spawn] data from a [de::LevelDat] @@ -179,8 +170,9 @@ impl<'a> MetadataWriter<'a> { /// Generates [Entities] data from collected entity lists fn entities(&self) -> Result { - let data: ProcessedEntities = storage::read_file(&self.config.entities_path_final) - .context("Failed to read entity data file")?; + let data: ProcessedEntities = + storage::read_file(&self.config.entities_path_final, storage::Format::Json) + .context("Failed to read entity data file")?; let ret = Entities { signs: data @@ -213,7 +205,6 @@ impl<'a> MetadataWriter<'a> { mipmaps: Vec::new(), spawn: Self::spawn(&level_dat), features, - tile_extension: self.config.tile_extension(), }; for tile_map in self.tiles.iter() { diff --git a/src/core/mod.rs b/src/core/mod.rs index fce2cb5..f552ffa 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -10,46 +10,31 @@ mod tile_merger; mod tile_mipmapper; mod tile_renderer; -use std::{ - path::PathBuf, - sync::mpsc::{self, Receiver}, - thread, - time::Duration, -}; +use std::path::PathBuf; use anyhow::{Context, Result}; use clap::Parser; use git_version::git_version; -use common::{Config, ImageFormat}; +use common::Config; use metadata_writer::MetadataWriter; -use notify::{RecommendedWatcher, RecursiveMode, Watcher as _}; -use rayon::ThreadPool; use region_processor::RegionProcessor; use tile_mipmapper::TileMipmapper; use tile_renderer::TileRenderer; -use tokio::runtime::Runtime; -use tracing::{info, warn}; use self::entity_collector::EntityCollector; -/// Returns the MinedMap version number -fn version() -> &'static str { - option_env!("MINEDMAP_VERSION").unwrap_or( - git_version!( - args = ["--abbrev=7", "--match=v*", "--dirty=-modified"], - cargo_prefix = "v", - ) - .strip_prefix("v") - .unwrap(), - ) -} +/// MinedMap version number +const VERSION: &str = git_version!( + args = ["--abbrev=7", "--match=v*", "--dirty=-modified"], + cargo_prefix = "v", +); /// Command line arguments for minedmap CLI #[derive(Debug, Parser)] #[command( about, - version = version(), + version = VERSION.strip_prefix("v").unwrap(), max_term_width = 100, )] pub struct Args { @@ -59,29 +44,9 @@ pub struct Args { /// use one thread per logical CPU core. #[arg(short, long)] pub jobs: Option, - /// Number of parallel threads to use for initial processing - /// - /// Passing this option only makes sense with --watch. The first run after - /// starting MinedMap will use as many parallel jobs as configured using - /// --job-initial, while subsequent regenerations of tiles will use the - /// the number configured using --jobs. - /// - /// If not given, the value from the --jobs option is used. - #[arg(long)] - pub jobs_initial: Option, /// Enable verbose messages #[arg(short, long)] pub verbose: bool, - /// Watch for file changes and regenerate tiles automatically instead of - /// exiting after generation - #[arg(long)] - pub watch: bool, - /// Minimum delay between map generation cycles in watch mode - #[arg(long, value_parser = humantime::parse_duration, default_value = "30s")] - pub watch_delay: Duration, - /// Format of generated map tiles - #[arg(long, value_enum, default_value_t)] - pub image_format: ImageFormat, /// Prefix for text of signs to show on the map #[arg(long)] pub sign_prefix: Vec, @@ -106,73 +71,14 @@ pub struct Args { pub output_dir: PathBuf, } -/// Configures a Rayon thread pool for parallel processing -fn setup_threads(num_threads: usize) -> Result { +/// Configures the Rayon thread pool for parallel processing +fn setup_threads(num_threads: usize) -> Result<()> { rayon::ThreadPoolBuilder::new() .num_threads(num_threads) - .build() + .build_global() .context("Failed to configure thread pool") } -/// Runs all MinedMap generation steps, updating all tiles as needed -fn generate(config: &Config, rt: &Runtime) -> Result<()> { - let regions = RegionProcessor::new(config).run()?; - TileRenderer::new(config, rt, ®ions).run()?; - let tiles = TileMipmapper::new(config, ®ions).run()?; - EntityCollector::new(config, ®ions).run()?; - MetadataWriter::new(config, &tiles).run() -} - -/// Creates a file watcher for the -fn create_watcher(args: &Args) -> Result<(RecommendedWatcher, Receiver<()>)> { - let (tx, rx) = mpsc::sync_channel::<()>(1); - let mut watcher = notify::recommended_watcher(move |res| { - // Ignore errors - we already have a watch trigger queued if try_send() fails - let event: notify::Event = match res { - Ok(event) => event, - Err(err) => { - warn!("Watch error: {err}"); - return; - } - }; - let notify::EventKind::Modify(modify_kind) = event.kind else { - return; - }; - if !matches!( - modify_kind, - notify::event::ModifyKind::Data(_) - | notify::event::ModifyKind::Name(notify::event::RenameMode::To) - ) { - return; - } - if !event - .paths - .iter() - .any(|path| path.ends_with("level.dat") || path.extension() == Some("mcu".as_ref())) - { - return; - } - let _ = tx.try_send(()); - })?; - watcher.watch(&args.input_dir, RecursiveMode::Recursive)?; - Ok((watcher, rx)) -} - -/// Watches the data directory for changes, returning when a change has happened -fn wait_watcher(args: &Args, watch_channel: &Receiver<()>) -> Result<()> { - info!("Watching for changes..."); - let () = watch_channel - .recv() - .context("Failed to read watch event channel")?; - info!("Change detected."); - - thread::sleep(args.watch_delay); - - let _ = watch_channel.try_recv(); - - Ok(()) -} - /// MinedMap CLI main function pub fn cli() -> Result<()> { let args = Args::parse(); @@ -187,28 +93,17 @@ pub fn cli() -> Result<()> { .with_target(false) .init(); - let mut pool = setup_threads(config.num_threads_initial)?; + setup_threads(config.num_threads)?; let rt = tokio::runtime::Builder::new_current_thread() .build() .unwrap(); - let watch = args.watch.then(|| create_watcher(&args)).transpose()?; + let regions = RegionProcessor::new(&config).run()?; + TileRenderer::new(&config, &rt, ®ions).run()?; + let tiles = TileMipmapper::new(&config, ®ions).run()?; + EntityCollector::new(&config, ®ions).run()?; + MetadataWriter::new(&config, &tiles).run()?; - pool.install(|| generate(&config, &rt))?; - - let Some((_watcher, watch_channel)) = watch else { - // watch mode disabled - return Ok(()); - }; - - if config.num_threads != config.num_threads_initial { - pool = setup_threads(config.num_threads)?; - } - pool.install(move || { - loop { - wait_watcher(&args, &watch_channel)?; - generate(&config, &rt)?; - } - }) + Ok(()) } diff --git a/src/core/region_processor.rs b/src/core/region_processor.rs index 74939bd..63d5c09 100644 --- a/src/core/region_processor.rs +++ b/src/core/region_processor.rs @@ -1,11 +1,16 @@ //! The [RegionProcessor] and related functions -use std::{ffi::OsStr, path::PathBuf, sync::mpsc, time::SystemTime}; +use std::{ + ffi::OsStr, + path::PathBuf, + sync::{ + atomic::{AtomicBool, Ordering}, + mpsc, + }, + time::SystemTime, +}; use anyhow::{Context, Result}; -use enum_map::{Enum, EnumMap}; -use indexmap::IndexSet; -use minedmap_resource::Biome; use rayon::prelude::*; use tracing::{debug, info, warn}; @@ -31,7 +36,7 @@ fn parse_region_filename(file_name: &OsStr) -> Option { } /// [RegionProcessor::process_region] return values -#[derive(Debug, Clone, Copy, PartialEq, Eq, Enum)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] enum RegionProcessorStatus { /// Region was processed Ok, @@ -45,37 +50,6 @@ enum RegionProcessorStatus { ErrorMissing, } -/// Data of a region being processed by a [SingleRegionProcessor] -#[derive(Debug)] -struct SingleRegionData { - /// [IndexSet] of biomes used by the processed region - biome_list: IndexSet, - /// Processed region chunk intermediate data - chunks: ChunkArray>>, - /// Lightmap intermediate data - lightmap: image::GrayAlphaImage, - /// Processed entity intermediate data - entities: ProcessedEntities, - /// True if any unknown block or biome types were encountered during processing - has_unknown: bool, -} - -impl Default for SingleRegionData { - fn default() -> Self { - /// Width/height of the region data - const N: u32 = (BLOCKS_PER_CHUNK * CHUNKS_PER_REGION) as u32; - - let lightmap = image::GrayAlphaImage::new(N, N); - Self { - biome_list: Default::default(), - chunks: Default::default(), - lightmap, - entities: Default::default(), - has_unknown: false, - } - } -} - /// Handles processing for a single region struct SingleRegionProcessor<'a> { /// Registry of known block types @@ -106,13 +80,22 @@ struct SingleRegionProcessor<'a> { lightmap_needed: bool, /// True if entity output file needs to be updated entities_needed: bool, - /// Format of generated map tiles - image_format: image::ImageFormat, + /// Processed region intermediate data + processed_region: ProcessedRegion, + /// Lightmap intermediate data + lightmap: image::GrayAlphaImage, + /// Processed entity intermediate data + entities: ProcessedEntities, + /// True if any unknown block or biome types were encountered during processing + has_unknown: bool, } impl<'a> SingleRegionProcessor<'a> { /// Initializes a [SingleRegionProcessor] fn new(processor: &'a RegionProcessor<'a>, coords: TileCoords) -> Result { + /// Width/height of the region data + const N: u32 = (BLOCKS_PER_CHUNK * CHUNKS_PER_REGION) as u32; + let input_path = processor.config.region_path(coords); let input_timestamp = fs::modified_timestamp(&input_path)?; @@ -129,6 +112,10 @@ impl<'a> SingleRegionProcessor<'a> { let lightmap_needed = Some(input_timestamp) > lightmap_timestamp; let entities_needed = Some(input_timestamp) > entities_timestamp; + let processed_region = ProcessedRegion::default(); + let lightmap = image::GrayAlphaImage::new(N, N); + let entities = ProcessedEntities::default(); + Ok(SingleRegionProcessor { block_types: &processor.block_types, biome_types: &processor.biome_types, @@ -144,7 +131,10 @@ impl<'a> SingleRegionProcessor<'a> { output_needed, lightmap_needed, entities_needed, - image_format: processor.config.tile_image_format(), + processed_region, + lightmap, + entities, + has_unknown: false, }) } @@ -168,14 +158,15 @@ impl<'a> SingleRegionProcessor<'a> { /// Saves processed region data /// /// The timestamp is the time of the last modification of the input region data. - fn save_region(&self, processed_region: &ProcessedRegion) -> Result<()> { + fn save_region(&self) -> Result<()> { if !self.output_needed { return Ok(()); } storage::write_file( &self.output_path, - processed_region, + &self.processed_region, + storage::Format::Bincode, REGION_FILE_META_VERSION, self.input_timestamp, ) @@ -184,7 +175,7 @@ impl<'a> SingleRegionProcessor<'a> { /// Saves a lightmap tile /// /// The timestamp is the time of the last modification of the input region data. - fn save_lightmap(&self, lightmap: &image::GrayAlphaImage) -> Result<()> { + fn save_lightmap(&self) -> Result<()> { if !self.lightmap_needed { return Ok(()); } @@ -194,8 +185,8 @@ impl<'a> SingleRegionProcessor<'a> { LIGHTMAP_FILE_META_VERSION, self.input_timestamp, |file| { - lightmap - .write_to(file, self.image_format) + self.lightmap + .write_to(file, image::ImageFormat::Png) .context("Failed to save image") }, ) @@ -204,32 +195,28 @@ impl<'a> SingleRegionProcessor<'a> { /// Saves processed entity data /// /// The timestamp is the time of the last modification of the input region data. - fn save_entities(&self, entities: &mut ProcessedEntities) -> Result<()> { + fn save_entities(&mut self) -> Result<()> { if !self.entities_needed { return Ok(()); } - entities.block_entities.sort_unstable(); + self.entities.block_entities.sort_unstable(); storage::write_file( &self.entities_path, - entities, + &self.entities, + storage::Format::Json, ENTITIES_FILE_META_VERSION, self.input_timestamp, ) } /// Processes a single chunk - fn process_chunk( - &self, - data: &mut SingleRegionData, - chunk_coords: ChunkCoords, - chunk_data: world::de::Chunk, - ) -> Result<()> { + fn process_chunk(&mut self, chunk_coords: ChunkCoords, data: world::de::Chunk) -> Result<()> { let (chunk, has_unknown) = - world::chunk::Chunk::new(&chunk_data, self.block_types, self.biome_types) - .with_context(|| format!("Failed to decode chunk {chunk_coords:?}"))?; - data.has_unknown |= has_unknown; + world::chunk::Chunk::new(&data, self.block_types, self.biome_types) + .with_context(|| format!("Failed to decode chunk {:?}", chunk_coords))?; + self.has_unknown |= has_unknown; if self.output_needed || self.lightmap_needed { if let Some(layer::LayerData { @@ -237,11 +224,11 @@ impl<'a> SingleRegionProcessor<'a> { biomes, block_light, depths, - }) = world::layer::top_layer(&mut data.biome_list, &chunk) - .with_context(|| format!("Failed to process chunk {chunk_coords:?}"))? + }) = world::layer::top_layer(&mut self.processed_region.biome_list, &chunk) + .with_context(|| format!("Failed to process chunk {:?}", chunk_coords))? { if self.output_needed { - data.chunks[chunk_coords] = Some(Box::new(ProcessedChunk { + self.processed_region.chunks[chunk_coords] = Some(Box::new(ProcessedChunk { blocks, biomes, depths, @@ -250,30 +237,32 @@ impl<'a> SingleRegionProcessor<'a> { if self.lightmap_needed { let chunk_lightmap = Self::render_chunk_lightmap(block_light); - overlay_chunk(&mut data.lightmap, &chunk_lightmap, chunk_coords); + overlay_chunk(&mut self.lightmap, &chunk_lightmap, chunk_coords); } } } if self.entities_needed { let mut block_entities = chunk.block_entities().with_context(|| { - format!("Failed to process block entities for chunk {chunk_coords:?}") + format!( + "Failed to process block entities for chunk {:?}", + chunk_coords, + ) })?; - data.entities.block_entities.append(&mut block_entities); + self.entities.block_entities.append(&mut block_entities); } Ok(()) } /// Processes the chunks of the region - fn process_chunks(&self, data: &mut SingleRegionData) -> Result<()> { - crate::nbt::region::from_file(&self.input_path)?.foreach_chunk( - |chunk_coords, chunk_data| self.process_chunk(data, chunk_coords, chunk_data), - ) + fn process_chunks(&mut self) -> Result<()> { + crate::nbt::region::from_file(&self.input_path)? + .foreach_chunk(|chunk_coords, data| self.process_chunk(chunk_coords, data)) } /// Processes the region - fn run(&self) -> Result { + fn run(mut self) -> Result { if !self.output_needed && !self.lightmap_needed && !self.entities_needed { debug!( "Skipping unchanged region r.{}.{}.mca", @@ -287,9 +276,7 @@ impl<'a> SingleRegionProcessor<'a> { self.coords.x, self.coords.z ); - let mut data = SingleRegionData::default(); - - if let Err(err) = self.process_chunks(&mut data) { + if let Err(err) = self.process_chunks() { if self.output_timestamp.is_some() && self.lightmap_timestamp.is_some() && self.entities_timestamp.is_some() @@ -308,16 +295,11 @@ impl<'a> SingleRegionProcessor<'a> { } } - let processed_region = ProcessedRegion { - biome_list: data.biome_list.into_iter().collect(), - chunks: data.chunks, - }; + self.save_region()?; + self.save_lightmap()?; + self.save_entities()?; - self.save_region(&processed_region)?; - self.save_lightmap(&data.lightmap)?; - self.save_entities(&mut data.entities)?; - - Ok(if data.has_unknown { + Ok(if self.has_unknown { RegionProcessorStatus::OkWithUnknown } else { RegionProcessorStatus::Ok @@ -362,20 +344,11 @@ impl<'a> RegionProcessor<'a> { })? .filter_map(|entry| entry.ok()) .filter(|entry| { - (|| { - // We are only interested in regular files - let file_type = entry.file_type().ok()?; - if !file_type.is_file() { - return None; - } - - let metadata = entry.metadata().ok()?; - if metadata.len() == 0 { - return None; - } - Some(()) - })() - .is_some() + // We are only interested in regular files + matches!( + entry.file_type().map(|file_type| file_type.is_file()), + Ok(true) + ) }) .filter_map(|entry| parse_region_filename(&entry.file_name())) .collect()) @@ -390,8 +363,6 @@ impl<'a> RegionProcessor<'a> { /// /// Returns a list of the coordinates of all processed regions pub fn run(self) -> Result> { - use RegionProcessorStatus as Status; - fs::create_dir_all(&self.config.processed_dir)?; fs::create_dir_all(&self.config.tile_dir(TileKind::Lightmap, 0))?; fs::create_dir_all(&self.config.entities_dir(0))?; @@ -399,18 +370,31 @@ impl<'a> RegionProcessor<'a> { info!("Processing region files..."); let (region_send, region_recv) = mpsc::channel(); - let (status_send, status_recv) = mpsc::channel(); + let (processed_send, processed_recv) = mpsc::channel(); + let (error_send, error_recv) = mpsc::channel(); + + let has_unknown = AtomicBool::new(false); self.collect_regions()?.par_iter().try_for_each(|&coords| { let ret = self .process_region(coords) - .with_context(|| format!("Failed to process region {coords:?}"))?; + .with_context(|| format!("Failed to process region {:?}", coords))?; - if ret != Status::ErrorMissing { + if ret != RegionProcessorStatus::ErrorMissing { region_send.send(coords).unwrap(); } - status_send.send(ret).unwrap(); + match ret { + RegionProcessorStatus::Ok => processed_send.send(()).unwrap(), + RegionProcessorStatus::OkWithUnknown => { + has_unknown.store(true, Ordering::Relaxed); + processed_send.send(()).unwrap(); + } + RegionProcessorStatus::Skipped => {} + RegionProcessorStatus::ErrorOk | RegionProcessorStatus::ErrorMissing => { + error_send.send(()).unwrap() + } + } anyhow::Ok(()) })?; @@ -418,21 +402,19 @@ impl<'a> RegionProcessor<'a> { drop(region_send); let mut regions: Vec<_> = region_recv.into_iter().collect(); - drop(status_send); - - let mut status = EnumMap::<_, usize>::default(); - for ret in status_recv { - status[ret] += 1; - } + drop(processed_send); + let processed = processed_recv.into_iter().count(); + drop(error_send); + let errors = error_recv.into_iter().count(); info!( "Processed region files ({} processed, {} unchanged, {} errors)", - status[Status::Ok] + status[Status::OkWithUnknown], - status[Status::Skipped], - status[Status::ErrorOk] + status[Status::ErrorMissing], + processed, + regions.len() - processed - errors, + errors, ); - if status[Status::OkWithUnknown] > 0 { + if has_unknown.into_inner() { warn!("Unknown block or biome types found during processing"); eprint!(concat!( "\n", diff --git a/src/core/tile_mipmapper.rs b/src/core/tile_mipmapper.rs index 2eda0e9..cd90e20 100644 --- a/src/core/tile_mipmapper.rs +++ b/src/core/tile_mipmapper.rs @@ -74,7 +74,7 @@ impl<'a, P> MapMerger<'a, P> { } } -impl TileMerger for MapMerger<'_, P> +impl<'a, P: image::PixelWithColorType> TileMerger for MapMerger<'a, P> where [P::Subpixel]: image::EncodableLayout, image::ImageBuffer>: Into, @@ -144,7 +144,7 @@ where } image - .write_to(file, self.config.tile_image_format()) + .write_to(file, image::ImageFormat::Png) .context("Failed to save image") } } @@ -157,7 +157,7 @@ pub struct TileMipmapper<'a> { regions: &'a [TileCoords], } -impl TileCollector for TileMipmapper<'_> { +impl<'a> TileCollector for TileMipmapper<'a> { type CollectOutput = MipmapStat; fn tiles(&self) -> &[TileCoords] { diff --git a/src/core/tile_renderer.rs b/src/core/tile_renderer.rs index 0b534b8..09ad8a1 100644 --- a/src/core/tile_renderer.rs +++ b/src/core/tile_renderer.rs @@ -16,7 +16,7 @@ use tracing::{debug, info}; use super::{common::*, region_group::RegionGroup}; use crate::{ io::{fs, storage}, - resource::{Colorf, block_color, needs_biome}, + resource::{block_color, needs_biome, Colorf}, types::*, util::coord_offset, }; @@ -105,7 +105,8 @@ impl<'a> TileRenderer<'a> { region_loader .get_or_try_init(|| async { - storage::read_file(&processed_path).context("Failed to load processed region data") + storage::read_file(&processed_path, storage::Format::Bincode) + .context("Failed to load processed region data") }) .await .cloned() @@ -133,7 +134,7 @@ impl<'a> TileRenderer<'a> { /// Hashing the value as a single u32 is more efficient than hashing /// the tuple elements separately. fn biome_key((dx, dz, index): (i8, i8, u16)) -> u32 { - (dx as u8 as u32) | ((dz as u8 as u32) << 8) | ((index as u32) << 16) + (dx as u8 as u32) | (dz as u8 as u32) << 8 | (index as u32) << 16 } /// One quadrant of the kernel used to smooth biome edges @@ -186,7 +187,7 @@ impl<'a> TileRenderer<'a> { for ((region_x, region_z, index), w) in weights.into_values() { let region = region_group.get(region_x, region_z)?; - let biome = region.biome_list.get(usize::from(index))?; + let biome = region.biome_list.get_index(index.into())?; total += w; color += w * block_color(block, Some(biome), depth.0 as f32); @@ -249,7 +250,7 @@ impl<'a> TileRenderer<'a> { .filter(|entry| self.region_set.contains(entry)) }) .try_map(|entry| self.processed_source(entry)) - .with_context(|| format!("Region {coords:?} from previous step must exist"))?; + .with_context(|| format!("Region {:?} from previous step must exist", coords))?; let max_timestamp = *sources .iter() @@ -293,7 +294,7 @@ impl<'a> TileRenderer<'a> { let region_group = self .rt .block_on(self.load_region_group(processed_paths)) - .with_context(|| format!("Region {coords:?} from previous step must be loadable"))?; + .with_context(|| format!("Region {:?} from previous step must be loadable", coords))?; let mut image = image::RgbaImage::new(N, N); Self::render_region(&mut image, ®ion_group); @@ -303,7 +304,7 @@ impl<'a> TileRenderer<'a> { processed_timestamp, |file| { image - .write_to(file, self.config.tile_image_format()) + .write_to(file, image::ImageFormat::Png) .context("Failed to save image") }, )?; @@ -325,7 +326,7 @@ impl<'a> TileRenderer<'a> { .map(|&coords| { anyhow::Ok(usize::from( self.render_tile(coords) - .with_context(|| format!("Failed to render tile {coords:?}"))?, + .with_context(|| format!("Failed to render tile {:?}", coords))?, )) }) .try_reduce(|| 0, |a, b| Ok(a + b))?; diff --git a/src/io/storage.rs b/src/io/storage.rs index ae311de..9296166 100644 --- a/src/io/storage.rs +++ b/src/io/storage.rs @@ -10,16 +10,28 @@ use std::{ }; use anyhow::{Context, Result}; -use bincode::{Decode, Encode}; +use serde::{de::DeserializeOwned, Serialize}; use super::fs; -/// Bincode configuration -const BINCODE_CONFIG: bincode::config::Configuration = bincode::config::standard(); +/// Storage format +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub enum Format { + /// Encode as Bincode + /// + /// Bincode is more efficient than JSON, but cannot handle many of + /// serde's features like flatten, conditional skipping, ... + Bincode, + /// Encode as JSON + Json, +} /// Serializes data and writes it to a writer -pub fn write(writer: &mut W, value: &T) -> Result<()> { - let data = bincode::encode_to_vec(value, BINCODE_CONFIG)?; +pub fn write(writer: &mut W, value: &T, format: Format) -> Result<()> { + let data = match format { + Format::Bincode => bincode::serialize(value)?, + Format::Json => serde_json::to_vec(value)?, + }; let len = u32::try_from(data.len())?; let compressed = zstd::bulk::compress(&data, 1)?; drop(data); @@ -33,21 +45,18 @@ pub fn write(writer: &mut W, value: &T) -> Result<()> { /// Serializes data and stores it in a file /// /// A timestamp is stored in an assiciated metadata file. -pub fn write_file( +pub fn write_file( path: &Path, value: &T, + format: Format, version: fs::FileMetaVersion, timestamp: SystemTime, ) -> Result<()> { - fs::create_with_timestamp(path, version, timestamp, |file| write(file, value)) + fs::create_with_timestamp(path, version, timestamp, |file| write(file, value, format)) } /// Reads data from a reader and deserializes it -pub fn read(reader: &mut R) -> Result -where - R: Read, - T: Decode<()>, -{ +pub fn read(reader: &mut R, format: Format) -> Result { let mut len_buf = [0u8; 4]; reader.read_exact(&mut len_buf)?; let len = usize::try_from(u32::from_be_bytes(len_buf))?; @@ -57,17 +66,18 @@ where let data = zstd::bulk::decompress(&compressed, len)?; drop(compressed); - Ok(bincode::decode_from_slice(&data, BINCODE_CONFIG)?.0) + let value = match format { + Format::Bincode => bincode::deserialize(&data)?, + Format::Json => serde_json::from_slice(&data)?, + }; + Ok(value) } /// Reads data from a file and deserializes it -pub fn read_file(path: &Path) -> Result -where - T: Decode<()>, -{ +pub fn read_file(path: &Path, format: Format) -> Result { (|| -> Result { let mut file = File::open(path)?; - read(&mut file) + read(&mut file, format) })() .with_context(|| format!("Failed to read file {}", path.display())) } diff --git a/src/main.rs b/src/main.rs index 1f19a41..31f2889 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,9 +2,6 @@ #![warn(missing_docs)] #![warn(clippy::missing_docs_in_private_items)] -#[cfg(feature = "jemalloc-auto")] -extern crate minedmap_default_alloc; - mod core; mod io; mod util; diff --git a/src/util.rs b/src/util.rs index ed07ba5..a128ef9 100644 --- a/src/util.rs +++ b/src/util.rs @@ -39,9 +39,7 @@ pub fn to_flat_coord( chunk: ChunkCoord, block: BlockCoord, ) -> i32 { - ((region as i32) << (BLOCK_BITS + CHUNK_BITS)) - | ((chunk.0 as i32) << BLOCK_BITS) - | (block.0 as i32) + (region as i32) << (BLOCK_BITS + CHUNK_BITS) | ((chunk.0 as i32) << BLOCK_BITS | block.0 as i32) } /// Splits a flat (linear) coordinate into region, chunk and block numbers diff --git a/src/world/block_entity.rs b/src/world/block_entity.rs index 589a53c..182ad50 100644 --- a/src/world/block_entity.rs +++ b/src/world/block_entity.rs @@ -1,8 +1,7 @@ //! Processing of block entity data -use bincode::{Decode, Encode}; use minedmap_resource::{BlockFlag, BlockType}; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use super::{ de, @@ -10,7 +9,7 @@ use super::{ }; /// Kind of sign block -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, Serialize)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] #[serde(rename_all = "snake_case")] pub enum SignKind { /// Standing sign @@ -24,7 +23,7 @@ pub enum SignKind { } /// Processed sign data -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, Serialize)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct Sign { /// The kind of the sign pub kind: SignKind, @@ -41,15 +40,10 @@ pub struct Sign { impl Sign { /// Processes a [de::BlockEntitySign] into a [Sign] - fn new( - sign: &de::BlockEntitySign, - kind: SignKind, - material: Option, - data_version: u32, - ) -> Sign { + fn new(sign: &de::BlockEntitySign, kind: SignKind, material: Option) -> Sign { let (front_text, back_text) = sign.text(); - let front_text = front_text.decode(data_version); - let back_text = back_text.decode(data_version); + let front_text = front_text.decode(); + let back_text = back_text.decode(); Sign { kind, material, @@ -60,7 +54,7 @@ impl Sign { } /// Data for different kinds of [BlockEntity] -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, Serialize)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] #[serde(tag = "type", rename_all = "snake_case")] pub enum BlockEntityData { /// A sign block @@ -68,7 +62,7 @@ pub enum BlockEntityData { } /// A processed block entity -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, Serialize)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct BlockEntity { /// Global X coordinate pub x: i32, @@ -83,11 +77,7 @@ pub struct BlockEntity { impl BlockEntity { /// Processes a [de::BlockEntity] into a [BlockEntity] - pub fn new( - entity: &de::BlockEntity, - block_type: Option<&BlockType>, - data_version: u32, - ) -> Option { + pub fn new(entity: &de::BlockEntity, block_type: Option<&BlockType>) -> Option { let wall_sign = block_type .map(|block_type| block_type.block_color.is(BlockFlag::WallSign)) .unwrap_or_default(); @@ -101,7 +91,7 @@ impl BlockEntity { let material = block_type .as_ref() .and_then(|block_type| block_type.sign_material.as_ref()); - let data = BlockEntityData::Sign(Sign::new(sign, kind, material.cloned(), data_version)); + let data = BlockEntityData::Sign(Sign::new(sign, kind, material.cloned())); Some(BlockEntity { x: entity.x, diff --git a/src/world/chunk.rs b/src/world/chunk.rs index aadf882..bf1d78b 100644 --- a/src/world/chunk.rs +++ b/src/world/chunk.rs @@ -4,11 +4,11 @@ //! over different data versions as much as possible. use std::{ - collections::{BTreeMap, btree_map}, + collections::{btree_map, BTreeMap}, iter::{self, FusedIterator}, }; -use anyhow::{Context, Result, bail}; +use anyhow::{bail, Context, Result}; use super::{block_entity::BlockEntity, de, section::*}; use crate::{ @@ -58,8 +58,6 @@ pub struct Chunk<'a> { inner: ChunkInner<'a>, /// Unprocessed block entities block_entities: &'a Vec, - /// Chunk data version - data_version: u32, } impl<'a> Chunk<'a> { @@ -89,7 +87,6 @@ impl<'a> Chunk<'a> { Chunk { inner, block_entities, - data_version, }, has_unknown, )) @@ -295,11 +292,7 @@ impl<'a> Chunk<'a> { .iter() .map(|block_entity| { let block_type = self.block_type_at_block_entity(block_entity)?; - Ok(BlockEntity::new( - block_entity, - block_type, - self.data_version, - )) + Ok(BlockEntity::new(block_entity, block_type)) }) .collect::>()?; Ok(entities.into_iter().flatten().collect()) @@ -419,17 +412,17 @@ impl<'a> Iterator for SectionIter<'a> { } fn last(mut self) -> Option { - self.next_back() + self.with_iter(|iter| iter.last()) } } -impl DoubleEndedIterator for SectionIter<'_> { +impl<'a> DoubleEndedIterator for SectionIter<'a> { fn next_back(&mut self) -> Option { self.with_iter(|iter| iter.next_back()) } } -impl ExactSizeIterator for SectionIter<'_> { +impl<'a> ExactSizeIterator for SectionIter<'a> { fn len(&self) -> usize { match &self.inner { SectionIterInner::V1_18 { iter } => iter.len(), @@ -440,4 +433,4 @@ impl ExactSizeIterator for SectionIter<'_> { } } -impl FusedIterator for SectionIter<'_> {} +impl<'a> FusedIterator for SectionIter<'a> {} diff --git a/src/world/de.rs b/src/world/de.rs index 0a4b4b6..7ab8ba7 100644 --- a/src/world/de.rs +++ b/src/world/de.rs @@ -2,7 +2,7 @@ use serde::Deserialize; -use super::text_value::TextValue; +use super::json_text::JSONText; /// Element of the `palette` list of 1.18+ [block states](BlockStatesV1_18) #[derive(Debug, Deserialize)] @@ -110,7 +110,7 @@ pub enum BiomesV0 { #[derive(Debug, Deserialize)] pub struct BlockEntitySignV1_20Text { /// Lines of sign text - pub messages: Vec, + pub messages: Vec, /// Default text color pub color: Option, } @@ -125,13 +125,13 @@ pub enum BlockEntitySign { #[serde(rename_all = "PascalCase")] V0 { /// Line 1 of the sign text - text1: TextValue, + text1: JSONText, /// Line 2 of the sign text - text2: TextValue, + text2: JSONText, /// Line 3 of the sign text - text3: TextValue, + text3: JSONText, /// Line 4 of the sign text - text4: TextValue, + text4: JSONText, /// Default text color color: Option, }, diff --git a/src/world/text_value.rs b/src/world/json_text.rs similarity index 53% rename from src/world/text_value.rs rename to src/world/json_text.rs index 3de6593..a153179 100644 --- a/src/world/text_value.rs +++ b/src/world/json_text.rs @@ -1,28 +1,24 @@ -//! Newtype and helper methods for handling Minecraft text values +//! Newtype and helper methods for handling Minecraft Raw JSON Text -use std::{collections::VecDeque, fmt::Display}; +use std::{collections::VecDeque, fmt::Display, sync::Arc}; -use bincode::{Decode, Encode}; -use minedmap_resource::Color; use serde::{Deserialize, Serialize}; /// A span of formatted text /// -/// A [TextValue] consists of a tree of [FormattedText] nodes (canonically +/// A [JSONText] consists of a tree of [FormattedText] nodes (canonically /// represented as a [FormattedTextTree], but other kinds are possible with /// is handled by [DeserializedText]. /// /// Formatting that is not set in a node is inherited from the parent. -#[derive( - Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Encode, Decode, -)] +#[derive(Debug, Serialize, Deserialize, Default, PartialEq, Eq, PartialOrd, Ord)] pub struct FormattedText { #[serde(default)] /// Text content pub text: String, /// Text color - #[serde(skip_serializing_if = "Option::is_none", with = "text_color")] - pub color: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option>, /// Bold formatting #[serde(skip_serializing_if = "Option::is_none")] pub bold: Option, @@ -45,7 +41,7 @@ impl FormattedText { pub fn inherit(self, parent: &Self) -> Self { FormattedText { text: self.text, - color: self.color.or(parent.color), + color: self.color.or_else(|| parent.color.clone()), bold: self.bold.or(parent.bold), italic: self.italic.or(parent.italic), underlined: self.underlined.or(parent.underlined), @@ -87,7 +83,7 @@ impl From for FormattedTextTree { } /// List of [FormattedText] -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Encode, Decode)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct FormattedTextList(pub Vec); impl FormattedTextList { @@ -107,9 +103,9 @@ impl Display for FormattedTextList { } } -/// Raw deserialized [TextValue] +/// Raw deserialized [JSONText] /// -/// A [TextValue] can contain various different types serialized as JSON or NBT. +/// A [JSONText] can contain various different JSON types. #[derive(Debug, Deserialize)] #[serde(untagged)] pub enum DeserializedText { @@ -169,106 +165,13 @@ impl Default for DeserializedText { } } -/// Minecraft raw text value +/// Minecraft Raw JSON Text #[derive(Debug, Deserialize)] -pub struct TextValue(pub fastnbt::Value); +pub struct JSONText(pub String); -impl TextValue { - /// Deserializes a [TextValue] into a [DeserializedText] - pub fn deserialize(&self, data_version: u32) -> DeserializedText { - // TODO: Improve error handling - // - // Unfortunately, there are a number of weird ways an empty sign coould - // be encoded (for example a compound with an "" key), so for now we - // simply interpret undecodable data as empty. - if data_version < 4290 { - let fastnbt::Value::String(json) = &self.0 else { - return DeserializedText::default(); - }; - - serde_json::from_str(json).unwrap_or_default() - } else { - fastnbt::from_value(&self.0).unwrap_or_default() - } - } -} - -mod text_color { - //! Helpers for serializing and deserializing [FormattedText](super::FormattedText) colors - - use minedmap_resource::Color; - use serde::{ - Deserializer, Serializer, - de::{self, Visitor}, - ser::Error as _, - }; - - /// Named text colors - static COLORS: phf::Map<&'static str, Color> = phf::phf_map! { - "black" => Color([0x00, 0x00, 0x00]), - "dark_blue" => Color([0x00, 0x00, 0xAA]), - "dark_green" => Color([0x00, 0xAA, 0x00]), - "dark_aqua" => Color([0x00, 0xAA, 0xAA]), - "dark_red" => Color([0xAA, 0x00, 0x00]), - "dark_purple" => Color([0xAA, 0x00, 0xAA]), - "gold" => Color([0xFF, 0xAA, 0x00]), - "gray" => Color([0xAA, 0xAA, 0xAA]), - "dark_gray" => Color([0x55, 0x55, 0x55]), - "blue" => Color([0x55, 0x55, 0xFF]), - "green" => Color([0x55, 0xFF, 0x55]), - "aqua" => Color([0x55, 0xFF, 0xFF]), - "red" => Color([0xFF, 0x55, 0x55]), - "light_purple" => Color([0xFF, 0x55, 0xFF]), - "yellow" => Color([0xFF, 0xFF, 0x55]), - "white" => Color([0xFF, 0xFF, 0xFF]), - }; - - /// serde serialize function for [FormattedText::color](super::FormattedText::color) - pub fn serialize(color: &Option, serializer: S) -> Result - where - S: Serializer, - { - let &Some(color) = color else { - return Err(S::Error::custom("serialize called for None sign color")); - }; - - let text = format!("#{:02x}{:02x}{:02x}", color.0[0], color.0[1], color.0[2]); - serializer.serialize_str(&text) - } - - /// serde [Visitor] for use by [deserialize] - struct ColorVisitor; - - impl Visitor<'_> for ColorVisitor { - type Value = Option; - - fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { - formatter.write_str("a string representing a color") - } - - fn visit_str(self, color: &str) -> Result - where - E: de::Error, - { - if let Some(hex) = color.strip_prefix("#") { - if let Ok(value) = u32::from_str_radix(hex, 16) { - return Ok(Some(Color([ - (value >> 16) as u8, - (value >> 8) as u8, - value as u8, - ]))); - } - } - - Ok(COLORS.get(color).copied()) - } - } - - /// serde deserialize function for [FormattedText::color](super::FormattedText::color) - pub fn deserialize<'de, D>(deserializer: D) -> Result, D::Error> - where - D: Deserializer<'de>, - { - deserializer.deserialize_str(ColorVisitor) +impl JSONText { + /// Deserializes a [JSONText] into a [DeserializedText] + pub fn deserialize(&self) -> DeserializedText { + serde_json::from_str(&self.0).unwrap_or_default() } } diff --git a/src/world/layer.rs b/src/world/layer.rs index deb4b48..576dfa4 100644 --- a/src/world/layer.rs +++ b/src/world/layer.rs @@ -3,8 +3,8 @@ use std::num::NonZeroU16; use anyhow::{Context, Result}; -use bincode::{Decode, Encode}; use indexmap::IndexSet; +use serde::{Deserialize, Serialize}; use super::chunk::{Chunk, SectionIterItem}; use crate::{ @@ -13,7 +13,7 @@ use crate::{ }; /// Height (Y coordinate) of a block -#[derive(Debug, Clone, Copy, PartialEq, Eq, Encode, Decode)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub struct BlockHeight(pub i32); impl BlockHeight { @@ -58,7 +58,7 @@ struct LayerEntry<'a> { depth: &'a mut Option, } -impl LayerEntry<'_> { +impl<'a> LayerEntry<'a> { /// Returns true if the entry has not been filled yet (no opaque block has been encountered) /// /// The depth value is filled separately when a non-water block is encountered after the block type @@ -97,14 +97,14 @@ impl LayerEntry<'_> { if self.is_empty() { *self.block = Some(block_type.block_color); - - let biome = section.biomes.biome_at(section.y, coords)?; - let (biome_index, _) = biome_list.insert_full(*biome); - *self.biome = NonZeroU16::new( - (biome_index + 1) - .try_into() - .expect("biome index not in range"), - ); + if let Some(biome) = section.biomes.biome_at(section.y, coords)? { + let (biome_index, _) = biome_list.insert_full(*biome); + *self.biome = NonZeroU16::new( + (biome_index + 1) + .try_into() + .expect("biome index not in range"), + ); + } } if block_type.block_color.is(BlockFlag::Water) { diff --git a/src/world/mod.rs b/src/world/mod.rs index 8a2e9be..6426c92 100644 --- a/src/world/mod.rs +++ b/src/world/mod.rs @@ -3,7 +3,7 @@ pub mod block_entity; pub mod chunk; pub mod de; +pub mod json_text; pub mod layer; pub mod section; pub mod sign; -pub mod text_value; diff --git a/src/world/section.rs b/src/world/section.rs index dc5c9a6..62b510b 100644 --- a/src/world/section.rs +++ b/src/world/section.rs @@ -5,7 +5,7 @@ use std::fmt::Debug; -use anyhow::{Context, Result, bail}; +use anyhow::{bail, Context, Result}; use num_integer::div_rem; use tracing::debug; @@ -81,7 +81,7 @@ impl<'a> SectionV1_13<'a> { if let Some(block_states) = block_states { let expected_length = if aligned_blocks { let blocks_per_word = 64 / bits as usize; - 4096usize.div_ceil(blocks_per_word) + (4096 + blocks_per_word - 1) / blocks_per_word } else { 64 * bits as usize }; @@ -145,7 +145,7 @@ impl<'a> SectionV1_13<'a> { } } -impl Section for SectionV1_13<'_> { +impl<'a> Section for SectionV1_13<'a> { fn block_at(&self, coords: SectionBlockCoords) -> Result> { let index = self.palette_index_at(coords); Ok(*self @@ -188,7 +188,7 @@ impl<'a> SectionV0<'a> { } } -impl Section for SectionV0<'_> { +impl<'a> Section for SectionV0<'a> { fn block_at(&self, coords: SectionBlockCoords) -> Result> { let offset = coords.offset(); let block = self.blocks[offset] as u8; @@ -208,7 +208,7 @@ impl Section for SectionV0<'_> { /// Trait for common functions of [BiomesV1_18] and [BiomesV0] pub trait Biomes: Debug { /// Returns the [Biome] at a coordinate tuple inside the chunk - fn biome_at(&self, section: SectionY, coords: SectionBlockCoords) -> Result<&Biome>; + fn biome_at(&self, section: SectionY, coords: SectionBlockCoords) -> Result>; } /// Minecraft v1.18+ section biome data @@ -226,7 +226,7 @@ pub struct BiomesV1_18<'a> { /// to whole i64 values. biomes: Option<&'a [i64]>, /// Biome palette indexed by entries encoded in *biomes* - palette: Vec<&'a Biome>, + palette: Vec>, /// Number of bits used for each entry in *biomes* bits: u8, } @@ -242,7 +242,7 @@ impl<'a> BiomesV1_18<'a> { if let Some(biomes) = biomes { let biomes_per_word = 64 / bits as usize; - let expected_length = 64usize.div_ceil(biomes_per_word); + let expected_length = (64 + biomes_per_word - 1) / biomes_per_word; if biomes.len() != expected_length { bail!("Invalid section biome data"); } @@ -253,11 +253,12 @@ impl<'a> BiomesV1_18<'a> { let palette_types = palette .iter() .map(|entry| { - biome_types.get(entry).unwrap_or_else(|| { + let biome_type = biome_types.get(entry); + if biome_type.is_none() { debug!("Unknown biome type: {}", entry); has_unknown = true; - biome_types.get_fallback() - }) + } + biome_type }) .collect(); @@ -293,8 +294,8 @@ impl<'a> BiomesV1_18<'a> { } } -impl Biomes for BiomesV1_18<'_> { - fn biome_at(&self, _section: SectionY, coords: SectionBlockCoords) -> Result<&Biome> { +impl<'a> Biomes for BiomesV1_18<'a> { + fn biome_at(&self, _section: SectionY, coords: SectionBlockCoords) -> Result> { let index = self.palette_index_at(coords); Ok(*self .palette @@ -348,8 +349,8 @@ impl<'a> BiomesV0<'a> { } } -impl Biomes for BiomesV0<'_> { - fn biome_at(&self, section: SectionY, coords: SectionBlockCoords) -> Result<&Biome> { +impl<'a> Biomes for BiomesV0<'a> { + fn biome_at(&self, section: SectionY, coords: SectionBlockCoords) -> Result> { let id = match self.data { BiomesV0Data::IntArrayV15(data) => { let LayerBlockCoords { x, z } = coords.xz; @@ -369,10 +370,7 @@ impl Biomes for BiomesV0<'_> { } BiomesV0Data::ByteArray(data) => data[coords.xz.offset()] as u8, }; - Ok(self - .biome_types - .get_legacy(id) - .unwrap_or(self.biome_types.get_fallback())) + Ok(self.biome_types.get_legacy(id)) } } @@ -400,6 +398,10 @@ impl<'a> BlockLight<'a> { let (offset, nibble) = div_rem(coords.offset(), 2); let byte = block_light[offset] as u8; - if nibble == 1 { byte >> 4 } else { byte & 0xf } + if nibble == 1 { + byte >> 4 + } else { + byte & 0xf + } } } diff --git a/src/world/sign.rs b/src/world/sign.rs index 8e4e670..616f7fa 100644 --- a/src/world/sign.rs +++ b/src/world/sign.rs @@ -1,14 +1,12 @@ //! Processing of sign text -use std::fmt::Display; +use std::{fmt::Display, sync::Arc}; -use bincode::{Decode, Encode}; -use minedmap_resource::Color; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use super::{ de, - text_value::{FormattedText, FormattedTextList, TextValue}, + json_text::{FormattedText, FormattedTextList, JSONText}, }; /// Version-independent reference to (front or back) sign text @@ -18,41 +16,17 @@ pub struct RawSignText<'a> { /// /// A regular sign always has 4 lines of text. The back of pre-1.20 /// signs is represented as a [SignText] without any `messages`. - pub messages: Vec<&'a TextValue>, + pub messages: Vec<&'a JSONText>, /// Sign color /// /// Defaults to "black". pub color: Option<&'a str>, } -/// The color to use for signs without a color attribute ("black") -const DEFAULT_COLOR: Color = Color([0, 0, 0]); - -/// Map of text colors associated with dyes (except for black) -static DYE_COLORS: phf::Map<&'static str, Color> = phf::phf_map! { - "white" => Color([255, 255, 255]), - "orange" => Color([255, 104, 31]), - "magenta" => Color([255, 0, 255]), - "light_blue" => Color([154, 192, 205]), - "yellow" => Color([255, 255, 0]), - "lime" => Color([191, 255, 0]), - "pink" => Color([255, 105, 180]), - "gray" => Color([128, 128, 128]), - "light_gray" => Color([211, 211, 211]), - "cyan" => Color([0, 255, 255]), - "purple" => Color([160, 32, 240]), - "blue" => Color([0, 0, 255]), - "brown" => Color([139, 69, 19]), - "green" => Color([0, 255, 0]), - "red" => Color([255, 0, 0]), -}; - -impl RawSignText<'_> { +impl<'a> RawSignText<'a> { /// Decodes the [RawSignText] into a [SignText] - pub fn decode(&self, data_version: u32) -> SignText { - let color = self - .color - .map(|c| DYE_COLORS.get(c).copied().unwrap_or(DEFAULT_COLOR)); + pub fn decode(&self) -> SignText { + let color = self.color.map(|c| Arc::new(c.to_owned())); let parent = FormattedText { color, ..Default::default() @@ -60,7 +34,7 @@ impl RawSignText<'_> { SignText( self.messages .iter() - .map(|message| message.deserialize(data_version).linearize(&parent)) + .map(|message| message.deserialize().linearize(&parent)) .collect(), ) } @@ -105,7 +79,7 @@ impl BlockEntitySignExt for de::BlockEntitySign { } } -#[derive(Debug, Default, Serialize, PartialEq, Eq, PartialOrd, Ord, Encode, Decode)] +#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] /// Deserialized and linearized sign text pub struct SignText(pub Vec); diff --git a/viewer/.dockerignore b/viewer/.dockerignore deleted file mode 100644 index 3af0ccb..0000000 --- a/viewer/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -/data diff --git a/viewer/Dockerfile b/viewer/Dockerfile deleted file mode 100644 index 524fd4c..0000000 --- a/viewer/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM docker.io/library/nginx:alpine-slim -COPY . /usr/share/nginx/html -# datadir should be mounted to: /usr/share/nginx/html/data diff --git a/viewer/MinedMap.js b/viewer/MinedMap.js index 61188b1..e784eec 100644 --- a/viewer/MinedMap.js +++ b/viewer/MinedMap.js @@ -73,7 +73,7 @@ function signIcon(material, kind) { } const MinedMapLayer = L.TileLayer.extend({ - initialize: function (mipmaps, layer, tile_extension) { + initialize: function (mipmaps, layer) { L.TileLayer.prototype.initialize.call(this, '', { detectRetina: true, tileSize: 512, @@ -88,7 +88,6 @@ const MinedMapLayer = L.TileLayer.extend({ this.mipmaps = mipmaps; this.layer = layer; - this.ext = tile_extension; }, createTile: function (coords, done) { @@ -113,7 +112,7 @@ const MinedMapLayer = L.TileLayer.extend({ return L.Util.emptyImageUrl; - return `data/${this.layer}/${z}/r.${coords.x}.${coords.y}.${this.ext}`; + return 'data/'+this.layer+'/'+z+'/r.'+coords.x+'.'+coords.y+'.png'; }, }); @@ -154,6 +153,25 @@ const parseHash = function () { return args; } +const colors = { + black: '#000000', + dark_blue: '#0000AA', + dark_green: '#00AA00', + dark_aqua: '#00AAAA', + dark_red: '#AA0000', + dark_purple: '#AA00AA', + gold: '#FFAA00', + gray: '#AAAAAA', + dark_gray: '#555555', + blue: '#5555FF', + green: '#55FF55', + aqua: '#55FFFF', + red: '#FF5555', + light_purple: '#FF55FF', + yellow: '#FFFF55', + white: '#FFFFFF', +}; + function formatSignLine(line) { const el = document.createElement('span'); el.style.whiteSpace = 'pre'; @@ -162,9 +180,7 @@ function formatSignLine(line) { const child = document.createElement('span'); child.textContent = span.text; - let color = span.color ?? ''; - if (color[0] !== '#') - color = '#000000'; + const color = colors[span.color ?? 'black'] || colors['black']; if (span.bold) child.style.fontWeight = 'bold'; @@ -333,7 +349,6 @@ window.createMap = function () { const res = await response.json(); const {mipmaps, spawn} = res; const features = res.features || {}; - const tile_extension = res.tile_extension || 'png'; const updateParams = function () { const args = parseHash(); @@ -371,10 +386,10 @@ window.createMap = function () { const overlayMaps = {}; - const mapLayer = new MinedMapLayer(mipmaps, 'map', tile_extension); + const mapLayer = new MinedMapLayer(mipmaps, 'map'); mapLayer.addTo(map); - const lightLayer = new MinedMapLayer(mipmaps, 'light', tile_extension); + const lightLayer = new MinedMapLayer(mipmaps, 'light'); overlayMaps['Illumination'] = lightLayer; if (params.light) map.addLayer(lightLayer); diff --git a/viewer/images/bg/pale_oak_hanging_sign.png b/viewer/images/bg/pale_oak_hanging_sign.png deleted file mode 100644 index 972a119..0000000 Binary files a/viewer/images/bg/pale_oak_hanging_sign.png and /dev/null differ diff --git a/viewer/images/bg/pale_oak_hanging_wall_sign.png b/viewer/images/bg/pale_oak_hanging_wall_sign.png deleted file mode 100644 index cf98cb2..0000000 Binary files a/viewer/images/bg/pale_oak_hanging_wall_sign.png and /dev/null differ diff --git a/viewer/images/bg/pale_oak_sign.png b/viewer/images/bg/pale_oak_sign.png deleted file mode 100644 index 5ea5a7e..0000000 Binary files a/viewer/images/bg/pale_oak_sign.png and /dev/null differ diff --git a/viewer/images/bg/pale_oak_wall_sign.png b/viewer/images/bg/pale_oak_wall_sign.png deleted file mode 100644 index f52f32a..0000000 Binary files a/viewer/images/bg/pale_oak_wall_sign.png and /dev/null differ diff --git a/viewer/images/icon/pale_oak_hanging_sign.png b/viewer/images/icon/pale_oak_hanging_sign.png deleted file mode 100644 index cd61dd1..0000000 Binary files a/viewer/images/icon/pale_oak_hanging_sign.png and /dev/null differ diff --git a/viewer/images/icon/pale_oak_hanging_wall_sign.png b/viewer/images/icon/pale_oak_hanging_wall_sign.png deleted file mode 100644 index fefd31a..0000000 Binary files a/viewer/images/icon/pale_oak_hanging_wall_sign.png and /dev/null differ diff --git a/viewer/images/icon/pale_oak_sign.png b/viewer/images/icon/pale_oak_sign.png deleted file mode 100644 index 3684f5d..0000000 Binary files a/viewer/images/icon/pale_oak_sign.png and /dev/null differ diff --git a/viewer/images/icon/pale_oak_wall_sign.png b/viewer/images/icon/pale_oak_wall_sign.png deleted file mode 100644 index 32257e3..0000000 Binary files a/viewer/images/icon/pale_oak_wall_sign.png and /dev/null differ