From 00eea4537501b1679873900d6470c7d8df0ed631 Mon Sep 17 00:00:00 2001 From: Myrddin Emrys Date: Wed, 14 Feb 2024 18:01:25 -0600 Subject: [PATCH 01/96] Improve README.md instructions. Added instructions that would have made my initial attempts to use the tool less confusing. --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b857454..402c7b2 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,18 @@ based on [Leaflet](https://leafletjs.com/). The map renderer is heavily inspired ## How to use +Download both the release that matches your platform, as well as the platform- +independant viewer archive. Extract the viewer archive. This directory will be made +publicly accessible on a web server and will contain both the html and javascript to +operate the viewer, as well as the image data generated by MinedMap. + 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; `viewer` refers +(replacing the first argument with the path to your save data; `` refers to the directory where you unpacked the MinedMap viewer): ```shell -minedmap ~/.minecraft/saves/World viewer/data +minedmap ~/.minecraft/saves/World /data ``` The first map generation might take a while for big worlds, but subsequent calls will @@ -47,6 +52,10 @@ 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 that is only used locally to make updates +process more quickly. + ### Signs ![Sign screenshot](https://raw.githubusercontent.com/neocturne/MinedMap/e5d9c813ba3118d04dc7e52e3dc6f48808a69120/docs/images/signs.png) From bccd6d6cb4fad4a7d6bd8a7d3669ac4706428d6d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 3 Mar 2024 23:43:42 +0100 Subject: [PATCH 02/96] README.md: some rewording --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 402c7b2..8f7867f 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,12 @@ based on [Leaflet](https://leafletjs.com/). The map renderer is heavily inspired ## How to use -Download both the release that matches your platform, as well as the platform- -independant viewer archive. Extract the viewer archive. This directory will be made -publicly accessible on a web server and will contain both the html and javascript to -operate the viewer, as well as the image data generated by MinedMap. +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 @@ -52,9 +54,9 @@ 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 that is only used locally to make updates -process more quickly. +If you are uploading the directory to a remote webserver, you do not need to upload the +`/data/processed` directory, as that is only used locally to allow processing +updates more quickly. ### Signs From 44e914599b1d6a2ab43fc32a960fa0a5e9b0b028 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 3 Mar 2024 23:48:49 +0100 Subject: [PATCH 03/96] types: fix new clippy lint --- crates/types/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index e219a97..b4f12c2 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -47,8 +47,7 @@ macro_rules! coord_type { /// Returns an iterator over all possible values of the type #[inline] - pub fn iter() -> impl Iterator> - + DoubleEndedIterator + pub fn iter() -> impl DoubleEndedIterator> + ExactSizeIterator + FusedIterator + Clone From 39b073f24b8837cec00f4b554271930a6bbd2a04 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 3 Mar 2024 23:48:42 +0100 Subject: [PATCH 04/96] Update dependencies --- Cargo.lock | 197 ++++++++++++++++++++++++++--------------------------- 1 file changed, 98 insertions(+), 99 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a88179..b87c678 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -46,9 +46,9 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -60,9 +60,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -94,9 +94,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "autocfg" @@ -142,9 +142,9 @@ checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" [[package]] name = "byteorder" @@ -176,9 +176,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.18" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", @@ -186,9 +186,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", @@ -199,9 +199,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", @@ -211,9 +211,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "cmake" @@ -238,9 +238,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -272,15 +272,15 @@ checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "enumflags2" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" dependencies = [ "enumflags2_derive", "serde", @@ -288,9 +288,9 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", @@ -315,9 +315,9 @@ dependencies = [ [[package]] name = "fastnbt" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369bd70629bccfda7e344883c9ae3ab7f3b10a357bcf8b0f69caa7256bcf188" +checksum = "7d4a73a95dc65551ccd98e1ecd1adb5d1ba5361146963b31f481ca42fc0520a3" dependencies = [ "byteorder", "cesu8", @@ -432,15 +432,15 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "image" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" dependencies = [ "bytemuck", "byteorder", @@ -451,9 +451,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown", @@ -462,9 +462,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -477,9 +477,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] @@ -492,9 +492,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libz-ng-sys" @@ -524,15 +524,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ "hashbrown", ] @@ -604,9 +604,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", "simd-adler32", @@ -624,19 +624,18 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -709,15 +708,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "png" -version = "0.17.11" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -746,9 +745,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" dependencies = [ "either", "rayon-core", @@ -816,9 +815,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", @@ -829,9 +828,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "scopeguard" @@ -841,9 +840,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] @@ -859,9 +858,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", @@ -870,9 +869,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -911,15 +910,15 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" -version = "2.0.48" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -938,9 +937,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -948,9 +947,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "parking_lot", @@ -1075,7 +1074,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -1095,17 +1094,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "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", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -1116,9 +1115,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -1128,9 +1127,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -1140,9 +1139,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -1152,9 +1151,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -1164,9 +1163,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -1176,9 +1175,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -1188,9 +1187,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "zerocopy" From 66189d279cd27c7df9f4fee8a5fa8e30fffd453e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Jun 2024 16:02:56 +0200 Subject: [PATCH 05/96] core: region_processor: fix crash due to incorrect counting in info message Fixes #52 --- CHANGELOG.md | 7 +++++ Cargo.lock | 21 +++++++++++++++ Cargo.toml | 1 + src/core/region_processor.rs | 52 +++++++++++++----------------------- 4 files changed, 47 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b134e..efcf8d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## [Unreleased] - ReleaseDate +### 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. + ## [2.1.0] - 2024-01-27 ### Added diff --git a/Cargo.lock b/Cargo.lock index b87c678..1780b1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,6 +276,26 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +[[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", +] + [[package]] name = "enumflags2" version = "0.7.9" @@ -550,6 +570,7 @@ dependencies = [ "anyhow", "bincode", "clap", + "enum-map", "fastnbt", "futures-util", "git-version", diff --git a/Cargo.toml b/Cargo.toml index 082c5b6..f8bb35f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,7 @@ pre-release-replacements = [ anyhow = "1.0.68" bincode = "1.3.3" clap = { version = "4.1.4", features = ["derive", "wrap_help"] } +enum-map = "2.7.3" fastnbt = "2.3.2" futures-util = "0.3.28" git-version = "0.3.5" diff --git a/src/core/region_processor.rs b/src/core/region_processor.rs index 63d5c09..9778061 100644 --- a/src/core/region_processor.rs +++ b/src/core/region_processor.rs @@ -1,16 +1,9 @@ //! The [RegionProcessor] and related functions -use std::{ - ffi::OsStr, - path::PathBuf, - sync::{ - atomic::{AtomicBool, Ordering}, - mpsc, - }, - time::SystemTime, -}; +use std::{ffi::OsStr, path::PathBuf, sync::mpsc, time::SystemTime}; use anyhow::{Context, Result}; +use enum_map::{Enum, EnumMap}; use rayon::prelude::*; use tracing::{debug, info, warn}; @@ -36,7 +29,7 @@ fn parse_region_filename(file_name: &OsStr) -> Option { } /// [RegionProcessor::process_region] return values -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Enum)] enum RegionProcessorStatus { /// Region was processed Ok, @@ -363,6 +356,8 @@ 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))?; @@ -370,31 +365,18 @@ impl<'a> RegionProcessor<'a> { info!("Processing region files..."); let (region_send, region_recv) = mpsc::channel(); - let (processed_send, processed_recv) = mpsc::channel(); - let (error_send, error_recv) = mpsc::channel(); - - let has_unknown = AtomicBool::new(false); + let (status_send, status_recv) = mpsc::channel(); self.collect_regions()?.par_iter().try_for_each(|&coords| { let ret = self .process_region(coords) .with_context(|| format!("Failed to process region {:?}", coords))?; - if ret != RegionProcessorStatus::ErrorMissing { + if ret != Status::ErrorMissing { region_send.send(coords).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() - } - } + status_send.send(ret).unwrap(); anyhow::Ok(()) })?; @@ -402,19 +384,21 @@ impl<'a> RegionProcessor<'a> { drop(region_send); let mut regions: Vec<_> = region_recv.into_iter().collect(); - drop(processed_send); - let processed = processed_recv.into_iter().count(); - drop(error_send); - let errors = error_recv.into_iter().count(); + drop(status_send); + + let mut status = EnumMap::<_, usize>::default(); + for ret in status_recv { + status[ret] += 1; + } info!( "Processed region files ({} processed, {} unchanged, {} errors)", - processed, - regions.len() - processed - errors, - errors, + status[Status::Ok] + status[Status::OkWithUnknown], + status[Status::Skipped], + status[Status::ErrorOk] + status[Status::ErrorMissing], ); - if has_unknown.into_inner() { + if status[Status::OkWithUnknown] > 0 { warn!("Unknown block or biome types found during processing"); eprint!(concat!( "\n", From e74e7be68667f7562e57b1ed14bce25a796be336 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Jun 2024 16:15:56 +0200 Subject: [PATCH 06/96] core: region_processor: ignore empty region files Minecraft generates empty region files in some cases. Just ignore these files instead of printing an error message for each. --- CHANGELOG.md | 4 ++++ src/core/region_processor.rs | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efcf8d5..c010654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ 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 diff --git a/src/core/region_processor.rs b/src/core/region_processor.rs index 9778061..ce2d060 100644 --- a/src/core/region_processor.rs +++ b/src/core/region_processor.rs @@ -337,11 +337,20 @@ impl<'a> RegionProcessor<'a> { })? .filter_map(|entry| entry.ok()) .filter(|entry| { - // We are only interested in regular files - matches!( - entry.file_type().map(|file_type| file_type.is_file()), - Ok(true) - ) + (|| { + // 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() }) .filter_map(|entry| parse_region_filename(&entry.file_name())) .collect()) From e9abe6b502b0a77b2429e99f829c29ccb664edec Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Jun 2024 16:31:18 +0200 Subject: [PATCH 07/96] minedmap 2.1.1 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c010654..d877117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] - ReleaseDate +## [2.1.1] - 2024-06-14 + ### Fixed - Fix crash due to incorrect counting in info message @@ -87,7 +89,8 @@ intermediate data. Full support for custom biomes datapacks might be added in a future release. -[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.1.0...HEAD +[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.1.1...HEAD +[2.1.1]: https://github.com/neocturne/MinedMap/compare/v2.1.0...v2.1.1 [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 1780b1f..890b515 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -565,7 +565,7 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "minedmap" -version = "2.1.0" +version = "2.1.1" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index f8bb35f..ac9d456 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ pre-release-commit-message = "{{crate_name}} {{version}}" [package] name = "minedmap" -version = "2.1.0" +version = "2.1.1" description = "Generate browsable maps from Minecraft save data" edition.workspace = true license.workspace = true From 661da4698dfeab11cb5d57a17696b13886d2597c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 19 Jun 2024 19:38:52 +0200 Subject: [PATCH 08/96] workflows: update MacOS jobs to macos-13 --- .github/workflows/MinedMap.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index b09d620..c2e9961 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -91,9 +91,9 @@ jobs: fail-fast: false matrix: include: - - os: 'macos-11' + - os: 'macos-13' target: 'aarch64-apple-darwin' - - os: 'macos-11' + - os: 'macos-13' target: 'x86_64-apple-darwin' - os: 'windows-2019' target: 'x86_64-pc-windows-msvc' From bc8219772fc0ef0b69e4050ac6ff3988b1b2954e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 23 Jun 2024 01:16:27 +0200 Subject: [PATCH 09/96] README.md: mention argument quoting difference on Windows --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 8f7867f..efa6573 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,11 @@ modify the text displayed on the map. This can be used if the text matched by `--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 From 7f3e47fcb4b5f7a05c3bab878e0bc17e595b8894 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 23 Jun 2024 01:17:33 +0200 Subject: [PATCH 10/96] treewide: update dependencies --- Cargo.lock | 358 +++++++++++++++++++------------------ Cargo.toml | 4 +- crates/resource/Cargo.toml | 2 +- crates/types/Cargo.toml | 2 +- 4 files changed, 187 insertions(+), 179 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 890b515..2ae562a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -31,62 +31,63 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -94,21 +95,21 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -136,15 +137,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bytemuck" -version = "1.14.3" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" [[package]] name = "byteorder" @@ -154,12 +155,13 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -176,9 +178,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.1" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", @@ -186,9 +188,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", @@ -199,9 +201,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck", "proc-macro2", @@ -211,9 +213,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "cmake" @@ -224,23 +226,17 @@ 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.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -266,15 +262,15 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "either" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "enum-map" @@ -298,9 +294,9 @@ dependencies = [ [[package]] name = "enumflags2" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", "serde", @@ -308,9 +304,9 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", @@ -325,9 +321,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -356,9 +352,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "libz-ng-sys", @@ -404,9 +400,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "git-version" @@ -430,15 +426,15 @@ dependencies = [ [[package]] name = "glam" -version = "0.25.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" +checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -446,9 +442,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -458,22 +454,21 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "image" -version = "0.24.9" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" dependencies = [ "bytemuck", "byteorder", - "color_quant", "num-traits", "png", ] [[package]] name = "indexmap" -version = "2.2.5" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -481,40 +476,46 @@ dependencies = [ ] [[package]] -name = "itertools" -version = "0.12.1" +name = "is_terminal_polyfill" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libz-ng-sys" @@ -528,15 +529,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -559,9 +560,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minedmap" @@ -625,9 +626,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", "simd-adler32", @@ -654,9 +655,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -673,9 +674,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] @@ -694,9 +695,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -704,22 +705,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -748,27 +749,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "rayon" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -786,18 +787,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -807,9 +808,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -818,29 +819,29 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -849,9 +850,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scopeguard" @@ -861,9 +862,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] @@ -879,9 +880,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", @@ -890,9 +891,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -925,21 +926,21 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.52" +version = "2.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" dependencies = [ "proc-macro2", "quote", @@ -968,9 +969,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.36.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "parking_lot", @@ -1042,9 +1043,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" @@ -1095,7 +1096,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -1115,17 +1116,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -1136,9 +1138,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -1148,9 +1150,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -1160,9 +1162,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -1172,9 +1180,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -1184,9 +1192,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -1196,9 +1204,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -1208,24 +1216,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", @@ -1234,27 +1242,27 @@ dependencies = [ [[package]] name = "zstd" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.11+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index ac9d456..6fa4cdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ enum-map = "2.7.3" fastnbt = "2.3.2" futures-util = "0.3.28" git-version = "0.3.5" -image = { version = "0.24.5", default-features = false, features = ["png"] } +image = { version = "0.25.1", 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 } @@ -54,7 +54,7 @@ num-integer = "0.1.45" num_cpus = "1.16.0" rayon = "1.7.0" regex = "1.10.2" -rustc-hash = "1.1.0" +rustc-hash = "2.0.0" serde = { version = "1.0.152", features = ["rc", "derive"] } serde_json = "1.0.99" tokio = { version = "1.31.0", features = ["rt", "parking_lot", "sync"] } diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index 364ac85..326e269 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -9,5 +9,5 @@ repository.workspace = true [dependencies] enumflags2 = { version = "0.7.7", features = ["serde"] } -glam = "0.25.0" +glam = "0.28.0" serde = { version = "1.0.183", features = ["derive"] } diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index e67d824..c294466 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -8,5 +8,5 @@ readme.workspace = true repository.workspace = true [dependencies] -itertools = "0.12.0" +itertools = "0.13.0" serde = { version = "1.0.183", features = ["derive"] } From 414ad5a49374f8a20fc53f3c24baf30dbf1171df Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 19 Jun 2024 19:15:20 +0200 Subject: [PATCH 11/96] resource: add Minecraft 1.21 block types --- CHANGELOG.md | 4 + README.md | 2 +- crates/resource/src/block_types.rs | 570 +++++++++++++++++++++++++++++ resource/blocks.json | 131 +++++++ src/core/common.rs | 4 +- 5 files changed, 708 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d877117..318ee9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] - ReleaseDate +### Added + +- Added support for Minecraft 1.21 block types + ## [2.1.1] - 2024-06-14 ### Fixed diff --git a/README.md b/README.md index efa6573..9a07aed 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.20 (no mod installation necessary!) +* Compatible with unmodified Minecraft Java Edition 1.8 up to 1.21 (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 diff --git a/crates/resource/src/block_types.rs b/crates/resource/src/block_types.rs index 6229016..cbfe1b7 100644 --- a/crates/resource/src/block_types.rs +++ b/crates/resource/src/block_types.rs @@ -1843,6 +1843,16 @@ 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 { @@ -1913,6 +1923,26 @@ 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 { @@ -2123,6 +2153,36 @@ 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 { @@ -2133,6 +2193,16 @@ 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 { @@ -2193,6 +2263,16 @@ 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 { @@ -3533,6 +3613,16 @@ 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 { @@ -3543,6 +3633,46 @@ 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 { @@ -4183,6 +4313,16 @@ 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 { @@ -6273,6 +6413,16 @@ 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 { @@ -6283,6 +6433,46 @@ 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 { @@ -6863,6 +7053,46 @@ 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 { @@ -9153,6 +9383,16 @@ 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 { @@ -9223,6 +9463,76 @@ 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 { @@ -9253,6 +9563,16 @@ 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 { @@ -9513,6 +9833,16 @@ 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 { @@ -9523,6 +9853,46 @@ 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 { @@ -9553,6 +9923,16 @@ 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 { @@ -9563,6 +9943,46 @@ 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 { @@ -9593,6 +10013,16 @@ 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 { @@ -9603,6 +10033,46 @@ 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 { @@ -9633,6 +10103,16 @@ 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 { @@ -9643,6 +10123,46 @@ 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 { @@ -9673,6 +10193,16 @@ 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 { @@ -9683,6 +10213,46 @@ 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 { diff --git a/resource/blocks.json b/resource/blocks.json index f8b0165..9d70f96 100644 --- a/resource/blocks.json +++ b/resource/blocks.json @@ -408,6 +408,7 @@ "chiseled_bookshelf": { "texture": "chiseled_bookshelf_top" }, + "chiseled_copper": {}, "chiseled_deepslate": {}, "chiseled_nether_bricks": {}, "chiseled_polished_blackstone": {}, @@ -419,6 +420,10 @@ "texture": "sandstone_top" }, "chiseled_stone_bricks": {}, + "chiseled_tuff": {}, + "chiseled_tuff_bricks": { + "texture": "chiseled_tuff_bricks_top" + }, "chorus_flower": {}, "chorus_plant": {}, "clay": {}, @@ -458,13 +463,22 @@ }, "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" }, @@ -733,7 +747,14 @@ "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" @@ -843,6 +864,7 @@ "hay_block": { "texture": "hay_block_top" }, + "heavy_core": {}, "heavy_weighted_pressure_plate": { "texture": "iron_block" }, @@ -1269,7 +1291,14 @@ "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" @@ -1390,6 +1419,16 @@ "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" @@ -1912,6 +1951,9 @@ "trapped_chest": { "texture": "oak_planks" }, + "trial_spawner": { + "texture": "trial_spawner_top_inactive" + }, "tripwire": null, "tripwire_hook": null, "tube_coral": null, @@ -1919,9 +1961,31 @@ "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" }, @@ -1991,9 +2055,24 @@ "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" }, @@ -2003,9 +2082,24 @@ "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" }, @@ -2015,9 +2109,24 @@ "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" }, @@ -2027,9 +2136,24 @@ "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" }, @@ -2039,7 +2163,14 @@ "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" diff --git a/src/core/common.rs b/src/core/common.rs index 9a94496..4241ebc 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -24,7 +24,7 @@ use crate::{ /// /// 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(1); +pub const REGION_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(2); /// MinedMap map tile data version number /// @@ -36,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(1); +pub const LIGHTMAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(2); /// MinedMap mipmap data version number /// From f1bc18add1e0e86f5b98612d5e6d9d689877643f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 23 Jun 2024 11:30:20 +0200 Subject: [PATCH 12/96] minedmap-types 0.1.3 --- Cargo.lock | 2 +- crates/types/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2ae562a..5c8d051 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -618,7 +618,7 @@ dependencies = [ [[package]] name = "minedmap-types" -version = "0.1.2" +version = "0.1.3" dependencies = [ "itertools", "serde", diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index c294466..6a81414 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-types" -version = "0.1.2" +version = "0.1.3" description = "Common types used by several MinedMap crates" edition.workspace = true license.workspace = true From 269f08d3561e267d6843a361dc4aef50ab4528b9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 23 Jun 2024 11:30:41 +0200 Subject: [PATCH 13/96] minedmap-resource 0.4.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/resource/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c8d051..4a7bb19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -609,7 +609,7 @@ dependencies = [ [[package]] name = "minedmap-resource" -version = "0.3.0" +version = "0.4.0" dependencies = [ "enumflags2", "glam", diff --git a/Cargo.toml b/Cargo.toml index 6fa4cdf..a8bfc58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ image = { version = "0.25.1", 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-resource = { version = "0.4.0", path = "crates/resource" } minedmap-types = { version = "0.1.2", path = "crates/types" } num-integer = "0.1.45" num_cpus = "1.16.0" diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index 326e269..ea4bc95 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-resource" -version = "0.3.0" +version = "0.4.0" description = "Data describing Minecraft biomes and block types" edition.workspace = true license.workspace = true From f43e84eb2b4d1594333eca73cdb7b99bacae5851 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 23 Jun 2024 11:31:45 +0200 Subject: [PATCH 14/96] minedmap 2.2.0 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 318ee9a..ef41795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] - ReleaseDate +## [2.2.0] - 2024-06-23 + ### Added - Added support for Minecraft 1.21 block types @@ -93,7 +95,8 @@ intermediate data. Full support for custom biomes datapacks might be added in a future release. -[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.1.1...HEAD +[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.2.0...HEAD +[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 [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 diff --git a/Cargo.lock b/Cargo.lock index 4a7bb19..28eb4e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -566,7 +566,7 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minedmap" -version = "2.1.1" +version = "2.2.0" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index a8bfc58..ddf24ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ pre-release-commit-message = "{{crate_name}} {{version}}" [package] name = "minedmap" -version = "2.1.1" +version = "2.2.0" description = "Generate browsable maps from Minecraft save data" edition.workspace = true license.workspace = true From f9a03b332ca9f347c74a1cabb375b1d52280cfad Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 18 Jul 2024 23:22:05 +0200 Subject: [PATCH 15/96] README.md: fix incorrect `--sign-transform` example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a07aed..2312c03 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ 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-filter 's/\[Map\]//'` would replace each occurence of "\[Map\]" with +`--sign-transform 's/\[Map\]//'` would replace each occurence of "\[Map\]" with the empty string. **Note:** On Windows, double quotes (`"`) must be used for arguments instead From 7b44ee30d6ffe631379508952e534abac36a1716 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 20 Nov 2024 14:27:30 +0100 Subject: [PATCH 16/96] Add LICENSE file again It can be useful for Github to show the license next to the repo, and it's clearer that the license applies both to the Rust code and the viewer this way. The project was relicensed from BSD-2-Clause to MIT in 2023, but the first year of the copyright is when the project started in 2015. --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2f9ad3f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +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. From 2156bff59af32c11850ad94dd21c116925c63141 Mon Sep 17 00:00:00 2001 From: "kek.rs" <189154018+kekrs@users.noreply.github.com> Date: Tue, 17 Dec 2024 00:05:12 +0100 Subject: [PATCH 17/96] Add Dockerfiles (#56) --- Dockerfile | 14 ++++++++++++++ Dockerfile.viewer | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 Dockerfile create mode 100644 Dockerfile.viewer diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fa3627c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM docker.io/library/rust:alpine AS BUILDER + +WORKDIR /build +RUN apk update && apk add cmake build-base + +COPY src /build/src +COPY crates /build/crates +COPY Cargo.toml Cargo.lock /build +RUN cargo build -r + +FROM scratch AS RUNNER + +COPY --from=BUILDER /build/target/release/minedmap /minedmap +ENTRYPOINT [ "/minedmap" ] diff --git a/Dockerfile.viewer b/Dockerfile.viewer new file mode 100644 index 0000000..82d50bb --- /dev/null +++ b/Dockerfile.viewer @@ -0,0 +1,3 @@ +FROM docker.io/library/nginx:alpine +COPY viewer /usr/share/nginx/html +# datadir should be mounted to: /usr/share/nginx/html/data From 4933d8e15f73234717ca4eb381cbce7bab16b361 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 17 Dec 2024 00:23:57 +0100 Subject: [PATCH 18/96] treewide: clippy fixes Fix all clippy warnings as of Rust 1.83.0. --- src/core/common.rs | 2 +- src/core/entity_collector.rs | 4 ++-- src/core/tile_mipmapper.rs | 4 ++-- src/world/chunk.rs | 6 +++--- src/world/layer.rs | 2 +- src/world/section.rs | 12 ++++++------ src/world/sign.rs | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/core/common.rs b/src/core/common.rs index 4241ebc..5f518e0 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -18,7 +18,7 @@ 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 /// diff --git a/src/core/entity_collector.rs b/src/core/entity_collector.rs index 3d9b6ab..30b3a86 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<'a> TileMerger for EntityCollector<'a> { +impl TileMerger for EntityCollector<'_> { fn file_meta_version(&self) -> fs::FileMetaVersion { ENTITIES_FILE_META_VERSION } @@ -34,7 +34,7 @@ impl<'a> TileMerger for EntityCollector<'a> { } } -impl<'a> TileCollector for EntityCollector<'a> { +impl TileCollector for EntityCollector<'_> { type CollectOutput = (); fn tiles(&self) -> &[TileCoords] { diff --git a/src/core/tile_mipmapper.rs b/src/core/tile_mipmapper.rs index cd90e20..d7e54a9 100644 --- a/src/core/tile_mipmapper.rs +++ b/src/core/tile_mipmapper.rs @@ -74,7 +74,7 @@ impl<'a, P> MapMerger<'a, P> { } } -impl<'a, P: image::PixelWithColorType> TileMerger for MapMerger<'a, P> +impl TileMerger for MapMerger<'_, P> where [P::Subpixel]: image::EncodableLayout, image::ImageBuffer>: Into, @@ -157,7 +157,7 @@ pub struct TileMipmapper<'a> { regions: &'a [TileCoords], } -impl<'a> TileCollector for TileMipmapper<'a> { +impl TileCollector for TileMipmapper<'_> { type CollectOutput = MipmapStat; fn tiles(&self) -> &[TileCoords] { diff --git a/src/world/chunk.rs b/src/world/chunk.rs index bf1d78b..daee023 100644 --- a/src/world/chunk.rs +++ b/src/world/chunk.rs @@ -416,13 +416,13 @@ impl<'a> Iterator for SectionIter<'a> { } } -impl<'a> DoubleEndedIterator for SectionIter<'a> { +impl DoubleEndedIterator for SectionIter<'_> { fn next_back(&mut self) -> Option { self.with_iter(|iter| iter.next_back()) } } -impl<'a> ExactSizeIterator for SectionIter<'a> { +impl ExactSizeIterator for SectionIter<'_> { fn len(&self) -> usize { match &self.inner { SectionIterInner::V1_18 { iter } => iter.len(), @@ -433,4 +433,4 @@ impl<'a> ExactSizeIterator for SectionIter<'a> { } } -impl<'a> FusedIterator for SectionIter<'a> {} +impl FusedIterator for SectionIter<'_> {} diff --git a/src/world/layer.rs b/src/world/layer.rs index 576dfa4..0764711 100644 --- a/src/world/layer.rs +++ b/src/world/layer.rs @@ -58,7 +58,7 @@ struct LayerEntry<'a> { depth: &'a mut Option, } -impl<'a> LayerEntry<'a> { +impl LayerEntry<'_> { /// 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 diff --git a/src/world/section.rs b/src/world/section.rs index 62b510b..7988fd5 100644 --- a/src/world/section.rs +++ b/src/world/section.rs @@ -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; - (4096 + blocks_per_word - 1) / blocks_per_word + 4096usize.div_ceil(blocks_per_word) } else { 64 * bits as usize }; @@ -145,7 +145,7 @@ impl<'a> SectionV1_13<'a> { } } -impl<'a> Section for SectionV1_13<'a> { +impl Section for SectionV1_13<'_> { 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<'a> Section for SectionV0<'a> { +impl Section for SectionV0<'_> { fn block_at(&self, coords: SectionBlockCoords) -> Result> { let offset = coords.offset(); let block = self.blocks[offset] as 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 = (64 + biomes_per_word - 1) / biomes_per_word; + let expected_length = 64usize.div_ceil(biomes_per_word); if biomes.len() != expected_length { bail!("Invalid section biome data"); } @@ -294,7 +294,7 @@ impl<'a> BiomesV1_18<'a> { } } -impl<'a> Biomes for BiomesV1_18<'a> { +impl Biomes for BiomesV1_18<'_> { fn biome_at(&self, _section: SectionY, coords: SectionBlockCoords) -> Result> { let index = self.palette_index_at(coords); Ok(*self @@ -349,7 +349,7 @@ impl<'a> BiomesV0<'a> { } } -impl<'a> Biomes for BiomesV0<'a> { +impl Biomes for BiomesV0<'_> { fn biome_at(&self, section: SectionY, coords: SectionBlockCoords) -> Result> { let id = match self.data { BiomesV0Data::IntArrayV15(data) => { diff --git a/src/world/sign.rs b/src/world/sign.rs index 616f7fa..57b741a 100644 --- a/src/world/sign.rs +++ b/src/world/sign.rs @@ -23,7 +23,7 @@ pub struct RawSignText<'a> { pub color: Option<&'a str>, } -impl<'a> RawSignText<'a> { +impl RawSignText<'_> { /// Decodes the [RawSignText] into a [SignText] pub fn decode(&self) -> SignText { let color = self.color.map(|c| Arc::new(c.to_owned())); From feaf90c96c5bfb01df112f6f13ac42ca5928dbd9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 17 Dec 2024 00:31:38 +0100 Subject: [PATCH 19/96] Update dependencies --- Cargo.lock | 498 +++++++++++++++---------------------- crates/resource/Cargo.toml | 2 +- 2 files changed, 208 insertions(+), 292 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28eb4e8..d32985d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,33 +1,21 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" @@ -40,15 +28,15 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -61,63 +49,63 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] @@ -137,15 +125,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bytemuck" -version = "1.16.1" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" +checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" [[package]] name = "byteorder" @@ -154,14 +142,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "cc" -version = "1.0.99" +name = "byteorder-lite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "cc" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" dependencies = [ "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] @@ -178,9 +172,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.7" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -188,9 +182,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -201,9 +195,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -213,24 +207,24 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "cmake" -version = "0.1.50" +version = "0.1.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" dependencies = [ "cc", ] [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "crc32fast" @@ -243,9 +237,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -262,15 +256,15 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "enum-map" @@ -321,12 +315,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -343,18 +337,18 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.4" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" dependencies = [ "simd-adler32", ] [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "libz-ng-sys", @@ -362,16 +356,22 @@ dependencies = [ ] [[package]] -name = "futures-core" -version = "0.3.30" +name = "foldhash" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -380,15 +380,15 @@ dependencies = [ [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-macro", @@ -400,9 +400,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git-version" @@ -426,18 +426,19 @@ dependencies = [ [[package]] name = "glam" -version = "0.28.0" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94" +checksum = "dc46dd3ec48fdd8e693a98d2b8bafae273a2d54c1de02a2a7e3d57d501f39677" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", "allocator-api2", + "equivalent", + "foldhash", ] [[package]] @@ -454,21 +455,21 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "image" -version = "0.25.1" +version = "0.25.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" +checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" dependencies = [ "bytemuck", - "byteorder", + "byteorder-lite", "num-traits", "png", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -477,9 +478,9 @@ dependencies = [ [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -492,15 +493,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] @@ -513,15 +514,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libz-ng-sys" -version = "1.1.15" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6409efc61b12687963e602df8ecf70e8ddacf95bc6576bcf16e3ac6328083c5" +checksum = "8f0f7295a34685977acb2e8cc8b08ee4a8dffd6cf278eeccddbe1ed55ba815d5" dependencies = [ "cmake", "libc", @@ -545,15 +546,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ "hashbrown", ] @@ -626,11 +627,11 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", "simd-adler32", ] @@ -674,18 +675,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.0" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "overload" @@ -713,14 +714,14 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -730,15 +731,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "png" -version = "0.17.13" +version = "0.17.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "b67582bd5b65bdff614270e2ea89a1cf15bef71245cc1e5f7ea126977144211d" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -749,18 +750,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -787,18 +788,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.5" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -808,9 +809,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -819,9 +820,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-demangle" @@ -831,21 +832,21 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -862,27 +863,27 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", @@ -891,11 +892,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -909,6 +911,12 @@ 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" @@ -938,9 +946,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.67" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -949,12 +957,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ "rustix", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -969,9 +977,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.38.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "parking_lot", @@ -980,9 +988,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -991,9 +999,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", @@ -1002,9 +1010,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -1023,9 +1031,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "nu-ansi-term", "sharded-slab", @@ -1037,9 +1045,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "utf8parse" @@ -1053,12 +1061,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "winapi" version = "0.3.9" @@ -1083,186 +1085,100 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", + "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "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.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[package]] -name = "zerocopy" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "zstd" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.1.0" +version = "7.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.11+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index ea4bc95..de9b577 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -9,5 +9,5 @@ repository.workspace = true [dependencies] enumflags2 = { version = "0.7.7", features = ["serde"] } -glam = "0.28.0" +glam = "0.29.2" serde = { version = "1.0.183", features = ["derive"] } From 11e25106cfd466478b2aeec60c50d51e2b321e47 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 Dec 2024 03:05:06 +0100 Subject: [PATCH 20/96] Update dependencies --- Cargo.lock | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d32985d..ff64b60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -83,9 +83,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "autocfg" @@ -131,9 +131,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bytemuck" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -149,9 +149,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.2.4" +version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" dependencies = [ "jobserver", "libc", @@ -357,9 +357,9 @@ dependencies = [ [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" [[package]] name = "futures-core" @@ -514,9 +514,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libz-ng-sys" @@ -627,9 +627,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", "simd-adler32", @@ -675,9 +675,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -737,9 +737,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "png" -version = "0.17.15" +version = "0.17.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67582bd5b65bdff614270e2ea89a1cf15bef71245cc1e5f7ea126977144211d" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -759,9 +759,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -863,9 +863,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -881,9 +881,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", @@ -892,9 +892,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", @@ -946,9 +946,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.90" +version = "2.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" dependencies = [ "proc-macro2", "quote", From 9b3b345318623b889f4905f1982d3ab3f6763bfa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 Dec 2024 03:03:06 +0100 Subject: [PATCH 21/96] resource: update block types and biomes for 1.21.4 --- CHANGELOG.md | 3 + crates/resource/src/biomes.rs | 7 + crates/resource/src/block_types.rs | 352 ++++++++++++++++++++++++++++- resource/blocks.json | 83 +++++++ src/core/common.rs | 4 +- 5 files changed, 446 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef41795..4837f71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## [Unreleased] - ReleaseDate +- Added support for Minecraft 1.21.4 block types +- Added support for Minecraft 1.21.4 Pale Garden biome + ## [2.2.0] - 2024-06-23 ### Added diff --git a/crates/resource/src/biomes.rs b/crates/resource/src/biomes.rs index 61f8339..4a0dee0 100644 --- a/crates/resource/src/biomes.rs +++ b/crates/resource/src/biomes.rs @@ -188,6 +188,13 @@ pub const BIOMES: &[(&str, Biome)] = { ("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)), + ( + "pale_garden", + Biome::new(0_70, 0_80) + .water([118, 136, 157]) + .foliage([135, 141, 118]) + .grass([119, 130, 114]), + ), ("plains", Biome::new(0_80, 0_40)), ("river", Biome::new(0_50, 0_50)), ("savanna", Biome::new(2_00, 0_00)), diff --git a/crates/resource/src/block_types.rs b/crates/resource/src/block_types.rs index cbfe1b7..4cdc55c 100644 --- a/crates/resource/src/block_types.rs +++ b/crates/resource/src/block_types.rs @@ -1868,7 +1868,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ ConstBlockType { block_color: BlockColor { flags: make_bitflags!(BlockFlag::{Opaque}), - color: Color([47, 23, 28]), + color: Color([45, 22, 27]), }, sign_material: None, }, @@ -1903,6 +1903,16 @@ 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 { @@ -1973,6 +1983,16 @@ 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 { @@ -2283,6 +2303,16 @@ 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 { @@ -6253,6 +6283,16 @@ 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 { @@ -6523,6 +6563,206 @@ 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 { @@ -7213,6 +7453,16 @@ 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 { @@ -7333,6 +7583,16 @@ 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 { @@ -7353,6 +7613,16 @@ 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 { @@ -8193,6 +8463,66 @@ 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 { @@ -9173,6 +9503,26 @@ 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 { diff --git a/resource/blocks.json b/resource/blocks.json index 9d70f96..a88aa34 100644 --- a/resource/blocks.json +++ b/resource/blocks.json @@ -416,6 +416,7 @@ "chiseled_red_sandstone": { "texture": "red_sandstone_top" }, + "chiseled_resin_bricks": {}, "chiseled_sandstone": { "texture": "sandstone_top" }, @@ -427,6 +428,7 @@ "chorus_flower": {}, "chorus_plant": {}, "clay": {}, + "closed_eyeblossom": null, "coal_block": {}, "coal_ore": {}, "coarse_dirt": {}, @@ -482,6 +484,9 @@ "crafting_table": { "texture": "crafting_table_top" }, + "creaking_heart": { + "texture": "creaking_heart_top" + }, "creeper_head": null, "creeper_wall_head": null, "crimson_button": null, @@ -1269,6 +1274,7 @@ "ochre_froglight": { "texture": "ochre_froglight_top" }, + "open_eyeblossom": null, "orange_banner": null, "orange_bed": null, "orange_candle": null, @@ -1308,6 +1314,56 @@ }, "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" }, @@ -1463,6 +1519,9 @@ "potted_cherry_sapling": { "texture": "cherry_sapling" }, + "potted_closed_eyeblossom": { + "texture": "closed_eyeblossom" + }, "potted_cornflower": { "texture": "cornflower" }, @@ -1500,12 +1559,18 @@ "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" }, @@ -1668,6 +1733,18 @@ "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" }, @@ -1903,6 +1980,12 @@ "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" }, diff --git a/src/core/common.rs b/src/core/common.rs index 5f518e0..3dd01cf 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -24,7 +24,7 @@ use crate::{ /// /// 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(2); +pub const REGION_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(3); /// MinedMap map tile data version number /// @@ -36,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(2); +pub const LIGHTMAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(3); /// MinedMap mipmap data version number /// From 83bd936f8073477aa5bae6e059ac84f3430b7623 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 Dec 2024 03:54:45 +0100 Subject: [PATCH 22/96] viewer: add images for pale oak signs --- CHANGELOG.md | 1 + resource/sign_textures.py | 1 + viewer/images/bg/pale_oak_hanging_sign.png | Bin 0 -> 318 bytes viewer/images/bg/pale_oak_hanging_wall_sign.png | Bin 0 -> 222 bytes viewer/images/bg/pale_oak_sign.png | Bin 0 -> 419 bytes viewer/images/bg/pale_oak_wall_sign.png | Bin 0 -> 317 bytes viewer/images/icon/pale_oak_hanging_sign.png | Bin 0 -> 258 bytes viewer/images/icon/pale_oak_hanging_wall_sign.png | Bin 0 -> 320 bytes viewer/images/icon/pale_oak_sign.png | Bin 0 -> 281 bytes viewer/images/icon/pale_oak_wall_sign.png | Bin 0 -> 223 bytes 10 files changed, 2 insertions(+) create mode 100644 viewer/images/bg/pale_oak_hanging_sign.png create mode 100644 viewer/images/bg/pale_oak_hanging_wall_sign.png create mode 100644 viewer/images/bg/pale_oak_sign.png create mode 100644 viewer/images/bg/pale_oak_wall_sign.png create mode 100644 viewer/images/icon/pale_oak_hanging_sign.png create mode 100644 viewer/images/icon/pale_oak_hanging_wall_sign.png create mode 100644 viewer/images/icon/pale_oak_sign.png create mode 100644 viewer/images/icon/pale_oak_wall_sign.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 4837f71..8c7c159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - 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 diff --git a/resource/sign_textures.py b/resource/sign_textures.py index e0b548d..846ab3e 100755 --- a/resource/sign_textures.py +++ b/resource/sign_textures.py @@ -15,6 +15,7 @@ MATERIALS = [ 'jungle', 'mangrove', 'oak', + 'pale_oak', 'spruce', 'warped', ] diff --git a/viewer/images/bg/pale_oak_hanging_sign.png b/viewer/images/bg/pale_oak_hanging_sign.png new file mode 100644 index 0000000000000000000000000000000000000000..972a1198913ddf65b573328cfc63307d83262971 GIT binary patch literal 318 zcmV-E0m1%>P)%F3FNDE~wzKhYBA23wrV&`1=Jf#Zp$WuwfH&STD|)#6tT{GcPl5-b~;Z z_m5BW^ULeZ8Ps)43AWpZbG;|)mU;5AKU^e|*QtOXzblOfW3iEOJ#I_FOEYSzT zUpVYdh1cC%Tm0CsQh7;8!K8{_T>lh?*Dc~VTQ`(AT^<1myfG^Q!k z#f`u?OPD;ib;SxQU|Yw!?={YO5l=A{!&D%QqgrcBqmyO#Q+KdkS2{>B{j(^d!iht1 zq5`5O5Bah3srikCY!-wZjUq5*8 z~;d-IRiu=z4;&+546`%Y^0hY3j=S`-zs?ORwl<24`cXFQcBBdbx( RSqQY5!PC{xWt~$(696plRpI~u literal 0 HcmV?d00001 diff --git a/viewer/images/bg/pale_oak_sign.png b/viewer/images/bg/pale_oak_sign.png new file mode 100644 index 0000000000000000000000000000000000000000..5ea5a7e6992dee3775bc146224c071b067bf3150 GIT binary patch literal 419 zcmV;U0bKrxP)%$w zoHH6(5;u^LrzwIc!l7ER-va<@&U?M#tdS*gL&KhJcjTILn2e$39Hpq>I;Suh>&*?t zRD3H>(_eJ}CS&ky8%2AV$rvEsdt1rd_in1-8;_e!&mw~BF_Z;YwPwvw&&ZOvneupO zhYC}CD^F9DqC(IX>A<0%1j>cJ04DiX5JfHDtpTkuC&drAS zhWsC>yj0ca&H;c$R|5Jr(DS95Os1O59pf7>+oy(_?m0;OgRh zS%G8lzXbds#L97&6VQF4+5&zM!gbD;6953;_m>sWg{3pRdwbOu_y!nc>6`7lvb6vJ N002ovPDHLkV1isf#y$W5 literal 0 HcmV?d00001 diff --git a/viewer/images/bg/pale_oak_wall_sign.png b/viewer/images/bg/pale_oak_wall_sign.png new file mode 100644 index 0000000000000000000000000000000000000000..f52f32a7d94663cf290959191ca6fdc025ff461d GIT binary patch literal 317 zcmV-D0mA-?P)>83qJ{;A-gmpP_HitC<`0Lbnr?2!hy%vlz=xB>ucjpsHR~<-J5Tbv5Im zwU(kRIg53#7XXuUL2g^Cn!1{$IM;e5PtK7T!{i+OFp_09!I*=Gc zt~K4#EHMU#-(V|$`{1S#zIxp6fkc8VH}sv0r7qP-PBnEkA8EXmBZeb>+FDCLj1)^y z8gBIzh%a&ihy1iCOIUo!wcgcN4EBcrobjU`Wch!yn7&uN5x(;OK}^e7{AwLQDp!I~ z26?^`^T`tPxqE!|{P~_GDY~t1c`>*jMsBySwdvNMBmV9`5Qv@-_v8$JT5!{^Nq>~0 P00000NkvXXu0mjf7T1hl literal 0 HcmV?d00001 diff --git a/viewer/images/icon/pale_oak_hanging_sign.png b/viewer/images/icon/pale_oak_hanging_sign.png new file mode 100644 index 0000000000000000000000000000000000000000..cd61dd1dcfbfa1a2e9c06ba831b0a0e61d4f3c5e GIT binary patch literal 258 zcmV+d0sa1oP)s~sIMSIs6%PQAx??cYC*r{F8AN%{saU? zQ8*?TYq3wVEORnSzG<;+sH!TO+BnuC0Qa;G;L%wCW{dg9px12Qv0SaA#1{``$#%aB zqNk}fS7U;9KAzrIZQqe9MN{k0>>B`5rNa55_0a0w+@_v4ps6*RJda}O-`{#Zo(8#$ zS7QK3yw#@Gq)G*AzIj|5Sha2I< zXFYS$=AibxZ9f1QhJkeZ&aJoyV97qy6nz{CzKV)YDcZIr3`6?9rz%QZ zxonqZL_*9sNs<^=v}C?b;y5;LboCeW-G)5Ry|o*c%mXkdZ2*2o4ZzjS_1Q+t^l{|w z;n53hahGL0zrIY+s;MQNQWLX-^KD}!1WhfcW_PlY5Yzfw%DL5p+OIutrlyuWZ8o0o z`nRW6MLEme*eL}-V68T_oIcjZswmHDGpl+Sj60A^tOfwPEW2ovtH8bfKl%k9Xq~a< Sohjh}00006oETfx2tOIl`hn&9^k*{X?B+M*9Z8mDk9q&bfJ8F zH@iyz{io|ii`o2cpi@*T^)M9lnO~n%2T(T+E4{wB3HzYQ_~T|$F9h)Z_WC$ f+5S*B%~j|KBPVsS?i`Z{00000NkvXXu0mjfpwD|G literal 0 HcmV?d00001 diff --git a/viewer/images/icon/pale_oak_wall_sign.png b/viewer/images/icon/pale_oak_wall_sign.png new file mode 100644 index 0000000000000000000000000000000000000000..32257e320475d351df1607727cd8a1774fa5b26a GIT binary patch literal 223 zcmV<503iQ~P)3XJW0001{Nkls!9uU6|U4Lr&^Z}mMlKItPl#cbsJtlqof6vRBs=f>y$|kLU ZhF(rdXtH}uT$%s?002ovPDHLkV1i-1UO@l= literal 0 HcmV?d00001 From 00216341ca27d297697014a255642e88d703dd6c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 Dec 2024 12:58:47 +0100 Subject: [PATCH 23/96] resource: separate current biome data from aliases/legacy IDs Prepare for automatic generation of current biome data. --- crates/resource/src/biomes.rs | 311 +-------------------------- crates/resource/src/legacy_biomes.rs | 202 +++++++++++++++++ crates/resource/src/lib.rs | 110 +++++++++- 3 files changed, 311 insertions(+), 312 deletions(-) create mode 100644 crates/resource/src/legacy_biomes.rs diff --git a/crates/resource/src/biomes.rs b/crates/resource/src/biomes.rs index 4a0dee0..d81a069 100644 --- a/crates/resource/src/biomes.rs +++ b/crates/resource/src/biomes.rs @@ -1,112 +1,6 @@ -//! Biome data structures +//! Biome data -use serde::{Deserialize, Serialize}; - -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) - } -} +use super::*; /// Standard biome specifications pub const BIOMES: &[(&str, Biome)] = { @@ -241,204 +135,3 @@ pub const BIOMES: &[(&str, Biome)] = { ("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"), - ( - "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_biomes.rs b/crates/resource/src/legacy_biomes.rs new file mode 100644 index 0000000..d980823 --- /dev/null +++ b/crates/resource/src/legacy_biomes.rs @@ -0,0 +1,202 @@ +//! 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/lib.rs b/crates/resource/src/lib.rs index 1baffda..b499fbf 100644 --- a/crates/resource/src/lib.rs +++ b/crates/resource/src/lib.rs @@ -4,6 +4,7 @@ mod biomes; mod block_color; +mod legacy_biomes; mod legacy_block_types; #[allow(clippy::missing_docs_in_private_items)] // Generated module @@ -135,9 +136,112 @@ 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, 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) + } +} + /// Used to look up standard Minecraft biome types #[derive(Debug)] pub struct BiomeTypes { @@ -154,7 +258,7 @@ impl Default for BiomeTypes { .map(|(k, v)| (String::from(*k), v)) .collect(); - for &(old, new) in biomes::BIOME_ALIASES.iter().rev() { + for &(old, new) in legacy_biomes::BIOME_ALIASES.iter().rev() { let biome = biome_map .get(new) .copied() @@ -164,7 +268,7 @@ impl Default for BiomeTypes { let legacy_biomes = (0..=255) .map(|index| { - let id = biomes::legacy_biome(index); + let id = legacy_biomes::legacy_biome(index); *biome_map.get(id).expect("Unknown legacy biome") }) .collect::>() From 7b98954c8092ac150a21f8c2073c33b1a2f422e0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 Dec 2024 13:05:47 +0100 Subject: [PATCH 24/96] resource: add comments to generated file --- crates/resource/src/block_types.rs | 5 +++++ crates/resource/src/lib.rs | 4 +--- resource/generate.py | 5 +++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/resource/src/block_types.rs b/crates/resource/src/block_types.rs index 4cdc55c..53abd54 100644 --- a/crates/resource/src/block_types.rs +++ b/crates/resource/src/block_types.rs @@ -1,7 +1,12 @@ +//! 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", diff --git a/crates/resource/src/lib.rs b/crates/resource/src/lib.rs index b499fbf..1afcc62 100644 --- a/crates/resource/src/lib.rs +++ b/crates/resource/src/lib.rs @@ -4,12 +4,10 @@ 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 enumflags2::{bitflags, BitFlags}; diff --git a/resource/generate.py b/resource/generate.py index 8064482..ab91324 100755 --- a/resource/generate.py +++ b/resource/generate.py @@ -14,10 +14,15 @@ 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(): From 8f408e78a0dabcb2cc0b0aa0295bdb6d24f1705f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 Dec 2024 13:51:55 +0100 Subject: [PATCH 25/96] resource: codegen biome list --- crates/resource/src/biomes.rs | 246 ++++++++++++++++------------------ resource/README.md | 15 ++- resource/biomes.py | 70 ++++++++++ 3 files changed, 197 insertions(+), 134 deletions(-) create mode 100755 resource/biomes.py diff --git a/crates/resource/src/biomes.rs b/crates/resource/src/biomes.rs index d81a069..55c5e74 100644 --- a/crates/resource/src/biomes.rs +++ b/crates/resource/src/biomes.rs @@ -1,137 +1,117 @@ //! Biome data +//! +//! This file is generated using resource/biomes.py, do not edit use super::*; +use BiomeGrassColorModifier::*; -/// 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)), - ( - "pale_garden", - Biome::new(0_70, 0_80) - .water([118, 136, 157]) - .foliage([135, 141, 118]) - .grass([119, 130, 114]), - ), - ("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)), - ] -}; +/// List if known biomes and their properties +pub const BIOMES: &[(&str, Biome)] = &[ + ( + "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]), + ), +]; diff --git a/resource/README.md b/resource/README.md index ab9d5ea..12302ec 100644 --- a/resource/README.md +++ b/resource/README.md @@ -11,13 +11,15 @@ 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 of a new Minecraft version +## How to add support for block IDs and biomes 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 @@ -69,6 +71,17 @@ 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 new file mode 100755 index 0000000..4e3bc51 --- /dev/null +++ b/resource/biomes.py @@ -0,0 +1,70 @@ +#!/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) From 00237101f26407f4d29fd497aa621f27cad1833c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 Dec 2024 12:15:45 +0100 Subject: [PATCH 26/96] README.md: update for 1.21.4 support --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2312c03..4c684f9 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 (no mod installation necessary!) +* Compatible with unmodified Minecraft Java Edition 1.8 up to 1.21.4 (no mod installation required!) * 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 From 941cd16337ee153407139fec73d78f964339a0d7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jan 2025 13:41:56 +0100 Subject: [PATCH 27/96] minedmap-resource 0.5.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/resource/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ff64b60..b7a3740 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -610,7 +610,7 @@ dependencies = [ [[package]] name = "minedmap-resource" -version = "0.4.0" +version = "0.5.0" dependencies = [ "enumflags2", "glam", diff --git a/Cargo.toml b/Cargo.toml index ddf24ba..ad65c83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ image = { version = "0.25.1", 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.4.0", path = "crates/resource" } +minedmap-resource = { version = "0.5.0", path = "crates/resource" } minedmap-types = { version = "0.1.2", path = "crates/types" } num-integer = "0.1.45" num_cpus = "1.16.0" diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index de9b577..58e1da2 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-resource" -version = "0.4.0" +version = "0.5.0" description = "Data describing Minecraft biomes and block types" edition.workspace = true license.workspace = true From 650cd23198db1ba38d84510519e9cc3a82ae6b1f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jan 2025 13:42:11 +0100 Subject: [PATCH 28/96] minedmap 2.3.0 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c7c159..ab33e93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] - ReleaseDate +## [2.3.0] - 2025-01-02 + - 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 @@ -99,7 +101,8 @@ intermediate data. Full support for custom biomes datapacks might be added in a future release. -[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.2.0...HEAD +[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.3.0...HEAD +[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 [2.1.0]: https://github.com/neocturne/MinedMap/compare/v2.0.2...v2.1.0 diff --git a/Cargo.lock b/Cargo.lock index b7a3740..c18929f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -567,7 +567,7 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minedmap" -version = "2.2.0" +version = "2.3.0" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index ad65c83..e2f36b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ pre-release-commit-message = "{{crate_name}} {{version}}" [package] name = "minedmap" -version = "2.2.0" +version = "2.3.0" description = "Generate browsable maps from Minecraft save data" edition.workspace = true license.workspace = true From 7f329ac8e73ef7f7d13ff842026b5397b7fa8f0a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 6 Jan 2025 20:30:17 +0100 Subject: [PATCH 29/96] CHANGELOG.md: fix heading for previous release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab33e93..4c9847e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ## [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 From 9375af8d54d13f40932579ba0e11fbabc0375bb8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 6 Jan 2025 20:27:01 +0100 Subject: [PATCH 30/96] resource: impl Ord for Color Allow using Color in FormattedText. --- crates/resource/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/resource/src/lib.rs b/crates/resource/src/lib.rs index 1afcc62..fed9514 100644 --- a/crates/resource/src/lib.rs +++ b/crates/resource/src/lib.rs @@ -38,7 +38,7 @@ pub enum BlockFlag { } /// An RGB color with u8 components -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub struct Color(pub [u8; 3]); /// An RGB color with f32 components From ff6e28d381574fecc0a10466faf35c60a9efd756 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 6 Jan 2025 21:16:41 +0100 Subject: [PATCH 31/96] world, viewer: fix sign text colors - 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. Dyed signs use different color names. 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. --- CHANGELOG.md | 11 ++++++ Cargo.lock | 64 ++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/core/common.rs | 2 +- src/world/json_text.rs | 89 ++++++++++++++++++++++++++++++++++++++++-- src/world/sign.rs | 29 +++++++++++++- viewer/MinedMap.js | 23 ++--------- 7 files changed, 192 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c9847e..aabf1f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ ## [Unreleased] - ReleaseDate +### 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. Dyed signs use different +color names. + +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 diff --git a/Cargo.lock b/Cargo.lock index c18929f..90a9b7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -584,6 +584,7 @@ dependencies = [ "minedmap-types", "num-integer", "num_cpus", + "phf", "rayon", "regex", "rustc-hash", @@ -717,6 +718,48 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -766,6 +809,21 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + [[package]] name = "rayon" version = "1.10.0" @@ -923,6 +981,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" diff --git a/Cargo.toml b/Cargo.toml index e2f36b6..287ac4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,6 +52,7 @@ minedmap-resource = { version = "0.5.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.11.2", features = ["macros"] } rayon = "1.7.0" regex = "1.10.2" rustc-hash = "2.0.0" diff --git a/src/core/common.rs b/src/core/common.rs index 3dd01cf..be6d28a 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -46,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(0); +pub const ENTITIES_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(1); /// Coordinate pair of a generated tile /// diff --git a/src/world/json_text.rs b/src/world/json_text.rs index a153179..fa18527 100644 --- a/src/world/json_text.rs +++ b/src/world/json_text.rs @@ -1,7 +1,8 @@ //! Newtype and helper methods for handling Minecraft Raw JSON Text -use std::{collections::VecDeque, fmt::Display, sync::Arc}; +use std::{collections::VecDeque, fmt::Display}; +use minedmap_resource::Color; use serde::{Deserialize, Serialize}; /// A span of formatted text @@ -17,8 +18,8 @@ pub struct FormattedText { /// Text content pub text: String, /// Text color - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option>, + #[serde(skip_serializing_if = "Option::is_none", with = "json_color")] + pub color: Option, /// Bold formatting #[serde(skip_serializing_if = "Option::is_none")] pub bold: Option, @@ -41,7 +42,7 @@ impl FormattedText { pub fn inherit(self, parent: &Self) -> Self { FormattedText { text: self.text, - color: self.color.or_else(|| parent.color.clone()), + color: self.color.or(parent.color), bold: self.bold.or(parent.bold), italic: self.italic.or(parent.italic), underlined: self.underlined.or(parent.underlined), @@ -175,3 +176,83 @@ impl JSONText { serde_json::from_str(&self.0).unwrap_or_default() } } + +mod json_color { + //! Helpers for serializing and deserializing [FormattedText](super::FormattedText) colors + + use minedmap_resource::Color; + use serde::{ + de::{self, Visitor}, + ser::Error as _, + Deserializer, Serializer, + }; + + /// Named JSON 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) + } +} diff --git a/src/world/sign.rs b/src/world/sign.rs index 57b741a..eff319f 100644 --- a/src/world/sign.rs +++ b/src/world/sign.rs @@ -1,7 +1,8 @@ //! Processing of sign text -use std::{fmt::Display, sync::Arc}; +use std::fmt::Display; +use minedmap_resource::Color; use serde::{Deserialize, Serialize}; use super::{ @@ -23,10 +24,34 @@ pub struct RawSignText<'a> { 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<'_> { /// Decodes the [RawSignText] into a [SignText] pub fn decode(&self) -> SignText { - let color = self.color.map(|c| Arc::new(c.to_owned())); + let color = self + .color + .map(|c| DYE_COLORS.get(c).copied().unwrap_or(DEFAULT_COLOR)); let parent = FormattedText { color, ..Default::default() diff --git a/viewer/MinedMap.js b/viewer/MinedMap.js index e784eec..cfcccf1 100644 --- a/viewer/MinedMap.js +++ b/viewer/MinedMap.js @@ -153,25 +153,6 @@ 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'; @@ -180,7 +161,9 @@ function formatSignLine(line) { const child = document.createElement('span'); child.textContent = span.text; - const color = colors[span.color ?? 'black'] || colors['black']; + let color = span.color ?? ''; + if (color[0] !== '#') + color = '#000000'; if (span.bold) child.style.fontWeight = 'bold'; From a67bdb3b67dc1b576b9aeb77bd93605955da21ab Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 6 Jan 2025 21:25:20 +0100 Subject: [PATCH 32/96] minedmap-resource 0.6.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/resource/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90a9b7a..e616496 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -611,7 +611,7 @@ dependencies = [ [[package]] name = "minedmap-resource" -version = "0.5.0" +version = "0.6.0" dependencies = [ "enumflags2", "glam", diff --git a/Cargo.toml b/Cargo.toml index 287ac4c..f3a3798 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ image = { version = "0.25.1", 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.5.0", path = "crates/resource" } +minedmap-resource = { version = "0.6.0", path = "crates/resource" } minedmap-types = { version = "0.1.2", path = "crates/types" } num-integer = "0.1.45" num_cpus = "1.16.0" diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index 58e1da2..4e0d512 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-resource" -version = "0.5.0" +version = "0.6.0" description = "Data describing Minecraft biomes and block types" edition.workspace = true license.workspace = true From f9954d1ce4e8dd25802c64bd36b6baccad0e8a42 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 6 Jan 2025 21:25:29 +0100 Subject: [PATCH 33/96] minedmap 2.3.1 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aabf1f1..4a18819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] - ReleaseDate +## [2.3.1] - 2025-01-06 + ### Fixed - Fix text colors for signs modified using dye @@ -114,7 +116,8 @@ intermediate data. Full support for custom biomes datapacks might be added in a future release. -[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.3.0...HEAD +[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.3.1...HEAD +[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 diff --git a/Cargo.lock b/Cargo.lock index e616496..cbd4110 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -567,7 +567,7 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minedmap" -version = "2.3.0" +version = "2.3.1" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index f3a3798..6a6a300 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ pre-release-commit-message = "{{crate_name}} {{version}}" [package] name = "minedmap" -version = "2.3.0" +version = "2.3.1" description = "Generate browsable maps from Minecraft save data" edition.workspace = true license.workspace = true From b9cd94b235523d982d5a35895aa27f2b8d54a7f5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 6 Jan 2025 22:31:56 +0100 Subject: [PATCH 34/96] CHANGELOG.md: remove reference to Minecraft internals Remove a sentence that refers to internal color names, as the information is more confusing than helpful in a user-facing changlog. --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a18819..1b5dd97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,7 @@ - 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. Dyed signs use different -color names. +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. From 52572a9e81cef19d8427a54a538aaf55891e2af0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 9 Jan 2025 20:55:37 +0100 Subject: [PATCH 35/96] Update dependencies --- Cargo.lock | 68 ++++++++++++++++++++--------------------- crates/types/Cargo.toml | 2 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cbd4110..87d4135 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,9 +149,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.2.6" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "jobserver", "libc", @@ -172,9 +172,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -182,9 +182,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -195,9 +195,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", @@ -484,9 +484,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -520,9 +520,9 @@ checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libz-ng-sys" -version = "1.1.20" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0f7295a34685977acb2e8cc8b08ee4a8dffd6cf278eeccddbe1ed55ba815d5" +checksum = "7cee1488e961a80d172564fd6fcda11d8a4ac6672c06fe008e9213fa60520c2b" dependencies = [ "cmake", "libc", @@ -530,9 +530,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "lock_api" @@ -720,9 +720,9 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -730,9 +730,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", @@ -740,9 +740,9 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", @@ -753,18 +753,18 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -896,9 +896,9 @@ checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ "bitflags 2.6.0", "errno", @@ -950,9 +950,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.134" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa", "memchr", @@ -983,9 +983,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "siphasher" -version = "0.3.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" @@ -1010,9 +1010,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.93" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", @@ -1041,9 +1041,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "parking_lot", diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index 6a81414..1146195 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -8,5 +8,5 @@ readme.workspace = true repository.workspace = true [dependencies] -itertools = "0.13.0" +itertools = "0.14.0" serde = { version = "1.0.183", features = ["derive"] } From 28a191a23af16a6e82c62a4ac4a58051203ef900 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 9 Jan 2025 21:09:48 +0100 Subject: [PATCH 36/96] resource: ignore array size clippy warning The const is used only once, so there is no reason not to inline it. --- crates/resource/src/legacy_block_types.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/resource/src/legacy_block_types.rs b/crates/resource/src/legacy_block_types.rs index c027ac3..0c4814d 100644 --- a/crates/resource/src/legacy_block_types.rs +++ b/crates/resource/src/legacy_block_types.rs @@ -13,6 +13,7 @@ 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"), From c23b53a8c3de7c0eefb6a3b0775ea15b8c24bbcc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Jan 2025 01:24:58 +0100 Subject: [PATCH 37/96] core, viewer: add support for WebP output WebP can be selected by passing `--image-format webp` on the command line. For typical Minecraft worlds, this results in a size reduction of 10-15% without increasing processing time. --- CHANGELOG.md | 4 ++++ Cargo.lock | 17 +++++++++++++++++ Cargo.toml | 2 +- README.md | 11 ++++++++++- src/core/common.rs | 31 ++++++++++++++++++++++++++++++- src/core/metadata_writer.rs | 3 +++ src/core/mod.rs | 5 ++++- src/core/region_processor.rs | 5 ++++- src/core/tile_mipmapper.rs | 2 +- src/core/tile_renderer.rs | 2 +- viewer/MinedMap.js | 10 ++++++---- 11 files changed, 81 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b5dd97..dbd71f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] - ReleaseDate +### Added + +- Added support for rendering tiles WebP format using the `--image-format` option + ## [2.3.1] - 2025-01-06 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 87d4135..970c1be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -461,10 +461,21 @@ checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" dependencies = [ "bytemuck", "byteorder-lite", + "image-webp", "num-traits", "png", ] +[[package]] +name = "image-webp" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e031e8e3d94711a9ccb5d6ea357439ef3dcbed361798bd4071dc4d9793fbe22f" +dependencies = [ + "byteorder-lite", + "quick-error", +] + [[package]] name = "indexmap" version = "2.7.0" @@ -800,6 +811,12 @@ 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.38" diff --git a/Cargo.toml b/Cargo.toml index 6a6a300..c4bfdcb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ enum-map = "2.7.3" fastnbt = "2.3.2" futures-util = "0.3.28" git-version = "0.3.5" -image = { version = "0.25.1", default-features = false, features = ["png"] } +image = { version = "0.25.1", default-features = false, features = ["png", "webp"] } indexmap = { version = "2.0.0", features = ["serde"] } lru = "0.12.0" minedmap-nbt = { version = "0.1.1", path = "crates/nbt", default-features = false } diff --git a/README.md b/README.md index 4c684f9..1ea4856 100644 --- a/README.md +++ b/README.md @@ -55,9 +55,18 @@ a proper webserver like [nginx](https://nginx.org/) or upload the viewer togethe 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 that is only used locally to allow processing +`/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 10-15% +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) diff --git a/src/core/common.rs b/src/core/common.rs index be6d28a..b933dcd 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -7,6 +7,7 @@ use std::{ }; use anyhow::{Context, Result}; +use clap::ValueEnum; use indexmap::IndexSet; use regex::{Regex, RegexSet}; use serde::{Deserialize, Serialize}; @@ -150,6 +151,8 @@ 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 @@ -189,6 +192,7 @@ impl Config { entities_path_final, viewer_info_path, viewer_entities_path, + image_format: args.image_format, sign_patterns, sign_transforms, }) @@ -264,14 +268,39 @@ impl Config { [&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, "png"); + let filename = coord_filename(coords, self.tile_extension()); 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/metadata_writer.rs b/src/core/metadata_writer.rs index 0ea1f65..92d8566 100644 --- a/src/core/metadata_writer.rs +++ b/src/core/metadata_writer.rs @@ -61,6 +61,8 @@ struct Metadata<'t> { spawn: Spawn, /// Enabled MinedMap features features: Features, + /// Format of generated map tiles + tile_extension: &'static str, } /// Viewer entity JSON data structure @@ -205,6 +207,7 @@ 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 f552ffa..5832379 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -16,7 +16,7 @@ use anyhow::{Context, Result}; use clap::Parser; use git_version::git_version; -use common::Config; +use common::{Config, ImageFormat}; use metadata_writer::MetadataWriter; use region_processor::RegionProcessor; use tile_mipmapper::TileMipmapper; @@ -47,6 +47,9 @@ pub struct Args { /// Enable verbose messages #[arg(short, long)] pub verbose: bool, + /// 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, diff --git a/src/core/region_processor.rs b/src/core/region_processor.rs index ce2d060..e448f5e 100644 --- a/src/core/region_processor.rs +++ b/src/core/region_processor.rs @@ -79,6 +79,8 @@ struct SingleRegionProcessor<'a> { lightmap: image::GrayAlphaImage, /// Processed entity intermediate data entities: ProcessedEntities, + /// Format of generated map tiles + image_format: image::ImageFormat, /// True if any unknown block or biome types were encountered during processing has_unknown: bool, } @@ -127,6 +129,7 @@ impl<'a> SingleRegionProcessor<'a> { processed_region, lightmap, entities, + image_format: processor.config.tile_image_format(), has_unknown: false, }) } @@ -179,7 +182,7 @@ impl<'a> SingleRegionProcessor<'a> { self.input_timestamp, |file| { self.lightmap - .write_to(file, image::ImageFormat::Png) + .write_to(file, self.image_format) .context("Failed to save image") }, ) diff --git a/src/core/tile_mipmapper.rs b/src/core/tile_mipmapper.rs index d7e54a9..2eda0e9 100644 --- a/src/core/tile_mipmapper.rs +++ b/src/core/tile_mipmapper.rs @@ -144,7 +144,7 @@ where } image - .write_to(file, image::ImageFormat::Png) + .write_to(file, self.config.tile_image_format()) .context("Failed to save image") } } diff --git a/src/core/tile_renderer.rs b/src/core/tile_renderer.rs index 09ad8a1..a972b78 100644 --- a/src/core/tile_renderer.rs +++ b/src/core/tile_renderer.rs @@ -304,7 +304,7 @@ impl<'a> TileRenderer<'a> { processed_timestamp, |file| { image - .write_to(file, image::ImageFormat::Png) + .write_to(file, self.config.tile_image_format()) .context("Failed to save image") }, )?; diff --git a/viewer/MinedMap.js b/viewer/MinedMap.js index cfcccf1..61188b1 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) { + initialize: function (mipmaps, layer, tile_extension) { L.TileLayer.prototype.initialize.call(this, '', { detectRetina: true, tileSize: 512, @@ -88,6 +88,7 @@ const MinedMapLayer = L.TileLayer.extend({ this.mipmaps = mipmaps; this.layer = layer; + this.ext = tile_extension; }, createTile: function (coords, done) { @@ -112,7 +113,7 @@ const MinedMapLayer = L.TileLayer.extend({ return L.Util.emptyImageUrl; - return 'data/'+this.layer+'/'+z+'/r.'+coords.x+'.'+coords.y+'.png'; + return `data/${this.layer}/${z}/r.${coords.x}.${coords.y}.${this.ext}`; }, }); @@ -332,6 +333,7 @@ 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(); @@ -369,10 +371,10 @@ window.createMap = function () { const overlayMaps = {}; - const mapLayer = new MinedMapLayer(mipmaps, 'map'); + const mapLayer = new MinedMapLayer(mipmaps, 'map', tile_extension); mapLayer.addTo(map); - const lightLayer = new MinedMapLayer(mipmaps, 'light'); + const lightLayer = new MinedMapLayer(mipmaps, 'light', tile_extension); overlayMaps['Illumination'] = lightLayer; if (params.light) map.addLayer(lightLayer); From 6763e2b4ec8ac8c02f6256f9619983c01157ac05 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Jan 2025 01:42:42 +0100 Subject: [PATCH 38/96] Update dependencies --- Cargo.lock | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 151 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 970c1be..e902fc1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,9 +125,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" [[package]] name = "bytemuck" @@ -313,6 +313,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "erased-serde" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +dependencies = [ + "serde", + "typeid", +] + [[package]] name = "errno" version = "0.3.10" @@ -557,9 +567,12 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "3d6ea2a48c204030ee31a7d7fc72c93294c92fe87ecb1789881c9543516e1a0d" +dependencies = [ + "value-bag", +] [[package]] name = "lru" @@ -867,7 +880,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -917,7 +930,7 @@ version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "errno", "libc", "linux-raw-sys", @@ -965,6 +978,15 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_fmt" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" +dependencies = [ + "serde", +] + [[package]] name = "serde_json" version = "1.0.135" @@ -1026,10 +1048,88 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "syn" -version = "2.0.95" +name = "sval" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8" + +[[package]] +name = "sval_buffer" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f" +dependencies = [ + "sval", + "sval_ref", +] + +[[package]] +name = "sval_dynamic" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_fmt" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_json" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_nested" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f" +dependencies = [ + "sval", + "sval_buffer", + "sval_ref", +] + +[[package]] +name = "sval_ref" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_serde" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a" +dependencies = [ + "serde", + "sval", + "sval_nested", +] + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -1124,6 +1224,12 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "typeid" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" + [[package]] name = "unicode-ident" version = "1.0.14" @@ -1142,6 +1248,42 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "value-bag" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" +dependencies = [ + "value-bag-serde1", + "value-bag-sval2", +] + +[[package]] +name = "value-bag-serde1" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b" +dependencies = [ + "erased-serde", + "serde", + "serde_fmt", +] + +[[package]] +name = "value-bag-sval2" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a" +dependencies = [ + "sval", + "sval_buffer", + "sval_dynamic", + "sval_fmt", + "sval_json", + "sval_ref", + "sval_serde", +] + [[package]] name = "winapi" version = "0.3.9" From a2f0ad401d967e2ab56f4ce7ee2c5cccf045dc40 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Jan 2025 01:51:35 +0100 Subject: [PATCH 39/96] CHANGELOG.md: fix missing word --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbd71f8..c1bd945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Added -- Added support for rendering tiles WebP format using the `--image-format` option +- Added support for rendering tiles in WebP format using the `--image-format` option ## [2.3.1] - 2025-01-06 From 0bf1d46aad47fd184636f57b636104c91bd727b6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Jan 2025 01:53:05 +0100 Subject: [PATCH 40/96] minedmap-types 0.1.4 --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/nbt/Cargo.toml | 2 +- crates/types/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e902fc1..9aeb667 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -644,7 +644,7 @@ dependencies = [ [[package]] name = "minedmap-types" -version = "0.1.3" +version = "0.1.4" dependencies = [ "itertools", "serde", diff --git a/Cargo.toml b/Cargo.toml index c4bfdcb..a143c78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ 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.6.0", path = "crates/resource" } -minedmap-types = { version = "0.1.2", path = "crates/types" } +minedmap-types = { version = "0.1.4", path = "crates/types" } num-integer = "0.1.45" num_cpus = "1.16.0" phf = { version = "0.11.2", features = ["macros"] } diff --git a/crates/nbt/Cargo.toml b/crates/nbt/Cargo.toml index 2c817c6..9f815da 100644 --- a/crates/nbt/Cargo.toml +++ b/crates/nbt/Cargo.toml @@ -12,7 +12,7 @@ anyhow = "1.0.75" bytemuck = "1.13.1" fastnbt = "2.4.4" flate2 = "1.0.27" -minedmap-types = { version = "0.1.2", path = "../types" } +minedmap-types = { version = "0.1.4", path = "../types" } serde = "1.0.183" [features] diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index 1146195..c5bd47e 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-types" -version = "0.1.3" +version = "0.1.4" description = "Common types used by several MinedMap crates" edition.workspace = true license.workspace = true From 561a1e6577a48663224bd7c30352d324a4e91b83 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Jan 2025 01:54:53 +0100 Subject: [PATCH 41/96] minedmap 2.4.0 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1bd945..e75a75b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] - ReleaseDate +## [2.4.0] - 2025-01-11 + ### Added - Added support for rendering tiles in WebP format using the `--image-format` option @@ -119,7 +121,8 @@ intermediate data. Full support for custom biomes datapacks might be added in a future release. -[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.3.1...HEAD +[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.4.0...HEAD +[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 diff --git a/Cargo.lock b/Cargo.lock index 9aeb667..5b6de78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -591,7 +591,7 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minedmap" -version = "2.3.1" +version = "2.4.0" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index a143c78..2412edb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ pre-release-commit-message = "{{crate_name}} {{version}}" [package] name = "minedmap" -version = "2.3.1" +version = "2.4.0" description = "Generate browsable maps from Minecraft save data" edition.workspace = true license.workspace = true From d7fc95c950e4f211785bdbfcd6364f60e9085763 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Jan 2025 02:10:00 +0100 Subject: [PATCH 42/96] README.md: fix size reduction estimate for WebP tiles I accidentally measured the output size including the `processed` directory for the previous numbers. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ea4856..7d60f78 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ 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 10-15% +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 From a10151a4f37775d76150f03cc94dd32bd4c4705c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 11 Feb 2025 22:39:11 +0100 Subject: [PATCH 43/96] resource, world: implement fallback to plains for unknown biomes Closes #63 --- CHANGELOG.md | 6 ++++++ crates/resource/src/lib.rs | 11 +++++++++++ src/core/common.rs | 2 +- src/world/layer.rs | 16 ++++++++-------- src/world/section.rs | 20 +++++++++++--------- 5 files changed, 37 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e75a75b..7745ced 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] - ReleaseDate +### 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 + ## [2.4.0] - 2025-01-11 ### Added diff --git a/crates/resource/src/lib.rs b/crates/resource/src/lib.rs index fed9514..a633d06 100644 --- a/crates/resource/src/lib.rs +++ b/crates/resource/src/lib.rs @@ -247,6 +247,8 @@ 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 { @@ -273,9 +275,12 @@ impl Default for BiomeTypes { .try_into() .unwrap(); + let fallback_biome = *biome_map.get("plains").expect("Plains biome undefined"); + Self { biome_map, legacy_biomes, + fallback_biome, } } } @@ -293,4 +298,10 @@ 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/src/core/common.rs b/src/core/common.rs index b933dcd..edefcb3 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -25,7 +25,7 @@ use crate::{ /// /// 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(3); +pub const REGION_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(4); /// MinedMap map tile data version number /// diff --git a/src/world/layer.rs b/src/world/layer.rs index 0764711..e59593c 100644 --- a/src/world/layer.rs +++ b/src/world/layer.rs @@ -97,14 +97,14 @@ impl LayerEntry<'_> { if self.is_empty() { *self.block = Some(block_type.block_color); - 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"), - ); - } + + 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 block_type.block_color.is(BlockFlag::Water) { diff --git a/src/world/section.rs b/src/world/section.rs index 7988fd5..845ddae 100644 --- a/src/world/section.rs +++ b/src/world/section.rs @@ -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>; + fn biome_at(&self, section: SectionY, coords: SectionBlockCoords) -> Result<&Biome>; } /// 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>, + palette: Vec<&'a Biome>, /// Number of bits used for each entry in *biomes* bits: u8, } @@ -253,12 +253,11 @@ impl<'a> BiomesV1_18<'a> { let palette_types = palette .iter() .map(|entry| { - let biome_type = biome_types.get(entry); - if biome_type.is_none() { + biome_types.get(entry).unwrap_or_else(|| { debug!("Unknown biome type: {}", entry); has_unknown = true; - } - biome_type + biome_types.get_fallback() + }) }) .collect(); @@ -295,7 +294,7 @@ impl<'a> BiomesV1_18<'a> { } impl Biomes for BiomesV1_18<'_> { - fn biome_at(&self, _section: SectionY, coords: SectionBlockCoords) -> Result> { + fn biome_at(&self, _section: SectionY, coords: SectionBlockCoords) -> Result<&Biome> { let index = self.palette_index_at(coords); Ok(*self .palette @@ -350,7 +349,7 @@ impl<'a> BiomesV0<'a> { } impl Biomes for BiomesV0<'_> { - fn biome_at(&self, section: SectionY, coords: SectionBlockCoords) -> Result> { + fn biome_at(&self, section: SectionY, coords: SectionBlockCoords) -> Result<&Biome> { let id = match self.data { BiomesV0Data::IntArrayV15(data) => { let LayerBlockCoords { x, z } = coords.xz; @@ -370,7 +369,10 @@ impl Biomes for BiomesV0<'_> { } BiomesV0Data::ByteArray(data) => data[coords.xz.offset()] as u8, }; - Ok(self.biome_types.get_legacy(id)) + Ok(self + .biome_types + .get_legacy(id) + .unwrap_or(self.biome_types.get_fallback())) } } From 0dd36a409a84438afd1e7bc768d5619ae3ff6053 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 11 Feb 2025 23:03:33 +0100 Subject: [PATCH 44/96] Update dependencies Signed-off-by: Matthias Schiffer --- Cargo.lock | 239 +++++++++++------------------------------------------ Cargo.toml | 2 +- 2 files changed, 50 insertions(+), 191 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b6de78..317eb46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,11 +73,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys", ] @@ -125,9 +126,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bytemuck" @@ -149,9 +150,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.2.7" +version = "1.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" dependencies = [ "jobserver", "libc", @@ -172,9 +173,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.26" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" +checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" dependencies = [ "clap_builder", "clap_derive", @@ -182,9 +183,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.26" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" +checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" dependencies = [ "anstream", "anstyle", @@ -195,9 +196,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ "heck", "proc-macro2", @@ -213,9 +214,9 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "cmake" -version = "0.1.52" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" dependencies = [ "cc", ] @@ -288,9 +289,9 @@ dependencies = [ [[package]] name = "enumflags2" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ "enumflags2_derive", "serde", @@ -298,9 +299,9 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", @@ -313,16 +314,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "erased-serde" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" -dependencies = [ - "serde", - "typeid", -] - [[package]] name = "errno" version = "0.3.10" @@ -478,9 +469,9 @@ dependencies = [ [[package]] name = "image-webp" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e031e8e3d94711a9ccb5d6ea357439ef3dcbed361798bd4071dc4d9793fbe22f" +checksum = "b77d01e822461baa8409e156015a1d91735549f0f2c17691bd2d996bef238f7f" dependencies = [ "byteorder-lite", "quick-error", @@ -488,9 +479,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown", @@ -567,18 +558,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.24" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6ea2a48c204030ee31a7d7fc72c93294c92fe87ecb1789881c9543516e1a0d" -dependencies = [ - "value-bag", -] +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "lru" -version = "0.12.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +checksum = "227748d55f2f0ab4735d87fd623798cb6b664512fe979705f829c9f81c934465" dependencies = [ "hashbrown", ] @@ -652,9 +640,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" dependencies = [ "adler2", "simd-adler32", @@ -709,9 +697,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "overload" @@ -817,9 +805,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -880,7 +868,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", ] [[package]] @@ -920,17 +908,17 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustix" -version = "0.38.43" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "errno", "libc", "linux-raw-sys", @@ -939,9 +927,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "scopeguard" @@ -978,20 +966,11 @@ dependencies = [ "syn", ] -[[package]] -name = "serde_fmt" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" -dependencies = [ - "serde", -] - [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -1047,89 +1026,11 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "sval" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8" - -[[package]] -name = "sval_buffer" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f" -dependencies = [ - "sval", - "sval_ref", -] - -[[package]] -name = "sval_dynamic" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4" -dependencies = [ - "sval", -] - -[[package]] -name = "sval_fmt" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94" -dependencies = [ - "itoa", - "ryu", - "sval", -] - -[[package]] -name = "sval_json" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155" -dependencies = [ - "itoa", - "ryu", - "sval", -] - -[[package]] -name = "sval_nested" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f" -dependencies = [ - "sval", - "sval_buffer", - "sval_ref", -] - -[[package]] -name = "sval_ref" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa" -dependencies = [ - "sval", -] - -[[package]] -name = "sval_serde" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a" -dependencies = [ - "serde", - "sval", - "sval_nested", -] - [[package]] name = "syn" -version = "2.0.96" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -1224,17 +1125,11 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "typeid" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" - [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "utf8parse" @@ -1244,45 +1139,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "value-bag" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" -dependencies = [ - "value-bag-serde1", - "value-bag-sval2", -] - -[[package]] -name = "value-bag-serde1" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b" -dependencies = [ - "erased-serde", - "serde", - "serde_fmt", -] - -[[package]] -name = "value-bag-sval2" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a" -dependencies = [ - "sval", - "sval_buffer", - "sval_dynamic", - "sval_fmt", - "sval_json", - "sval_ref", - "sval_serde", -] +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "winapi" diff --git a/Cargo.toml b/Cargo.toml index 2412edb..b821d83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ futures-util = "0.3.28" git-version = "0.3.5" image = { version = "0.25.1", default-features = false, features = ["png", "webp"] } indexmap = { version = "2.0.0", features = ["serde"] } -lru = "0.12.0" +lru = "0.13.0" minedmap-nbt = { version = "0.1.1", path = "crates/nbt", default-features = false } minedmap-resource = { version = "0.6.0", path = "crates/resource" } minedmap-types = { version = "0.1.4", path = "crates/types" } From d96bb727f72ed6536c183782dc8eb22df82ea7d3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 11 Feb 2025 23:04:08 +0100 Subject: [PATCH 45/96] ci: upgrade to upload-artifact v4 --- .github/workflows/MinedMap.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index c2e9961..cf75b68 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -27,7 +27,7 @@ jobs: cp -r viewer/* "$pkgdir"/ - name: 'Archive' - uses: 'actions/upload-artifact@v3' + uses: 'actions/upload-artifact@v4' with: name: 'MinedMap-${{ steps.tag.outputs.tag }}-viewer' path: 'build/pkg' @@ -134,7 +134,7 @@ jobs: cp target/${{ matrix.target }}/release/minedmap${{ matrix.ext }} "$pkgdir"/ - name: 'Archive' - uses: 'actions/upload-artifact@v3' + uses: 'actions/upload-artifact@v4' with: name: 'MinedMap-${{ steps.tag.outputs.tag }}-${{ matrix.target }}' path: 'target/pkg' From 1d9be9a41cbfd665c41dbf5d7bfc2ba16584a224 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 12 Feb 2025 20:22:26 +0100 Subject: [PATCH 46/96] Add jemalloc and jemalloc-auto features Introduce the new features jemalloc (set jemalloc global allocator unconditionally) and jemalloc-auto (set jemalloc global allocator on musl-based targets to fix multithreaded performance, see [1]). Because cargo does not support target-specific features or feature defaults, the default is handled using a helper crate minedmap-default-alloc. [1] https://nickb.dev/blog/default-musl-allocator-considered-harmful-to-performance/ --- CHANGELOG.md | 22 ++++++++++++++++++++++ Cargo.lock | 28 ++++++++++++++++++++++++++++ Cargo.toml | 5 ++++- crates/default-alloc/Cargo.toml | 17 +++++++++++++++++ crates/default-alloc/src/lib.rs | 3 +++ src/main.rs | 3 +++ 6 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 crates/default-alloc/Cargo.toml create mode 100644 crates/default-alloc/src/lib.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 7745ced..bec566e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ ## [Unreleased] - ReleaseDate +### Added + +- 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. + ### Changed - Unknown biome types (from not yet supported or modded versions of Minecraft) diff --git a/Cargo.lock b/Cargo.lock index 317eb46..eeaede2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -591,6 +591,7 @@ dependencies = [ "image", "indexmap", "lru", + "minedmap-default-alloc", "minedmap-nbt", "minedmap-resource", "minedmap-types", @@ -608,6 +609,13 @@ dependencies = [ "zstd", ] +[[package]] +name = "minedmap-default-alloc" +version = "0.1.0" +dependencies = [ + "tikv-jemallocator", +] + [[package]] name = "minedmap-nbt" version = "0.1.1" @@ -1057,6 +1065,26 @@ dependencies = [ "once_cell", ] +[[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", +] + [[package]] name = "tokio" version = "1.43.0" diff --git a/Cargo.toml b/Cargo.toml index b821d83..998de6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,6 +47,7 @@ git-version = "0.3.5" image = { version = "0.25.1", default-features = false, features = ["png", "webp"] } indexmap = { version = "2.0.0", features = ["serde"] } lru = "0.13.0" +minedmap-default-alloc = { version = "0.1.0", path = "crates/default-alloc", optional = true } minedmap-nbt = { version = "0.1.1", path = "crates/nbt", default-features = false } minedmap-resource = { version = "0.6.0", path = "crates/resource" } minedmap-types = { version = "0.1.4", path = "crates/types" } @@ -64,5 +65,7 @@ tracing-subscriber = "0.3.17" zstd = "0.13.0" [features] -default = ["zlib-ng"] +default = ["jemalloc-auto", "zlib-ng"] +jemalloc-auto = ["dep:minedmap-default-alloc"] +jemalloc = ["jemalloc-auto", "minedmap-default-alloc/jemalloc"] zlib-ng = ["minedmap-nbt/zlib-ng"] diff --git a/crates/default-alloc/Cargo.toml b/crates/default-alloc/Cargo.toml new file mode 100644 index 0000000..40f9e7e --- /dev/null +++ b/crates/default-alloc/Cargo.toml @@ -0,0 +1,17 @@ +[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 = "*" + +[features] +jemalloc = ["dep:tikv-jemallocator"] diff --git a/crates/default-alloc/src/lib.rs b/crates/default-alloc/src/lib.rs new file mode 100644 index 0000000..0797a5f --- /dev/null +++ b/crates/default-alloc/src/lib.rs @@ -0,0 +1,3 @@ +#[cfg(any(target_env = "musl", feature = "jemalloc"))] +#[global_allocator] +static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; diff --git a/src/main.rs b/src/main.rs index 31f2889..1f19a41 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,9 @@ #![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; From 971afea727210f9745a82b27a56d0c7fac2725d8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 21 Feb 2025 10:55:36 +0100 Subject: [PATCH 47/96] Fix new clippy warnings --- src/core/tile_renderer.rs | 2 +- src/util.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/tile_renderer.rs b/src/core/tile_renderer.rs index a972b78..24af234 100644 --- a/src/core/tile_renderer.rs +++ b/src/core/tile_renderer.rs @@ -134,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 diff --git a/src/util.rs b/src/util.rs index a128ef9..ed07ba5 100644 --- a/src/util.rs +++ b/src/util.rs @@ -39,7 +39,9 @@ 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 From 37126f69fcb9d6d5bbd31ad0a0b34fd522a733bb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Feb 2025 20:10:50 +0100 Subject: [PATCH 48/96] MetadataWriter: add fallback to level.dat_old Looking at inotify dumps, it appears like because of bad implementation choices, Minecraft's level.dat may not exist for a brief moment between moving the old file to level.dat_old and moving a new version into place. Add a fallback to level.dat_old, so generation will not fail if were unlucky enough to hit this moment. --- src/core/common.rs | 6 ++++++ src/core/metadata_writer.rs | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/core/common.rs b/src/core/common.rs index edefcb3..d311773 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -139,6 +139,8 @@ pub struct Config { 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 @@ -170,6 +172,9 @@ impl Config { 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(); @@ -186,6 +191,7 @@ impl Config { num_threads, region_dir, level_dat_path, + level_dat_old_path, output_dir: args.output_dir.clone(), processed_dir, entities_dir, diff --git a/src/core/metadata_writer.rs b/src/core/metadata_writer.rs index 92d8566..eb5f59f 100644 --- a/src/core/metadata_writer.rs +++ b/src/core/metadata_writer.rs @@ -124,7 +124,14 @@ impl<'a> MetadataWriter<'a> { /// Reads and deserializes the `level.dat` of the Minecraft save data fn read_level_dat(&self) -> Result { - crate::nbt::data::from_file(&self.config.level_dat_path).context("Failed to read level.dat") + 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") } /// Generates [Spawn] data from a [de::LevelDat] From c10e9e490203356633aa6fccc9240bf925147776 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Feb 2025 19:56:19 +0100 Subject: [PATCH 49/96] Implement watch mode --- CHANGELOG.md | 16 +++++ Cargo.lock | 170 +++++++++++++++++++++++++++++++++++++++++++-- Cargo.toml | 2 + src/core/common.rs | 4 ++ src/core/mod.rs | 116 ++++++++++++++++++++++++++++--- 5 files changed, 292 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bec566e..e8fd052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,22 @@ ### 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` diff --git a/Cargo.lock b/Cargo.lock index eeaede2..039e940 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -79,7 +79,7 @@ checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", "once_cell", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -321,7 +321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -345,6 +345,18 @@ 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.0.35" @@ -362,6 +374,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" +[[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" @@ -454,6 +475,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "image" version = "0.25.5" @@ -488,6 +515,26 @@ dependencies = [ "serde", ] +[[package]] +name = "inotify" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" +dependencies = [ + "bitflags 2.8.0", + "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" @@ -518,6 +565,26 @@ dependencies = [ "libc", ] +[[package]] +name = "kqueue" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" +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" @@ -530,6 +597,17 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.8.0", + "libc", + "redox_syscall", +] + [[package]] name = "libz-ng-sys" version = "1.1.21" @@ -588,6 +666,7 @@ dependencies = [ "fastnbt", "futures-util", "git-version", + "humantime", "image", "indexmap", "lru", @@ -595,6 +674,7 @@ dependencies = [ "minedmap-nbt", "minedmap-resource", "minedmap-types", + "notify", "num-integer", "num_cpus", "phf", @@ -656,6 +736,43 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "notify" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" +dependencies = [ + "bitflags 2.8.0", + "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" @@ -930,7 +1047,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -939,6 +1056,15 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -1052,7 +1178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ "rustix", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -1171,6 +1297,22 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +[[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.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "winapi" version = "0.3.9" @@ -1187,12 +1329,30 @@ 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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.59.0" diff --git a/Cargo.toml b/Cargo.toml index 998de6c..d213a56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ enum-map = "2.7.3" fastnbt = "2.3.2" 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 = { version = "2.0.0", features = ["serde"] } lru = "0.13.0" @@ -51,6 +52,7 @@ minedmap-default-alloc = { version = "0.1.0", path = "crates/default-alloc", opt minedmap-nbt = { version = "0.1.1", path = "crates/nbt", default-features = false } minedmap-resource = { version = "0.6.0", path = "crates/resource" } minedmap-types = { version = "0.1.4", path = "crates/types" } +notify = "8.0.0" num-integer = "0.1.45" num_cpus = "1.16.0" phf = { version = "0.11.2", features = ["macros"] } diff --git a/src/core/common.rs b/src/core/common.rs index d311773..a81dbf2 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -135,6 +135,8 @@ 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 @@ -169,6 +171,7 @@ 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(); @@ -189,6 +192,7 @@ impl Config { Ok(Config { num_threads, + num_threads_initial, region_dir, level_dat_path, level_dat_old_path, diff --git a/src/core/mod.rs b/src/core/mod.rs index 5832379..202d017 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -10,7 +10,12 @@ mod tile_merger; mod tile_mipmapper; mod tile_renderer; -use std::path::PathBuf; +use std::{ + path::PathBuf, + sync::mpsc::{self, Receiver}, + thread, + time::Duration, +}; use anyhow::{Context, Result}; use clap::Parser; @@ -18,9 +23,13 @@ use git_version::git_version; use common::{Config, ImageFormat}; 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; @@ -44,9 +53,26 @@ 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, @@ -74,14 +100,73 @@ pub struct Args { pub output_dir: PathBuf, } -/// Configures the Rayon thread pool for parallel processing -fn setup_threads(num_threads: usize) -> Result<()> { +/// Configures a Rayon thread pool for parallel processing +fn setup_threads(num_threads: usize) -> Result { rayon::ThreadPoolBuilder::new() .num_threads(num_threads) - .build_global() + .build() .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(); @@ -96,17 +181,26 @@ pub fn cli() -> Result<()> { .with_target(false) .init(); - setup_threads(config.num_threads)?; + let mut pool = setup_threads(config.num_threads_initial)?; let rt = tokio::runtime::Builder::new_current_thread() .build() .unwrap(); - 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()?; + let watch = args.watch.then(|| create_watcher(&args)).transpose()?; - Ok(()) + 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)?; + }) } From d02ca9aea230b9ad387b21e7d911811ee67b6ab2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Feb 2025 17:28:47 +0100 Subject: [PATCH 50/96] ci: update OS --- .github/workflows/MinedMap.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index cf75b68..502e663 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -7,7 +7,7 @@ env: jobs: viewer: - runs-on: 'ubuntu-20.04' + runs-on: 'ubuntu-latest' steps: - name: 'Checkout' @@ -101,7 +101,7 @@ jobs: - os: 'windows-2019' target: 'i686-pc-windows-msvc' ext: '.exe' - - os: 'ubuntu-20.04' + - os: 'ubuntu-22.04' target: 'x86_64-unknown-linux-gnu' steps: From cb0aa235db5055fda339d3a7f0d80a60b41d3599 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Feb 2025 17:18:14 +0100 Subject: [PATCH 51/96] docker: move viewer Dockerfile to viewer subdirectory --- .github/workflows/MinedMap.yml | 1 + viewer/.dockerignore | 1 + Dockerfile.viewer => viewer/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 viewer/.dockerignore rename Dockerfile.viewer => viewer/Dockerfile (73%) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index 502e663..198c472 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -25,6 +25,7 @@ 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' diff --git a/viewer/.dockerignore b/viewer/.dockerignore new file mode 100644 index 0000000..3af0ccb --- /dev/null +++ b/viewer/.dockerignore @@ -0,0 +1 @@ +/data diff --git a/Dockerfile.viewer b/viewer/Dockerfile similarity index 73% rename from Dockerfile.viewer rename to viewer/Dockerfile index 82d50bb..794bcf5 100644 --- a/Dockerfile.viewer +++ b/viewer/Dockerfile @@ -1,3 +1,3 @@ FROM docker.io/library/nginx:alpine -COPY viewer /usr/share/nginx/html +COPY . /usr/share/nginx/html # datadir should be mounted to: /usr/share/nginx/html/data From 3b5ce8287368881728b6af2a81568fdd90189f64 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Feb 2025 16:49:42 +0100 Subject: [PATCH 52/96] docker: include Alpine base tools, tini Including tini fixes forwarding signals to MinedMap, allowing to interrupt it using Ctrl-C. The base tools may be used to add a wrapper script to configure MinedMap with environment variables. As the Alpine base is included now, we can switch from the rust:alpine image to alpine:latest, resulting in MinedMap to be linked dynamically. --- .dockerignore | 4 ++++ Dockerfile | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cef6a14 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +* +!/Cargo.* +!/src +!/crates diff --git a/Dockerfile b/Dockerfile index fa3627c..04ce466 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,15 @@ -FROM docker.io/library/rust:alpine AS BUILDER +FROM docker.io/library/alpine:latest AS BUILDER WORKDIR /build -RUN apk update && apk add cmake build-base +RUN apk add --no-cache build-base cmake cargo -COPY src /build/src -COPY crates /build/crates -COPY Cargo.toml Cargo.lock /build +COPY . . RUN cargo build -r +RUN strip target/release/minedmap -FROM scratch AS RUNNER +FROM docker.io/library/alpine:latest -COPY --from=BUILDER /build/target/release/minedmap /minedmap -ENTRYPOINT [ "/minedmap" ] +RUN apk add --no-cache libgcc tini + +COPY --from=BUILDER /build/target/release/minedmap /bin/minedmap +ENTRYPOINT [ "/sbin/tini", "--", "/bin/minedmap" ] From 850b1a668b49341e75ae17c7389a5e634383cdeb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 21 Feb 2025 19:06:05 +0100 Subject: [PATCH 53/96] docker: use lowercase stage name --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 04ce466..e052309 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/library/alpine:latest AS BUILDER +FROM docker.io/library/alpine:latest AS builder WORKDIR /build RUN apk add --no-cache build-base cmake cargo @@ -11,5 +11,5 @@ FROM docker.io/library/alpine:latest RUN apk add --no-cache libgcc tini -COPY --from=BUILDER /build/target/release/minedmap /bin/minedmap +COPY --from=builder /build/target/release/minedmap /bin/minedmap ENTRYPOINT [ "/sbin/tini", "--", "/bin/minedmap" ] From dba3dd551ecd504d81248db0855a510d479ab23d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 21 Feb 2025 10:51:05 +0100 Subject: [PATCH 54/96] ci: build Docker images, publish to GHCR --- .github/workflows/MinedMap.yml | 86 +++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index 198c472..2aef1ec 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -1,5 +1,14 @@ name: 'MinedMap' -on: ['push', 'pull_request', 'workflow_dispatch'] +on: + push: + branches: + - 'main' + tags: + - 'v*' + pull_request: + branches: + - 'main' + workflow_dispatch: {} env: RUSTFLAGS: -Dwarnings @@ -139,3 +148,78 @@ jobs: with: name: 'MinedMap-${{ steps.tag.outputs.tag }}-${{ matrix.target }}' path: 'target/pkg' + + build-container: + runs-on: ubuntu-latest + needs: + - test + steps: + - 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: + 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 }} From 7bc15f97de13b08fc0372cddd281820bc0488b2b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 22 Feb 2025 03:13:43 +0100 Subject: [PATCH 55/96] docker: viewer: use nginx:alpine-slim as base --- viewer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viewer/Dockerfile b/viewer/Dockerfile index 794bcf5..524fd4c 100644 --- a/viewer/Dockerfile +++ b/viewer/Dockerfile @@ -1,3 +1,3 @@ -FROM docker.io/library/nginx:alpine +FROM docker.io/library/nginx:alpine-slim COPY . /usr/share/nginx/html # datadir should be mounted to: /usr/share/nginx/html/data From 282f62fc30352fa1ea801c2ae7652e538a922eb4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 22 Feb 2025 04:02:10 +0100 Subject: [PATCH 56/96] docker: run minedmap as unpriviledged user --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index e052309..bb0e0ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,12 @@ RUN strip target/release/minedmap FROM docker.io/library/alpine:latest +RUN addgroup -g 1000 -S minedmap \ + && adduser -S -D -H -u 1000 -h /output -s /sbin/nologin -G minedmap -g minedmap minedmap + RUN apk add --no-cache libgcc tini COPY --from=builder /build/target/release/minedmap /bin/minedmap ENTRYPOINT [ "/sbin/tini", "--", "/bin/minedmap" ] + +USER minedmap:minedmap From 8cb1eee60b82b0bfe00f3260ece281b269cd04fb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 22 Feb 2025 11:06:46 +0100 Subject: [PATCH 57/96] docker, ci: fix --version output When building the docker image manually, MINEDMAP_VERSION needs to be set explicitly to get a proper version string. --- .github/workflows/MinedMap.yml | 12 ++++++++++++ Dockerfile | 2 ++ src/core/mod.rs | 18 ++++++++++++------ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index 2aef1ec..24895c9 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -154,6 +154,16 @@ jobs: 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 @@ -182,6 +192,8 @@ jobs: - 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 }} diff --git a/Dockerfile b/Dockerfile index bb0e0ad..49965db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM docker.io/library/alpine:latest AS builder +ARG MINEDMAP_VERSION + WORKDIR /build RUN apk add --no-cache build-base cmake cargo diff --git a/src/core/mod.rs b/src/core/mod.rs index 202d017..a16f620 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -33,17 +33,23 @@ use tracing::{info, warn}; use self::entity_collector::EntityCollector; -/// MinedMap version number -const VERSION: &str = git_version!( - args = ["--abbrev=7", "--match=v*", "--dirty=-modified"], - cargo_prefix = "v", -); +/// 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(), + ) +} /// Command line arguments for minedmap CLI #[derive(Debug, Parser)] #[command( about, - version = VERSION.strip_prefix("v").unwrap(), + version = version(), max_term_width = 100, )] pub struct Args { From 90f2c5fdd05286037512380950a9fe076fe26600 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 22 Feb 2025 04:03:08 +0100 Subject: [PATCH 58/96] docker: add example docker-compose.yml --- docker-compose.yml | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5954ba7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,51 @@ +# 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 + - 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 + restart: unless-stopped + +volumes: + data: {} + processed: {} + output: {} From 24c266fc78db01115435c118c874d55a5a9f2d28 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 22 Feb 2025 11:27:40 +0100 Subject: [PATCH 59/96] docker: set ARG after apk add Allow reusing apk add layer when MINEDMAP_VERSION has changed. Signed-off-by: Matthias Schiffer --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 49965db..389fb08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ FROM docker.io/library/alpine:latest AS builder -ARG MINEDMAP_VERSION - WORKDIR /build RUN apk add --no-cache build-base cmake cargo +ARG MINEDMAP_VERSION + COPY . . RUN cargo build -r RUN strip target/release/minedmap From 5ee8e493d4b85afa8f8090716bf04207e8425f3b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 25 Feb 2025 18:23:54 +0100 Subject: [PATCH 60/96] docker-compose.yml: mount volumes read-only where appropriate --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5954ba7..c725ae2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,7 @@ services: - '/input/world' - '/output' volumes: - - data:/input + - data:/input:ro - output:/output - processed:/output/processed network_mode: 'none' @@ -42,7 +42,7 @@ services: ports: - '8080:80' volumes: - - output:/usr/share/nginx/html/data + - output:/usr/share/nginx/html/data:ro restart: unless-stopped volumes: From 40bc6cd2a9aaa5137561604c025edb5677d81b14 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 28 Feb 2025 11:54:20 +0100 Subject: [PATCH 61/96] Update dependencies --- Cargo.lock | 80 +++++++++++++++++++------------------- crates/resource/Cargo.toml | 2 +- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 039e940..c8cbbe6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" [[package]] name = "autocfg" @@ -150,9 +150,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.2.13" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", "libc", @@ -173,9 +173,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.29" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", "clap_derive", @@ -183,9 +183,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.29" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstream", "anstyle", @@ -263,9 +263,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "either" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" [[package]] name = "enum-map" @@ -310,9 +310,9 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" @@ -359,9 +359,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", "libz-ng-sys", @@ -448,9 +448,9 @@ dependencies = [ [[package]] name = "glam" -version = "0.29.2" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc46dd3ec48fdd8e693a98d2b8bafae273a2d54c1de02a2a7e3d57d501f39677" +checksum = "17fcdf9683c406c2fc4d124afd29c0d595e22210d633cbdb8695ba9935ab1dc6" [[package]] name = "hashbrown" @@ -593,9 +593,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libredox" @@ -636,9 +636,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "lru" @@ -728,9 +728,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", "simd-adler32", @@ -989,9 +989,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" dependencies = [ "bitflags 2.8.0", ] @@ -1073,9 +1073,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] @@ -1091,9 +1091,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", @@ -1102,9 +1102,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" dependencies = [ "itoa", "memchr", @@ -1150,9 +1150,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "strsim" @@ -1281,9 +1281,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "utf8parse" @@ -1428,27 +1428,27 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "zstd" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.2.1" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.14+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" dependencies = [ "cc", "pkg-config", diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index 4e0d512..07b6d1f 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -9,5 +9,5 @@ repository.workspace = true [dependencies] enumflags2 = { version = "0.7.7", features = ["serde"] } -glam = "0.29.2" +glam = "0.30.0" serde = { version = "1.0.183", features = ["derive"] } From f8c8ca78bad8e0c66b1429666442c958be1a33bf Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 28 Feb 2025 12:12:58 +0100 Subject: [PATCH 62/96] Switch from zlib-ng to zlib-rs zlib-rs provides the same performance as zlib-ng with minedmap, while reducing the amount of C code and avoiding the external build dependency on CMake. --- CHANGELOG.md | 4 ++++ Cargo.lock | 27 ++++++++++++--------------- Cargo.toml | 4 ++-- Dockerfile | 2 +- README.md | 5 ----- crates/nbt/Cargo.toml | 6 ++---- 6 files changed, 21 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8fd052..1b84b15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,10 @@ - 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. ## [2.4.0] - 2025-01-11 diff --git a/Cargo.lock b/Cargo.lock index c8cbbe6..7bd83ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -212,15 +212,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" -[[package]] -name = "cmake" -version = "0.1.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" -dependencies = [ - "cc", -] - [[package]] name = "colorchoice" version = "1.0.3" @@ -364,7 +355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", - "libz-ng-sys", + "libz-rs-sys", "miniz_oxide", ] @@ -609,13 +600,12 @@ dependencies = [ ] [[package]] -name = "libz-ng-sys" -version = "1.1.21" +name = "libz-rs-sys" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cee1488e961a80d172564fd6fcda11d8a4ac6672c06fe008e9213fa60520c2b" +checksum = "902bc563b5d65ad9bba616b490842ef0651066a1a1dc3ce1087113ffcb873c8d" dependencies = [ - "cmake", - "libc", + "zlib-rs", ] [[package]] @@ -664,6 +654,7 @@ dependencies = [ "clap", "enum-map", "fastnbt", + "flate2", "futures-util", "git-version", "humantime", @@ -1426,6 +1417,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "zlib-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b20717f0917c908dc63de2e44e97f1e6b126ca58d0e391cee86d504eb8fbd05" + [[package]] name = "zstd" version = "0.13.3" diff --git a/Cargo.toml b/Cargo.toml index d213a56..812ad33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,7 @@ 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" @@ -67,7 +68,6 @@ tracing-subscriber = "0.3.17" zstd = "0.13.0" [features] -default = ["jemalloc-auto", "zlib-ng"] +default = ["jemalloc-auto"] jemalloc-auto = ["dep:minedmap-default-alloc"] jemalloc = ["jemalloc-auto", "minedmap-default-alloc/jemalloc"] -zlib-ng = ["minedmap-nbt/zlib-ng"] diff --git a/Dockerfile b/Dockerfile index 389fb08..818971d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM docker.io/library/alpine:latest AS builder WORKDIR /build -RUN apk add --no-cache build-base cmake cargo +RUN apk add --no-cache build-base cargo ARG MINEDMAP_VERSION diff --git a/README.md b/README.md index 7d60f78..952163f 100644 --- a/README.md +++ b/README.md @@ -117,11 +117,6 @@ 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. diff --git a/crates/nbt/Cargo.toml b/crates/nbt/Cargo.toml index 9f815da..01bbd78 100644 --- a/crates/nbt/Cargo.toml +++ b/crates/nbt/Cargo.toml @@ -11,12 +11,10 @@ repository.workspace = true anyhow = "1.0.75" bytemuck = "1.13.1" fastnbt = "2.4.4" -flate2 = "1.0.27" +flate2 = "1.1.0" minedmap-types = { version = "0.1.4", 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"] } From 7686996fd3b538d3b5409fcb3c251b178ed693df Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 28 Feb 2025 16:16:29 +0100 Subject: [PATCH 63/96] resource: make seagrass opaque See changelog for rationale. --- CHANGELOG.md | 7 +++++++ crates/resource/src/block_types.rs | 4 ++-- resource/blocks.json | 2 +- src/core/common.rs | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b84b15..14b7e35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,13 @@ 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. ## [2.4.0] - 2025-01-11 diff --git a/crates/resource/src/block_types.rs b/crates/resource/src/block_types.rs index 53abd54..da556b8 100644 --- a/crates/resource/src/block_types.rs +++ b/crates/resource/src/block_types.rs @@ -8692,8 +8692,8 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "seagrass", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), - color: Color([0, 0, 0]), + flags: make_bitflags!(BlockFlag::{Opaque}), + color: Color([50, 126, 8]), }, sign_material: None, }, diff --git a/resource/blocks.json b/resource/blocks.json index a88aa34..a409abb 100644 --- a/resource/blocks.json +++ b/resource/blocks.json @@ -1781,7 +1781,7 @@ "sculk_vein": {}, "sea_lantern": {}, "sea_pickle": {}, - "seagrass": null, + "seagrass": {}, "short_grass": null, "shroomlight": {}, "shulker_box": {}, diff --git a/src/core/common.rs b/src/core/common.rs index a81dbf2..8230a79 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -25,7 +25,7 @@ use crate::{ /// /// 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(4); +pub const REGION_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(5); /// MinedMap map tile data version number /// @@ -37,7 +37,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(3); +pub const LIGHTMAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(4); /// MinedMap mipmap data version number /// From fbdd5ed457f2e5ca12bc7a7d6f6992f47494e062 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Mar 2025 21:11:59 +0100 Subject: [PATCH 64/96] Dockerfile: switch back to docker.io/library/rust:alpine image bincode 2 required Rust 1.85, so our options are to switch to Alpine edge or to use the rust image. While using the rust image results in a statically linked binary, this does not actually increase the size of the image, as we were already using jemalloc, so almost nothing of libc is actually used. --- Dockerfile | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 818971d..0f0eecd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM docker.io/library/alpine:latest AS builder +FROM docker.io/library/rust:alpine AS builder WORKDIR /build -RUN apk add --no-cache build-base cargo +RUN apk add --no-cache build-base tini-static ARG MINEDMAP_VERSION @@ -9,14 +9,9 @@ COPY . . RUN cargo build -r RUN strip target/release/minedmap -FROM docker.io/library/alpine:latest +FROM scratch -RUN addgroup -g 1000 -S minedmap \ - && adduser -S -D -H -u 1000 -h /output -s /sbin/nologin -G minedmap -g minedmap minedmap +COPY --from=builder /sbin/tini-static /build/target/release/minedmap /bin/ +ENTRYPOINT [ "/bin/tini-static", "--", "/bin/minedmap" ] -RUN apk add --no-cache libgcc tini - -COPY --from=builder /build/target/release/minedmap /bin/minedmap -ENTRYPOINT [ "/sbin/tini", "--", "/bin/minedmap" ] - -USER minedmap:minedmap +USER 1000:1000 From deb232ddf356efd80a4658b0b0f8c329e420b244 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Mar 2025 20:34:16 +0100 Subject: [PATCH 65/96] Update dependencies --- Cargo.lock | 118 ++++++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bd83ee..0142276 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.96" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "autocfg" @@ -126,15 +126,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "byteorder" @@ -173,9 +173,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" dependencies = [ "clap_builder", "clap_derive", @@ -183,9 +183,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" dependencies = [ "anstream", "anstyle", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.28" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck", "proc-macro2", @@ -254,9 +254,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "either" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "enum-map" @@ -468,9 +468,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "humantime" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" [[package]] name = "image" @@ -497,9 +497,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown", @@ -512,7 +512,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "inotify-sys", "libc", ] @@ -543,9 +543,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" @@ -584,9 +584,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.170" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libredox" @@ -594,7 +594,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "libc", "redox_syscall", ] @@ -610,9 +610,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" [[package]] name = "lock_api" @@ -745,7 +745,7 @@ version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "filetime", "fsevent-sys", "inotify", @@ -813,9 +813,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" [[package]] name = "overload" @@ -902,9 +902,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "png" @@ -921,9 +921,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -936,9 +936,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -980,11 +980,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -1030,11 +1030,11 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustix" -version = "0.38.44" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "errno", "libc", "linux-raw-sys", @@ -1043,9 +1043,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -1064,27 +1064,27 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.15" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -1093,9 +1093,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -1153,9 +1153,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.98" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -1164,9 +1164,9 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ "rustix", "windows-sys 0.59.0", @@ -1204,9 +1204,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.43.0" +version = "1.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" dependencies = [ "backtrace", "parking_lot", @@ -1272,9 +1272,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "utf8parse" From 404ad74235cc69935204ea50497a80f9acce6aad Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 12 Mar 2025 20:54:04 +0100 Subject: [PATCH 66/96] core: deserialize biome list into Vec Only use IndexSet for deduplication while processing the biome; when deserializing, no deduplication is required, so using a Vec is faster (besides IndexSet missing non-serde support for bincode 2). --- src/core/common.rs | 3 +-- src/core/region_processor.rs | 12 ++++++++++-- src/core/tile_renderer.rs | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/core/common.rs b/src/core/common.rs index 8230a79..b25d7b8 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -8,7 +8,6 @@ use std::{ use anyhow::{Context, Result}; use clap::ValueEnum; -use indexmap::IndexSet; use regex::{Regex, RegexSet}; use serde::{Deserialize, Serialize}; @@ -102,7 +101,7 @@ pub struct ProcessedRegion { /// List of biomes used in the region /// /// Indexed by [ProcessedChunk] biome data - pub biome_list: IndexSet, + pub biome_list: Vec, /// Processed chunk data pub chunks: ChunkArray>>, } diff --git a/src/core/region_processor.rs b/src/core/region_processor.rs index e448f5e..1dc50fb 100644 --- a/src/core/region_processor.rs +++ b/src/core/region_processor.rs @@ -1,9 +1,11 @@ //! The [RegionProcessor] and related functions -use std::{ffi::OsStr, path::PathBuf, sync::mpsc, time::SystemTime}; +use std::{ffi::OsStr, mem, path::PathBuf, sync::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}; @@ -73,6 +75,8 @@ struct SingleRegionProcessor<'a> { lightmap_needed: bool, /// True if entity output file needs to be updated entities_needed: bool, + /// [IndexSet] of biomes used by the processed region + biome_list: IndexSet, /// Processed region intermediate data processed_region: ProcessedRegion, /// Lightmap intermediate data @@ -108,6 +112,7 @@ impl<'a> SingleRegionProcessor<'a> { let entities_needed = Some(input_timestamp) > entities_timestamp; let processed_region = ProcessedRegion::default(); + let biome_list = IndexSet::default(); let lightmap = image::GrayAlphaImage::new(N, N); let entities = ProcessedEntities::default(); @@ -127,6 +132,7 @@ impl<'a> SingleRegionProcessor<'a> { lightmap_needed, entities_needed, processed_region, + biome_list, lightmap, entities, image_format: processor.config.tile_image_format(), @@ -220,7 +226,7 @@ impl<'a> SingleRegionProcessor<'a> { biomes, block_light, depths, - }) = world::layer::top_layer(&mut self.processed_region.biome_list, &chunk) + }) = world::layer::top_layer(&mut self.biome_list, &chunk) .with_context(|| format!("Failed to process chunk {:?}", chunk_coords))? { if self.output_needed { @@ -291,6 +297,8 @@ impl<'a> SingleRegionProcessor<'a> { } } + self.processed_region.biome_list = mem::take(&mut self.biome_list).into_iter().collect(); + self.save_region()?; self.save_lightmap()?; self.save_entities()?; diff --git a/src/core/tile_renderer.rs b/src/core/tile_renderer.rs index 24af234..e47e20e 100644 --- a/src/core/tile_renderer.rs +++ b/src/core/tile_renderer.rs @@ -187,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_index(index.into())?; + let biome = region.biome_list.get(usize::from(index))?; total += w; color += w * block_color(block, Some(biome), depth.0 as f32); From 53a0f2460006b89413feb80858a03673f2746b68 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 12 Mar 2025 20:34:26 +0100 Subject: [PATCH 67/96] treewide: update to bincode 2 Consistently use bincode's Encode/Decode to avoid issues with incompatible serde features. Support for storing some temporary files as JSON is removed. The size of the "processed" directory is reduced by ~8% with the new default encoding of bincode 2. Performance is more or less unaffected. --- Cargo.lock | 31 ++++++++++++++++++++--- Cargo.toml | 2 +- crates/resource/Cargo.toml | 2 +- crates/resource/src/lib.rs | 49 +++++++++++++++++++++++++++++++----- crates/types/Cargo.toml | 2 +- crates/types/src/lib.rs | 6 ++--- src/core/common.rs | 14 ++++++----- src/core/entity_collector.rs | 25 +++++++++--------- src/core/metadata_writer.rs | 5 ++-- src/core/region_processor.rs | 2 -- src/core/tile_renderer.rs | 3 +-- src/io/storage.rs | 46 +++++++++++++-------------------- src/world/block_entity.rs | 11 ++++---- src/world/json_text.rs | 7 ++++-- src/world/layer.rs | 4 +-- src/world/sign.rs | 5 ++-- 16 files changed, 133 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0142276..5c5d477 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,11 +111,22 @@ dependencies = [ [[package]] name = "bincode" -version = "1.3.3" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" 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]] @@ -704,17 +715,17 @@ dependencies = [ name = "minedmap-resource" version = "0.6.0" dependencies = [ + "bincode", "enumflags2", "glam", - "serde", ] [[package]] name = "minedmap-types" version = "0.1.4" dependencies = [ + "bincode", "itertools", - "serde", ] [[package]] @@ -1276,6 +1287,12 @@ version = "1.0.18" 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" + [[package]] name = "utf8parse" version = "0.2.2" @@ -1288,6 +1305,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +[[package]] +name = "virtue" +version = "0.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" + [[package]] name = "walkdir" version = "2.5.0" diff --git a/Cargo.toml b/Cargo.toml index 812ad33..4109bfd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ pre-release-replacements = [ [dependencies] anyhow = "1.0.68" -bincode = "1.3.3" +bincode = "2.0.1" clap = { version = "4.1.4", features = ["derive", "wrap_help"] } enum-map = "2.7.3" fastnbt = "2.3.2" diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index 07b6d1f..c654f40 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -8,6 +8,6 @@ readme.workspace = true repository.workspace = true [dependencies] +bincode = "2.0.1" enumflags2 = { version = "0.7.7", features = ["serde"] } glam = "0.30.0" -serde = { version = "1.0.183", features = ["derive"] } diff --git a/crates/resource/src/lib.rs b/crates/resource/src/lib.rs index a633d06..01b460b 100644 --- a/crates/resource/src/lib.rs +++ b/crates/resource/src/lib.rs @@ -10,13 +10,13 @@ mod legacy_block_types; use std::collections::HashMap; +use bincode::{BorrowDecode, Decode, Encode}; use enumflags2::{bitflags, BitFlags}; -use serde::{Deserialize, Serialize}; /// Flags describing special properties of [BlockType]s #[bitflags] #[repr(u8)] -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq)] pub enum BlockFlag { /// The block type is opaque Opaque, @@ -38,14 +38,14 @@ pub enum BlockFlag { } /// An RGB color with u8 components -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Encode, Decode)] 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, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy)] pub struct BlockColor { /// Bit set of [BlockFlag]s describing special properties of the block type pub flags: BitFlags, @@ -61,6 +61,43 @@ 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 { @@ -137,7 +174,7 @@ impl BlockTypes { pub use block_color::{block_color, needs_biome}; /// Grass color modifier used by a biome -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Encode, Decode)] pub enum BiomeGrassColorModifier { /// Grass color modifier used by the dark forest biome DarkForest, @@ -149,7 +186,7 @@ pub enum BiomeGrassColorModifier { /// /// 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)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Encode, Decode)] pub struct Biome { /// Temperature value /// diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index c5bd47e..2b83c39 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -8,5 +8,5 @@ readme.workspace = true repository.workspace = true [dependencies] +bincode = "2.0.1" itertools = "0.14.0" -serde = { version = "1.0.183", features = ["derive"] } diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index b4f12c2..e770f6a 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 { @@ -110,7 +110,7 @@ impl LayerBlockCoords { /// Generic array for data stored per block of a chunk layer /// /// Includes various convenient iteration functions. -#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Default, Encode, Decode)] pub struct LayerBlockArray(pub [[T; BLOCKS_PER_CHUNK]; BLOCKS_PER_CHUNK]); impl Index for LayerBlockArray { @@ -196,7 +196,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, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Default, Encode, Decode)] pub struct ChunkArray(pub [[T; CHUNKS_PER_REGION]; CHUNKS_PER_REGION]); impl ChunkArray { diff --git a/src/core/common.rs b/src/core/common.rs index b25d7b8..06a3277 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -3,13 +3,15 @@ use std::{ collections::{BTreeMap, BTreeSet}, fmt::Debug, + hash::Hash, path::{Path, PathBuf}, }; use anyhow::{Context, Result}; +use bincode::{Decode, Encode}; use clap::ValueEnum; use regex::{Regex, RegexSet}; -use serde::{Deserialize, Serialize}; +use serde::Serialize; use crate::{ io::fs::FileMetaVersion, @@ -24,7 +26,7 @@ use crate::{ /// /// 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(5); +pub const REGION_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(6); /// MinedMap map tile data version number /// @@ -46,7 +48,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(1); +pub const ENTITIES_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(2); /// Coordinate pair of a generated tile /// @@ -85,7 +87,7 @@ impl TileCoordMap { } /// Data structure for storing chunk data between processing and rendering steps -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Encode, Decode)] pub struct ProcessedChunk { /// Block type data pub blocks: Box, @@ -96,7 +98,7 @@ pub struct ProcessedChunk { } /// Data structure for storing region data between processing and rendering steps -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Default, Encode, Decode)] pub struct ProcessedRegion { /// List of biomes used in the region /// @@ -107,7 +109,7 @@ pub struct ProcessedRegion { } /// Data structure for storing entity data between processing and collection steps -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Default, Encode, Decode)] pub struct ProcessedEntities { /// List of block entities pub block_entities: Vec, diff --git a/src/core/entity_collector.rs b/src/core/entity_collector.rs index 30b3a86..0d18090 100644 --- a/src/core/entity_collector.rs +++ b/src/core/entity_collector.rs @@ -78,23 +78,22 @@ 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(), storage::Format::Json) { - 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()) { + 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, storage::Format::Json).context("Failed to write entity data") + storage::write(file, &output).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 eb5f59f..40c5796 100644 --- a/src/core/metadata_writer.rs +++ b/src/core/metadata_writer.rs @@ -179,9 +179,8 @@ 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, storage::Format::Json) - .context("Failed to read entity data file")?; + let data: ProcessedEntities = storage::read_file(&self.config.entities_path_final) + .context("Failed to read entity data file")?; let ret = Entities { signs: data diff --git a/src/core/region_processor.rs b/src/core/region_processor.rs index 1dc50fb..56f54ed 100644 --- a/src/core/region_processor.rs +++ b/src/core/region_processor.rs @@ -168,7 +168,6 @@ impl<'a> SingleRegionProcessor<'a> { storage::write_file( &self.output_path, &self.processed_region, - storage::Format::Bincode, REGION_FILE_META_VERSION, self.input_timestamp, ) @@ -207,7 +206,6 @@ impl<'a> SingleRegionProcessor<'a> { storage::write_file( &self.entities_path, &self.entities, - storage::Format::Json, ENTITIES_FILE_META_VERSION, self.input_timestamp, ) diff --git a/src/core/tile_renderer.rs b/src/core/tile_renderer.rs index e47e20e..e990a63 100644 --- a/src/core/tile_renderer.rs +++ b/src/core/tile_renderer.rs @@ -105,8 +105,7 @@ impl<'a> TileRenderer<'a> { region_loader .get_or_try_init(|| async { - storage::read_file(&processed_path, storage::Format::Bincode) - .context("Failed to load processed region data") + storage::read_file(&processed_path).context("Failed to load processed region data") }) .await .cloned() diff --git a/src/io/storage.rs b/src/io/storage.rs index 9296166..ae311de 100644 --- a/src/io/storage.rs +++ b/src/io/storage.rs @@ -10,28 +10,16 @@ use std::{ }; use anyhow::{Context, Result}; -use serde::{de::DeserializeOwned, Serialize}; +use bincode::{Decode, Encode}; use super::fs; -/// 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, -} +/// Bincode configuration +const BINCODE_CONFIG: bincode::config::Configuration = bincode::config::standard(); /// Serializes data and writes it to a writer -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)?, - }; +pub fn write(writer: &mut W, value: &T) -> Result<()> { + let data = bincode::encode_to_vec(value, BINCODE_CONFIG)?; let len = u32::try_from(data.len())?; let compressed = zstd::bulk::compress(&data, 1)?; drop(data); @@ -45,18 +33,21 @@ pub fn write(writer: &mut W, value: &T, format: Format) /// 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, format)) + fs::create_with_timestamp(path, version, timestamp, |file| write(file, value)) } /// Reads data from a reader and deserializes it -pub fn read(reader: &mut R, format: Format) -> Result { +pub fn read(reader: &mut R) -> Result +where + R: Read, + T: Decode<()>, +{ let mut len_buf = [0u8; 4]; reader.read_exact(&mut len_buf)?; let len = usize::try_from(u32::from_be_bytes(len_buf))?; @@ -66,18 +57,17 @@ pub fn read(reader: &mut R, format: Format) -> Res let data = zstd::bulk::decompress(&compressed, len)?; drop(compressed); - let value = match format { - Format::Bincode => bincode::deserialize(&data)?, - Format::Json => serde_json::from_slice(&data)?, - }; - Ok(value) + Ok(bincode::decode_from_slice(&data, BINCODE_CONFIG)?.0) } /// Reads data from a file and deserializes it -pub fn read_file(path: &Path, format: Format) -> Result { +pub fn read_file(path: &Path) -> Result +where + T: Decode<()>, +{ (|| -> Result { let mut file = File::open(path)?; - read(&mut file, format) + read(&mut file) })() .with_context(|| format!("Failed to read file {}", path.display())) } diff --git a/src/world/block_entity.rs b/src/world/block_entity.rs index 182ad50..6ad58a1 100644 --- a/src/world/block_entity.rs +++ b/src/world/block_entity.rs @@ -1,7 +1,8 @@ //! Processing of block entity data +use bincode::{Decode, Encode}; use minedmap_resource::{BlockFlag, BlockType}; -use serde::{Deserialize, Serialize}; +use serde::Serialize; use super::{ de, @@ -9,7 +10,7 @@ use super::{ }; /// Kind of sign block -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, Serialize)] #[serde(rename_all = "snake_case")] pub enum SignKind { /// Standing sign @@ -23,7 +24,7 @@ pub enum SignKind { } /// Processed sign data -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, Serialize)] pub struct Sign { /// The kind of the sign pub kind: SignKind, @@ -54,7 +55,7 @@ impl Sign { } /// Data for different kinds of [BlockEntity] -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, Serialize)] #[serde(tag = "type", rename_all = "snake_case")] pub enum BlockEntityData { /// A sign block @@ -62,7 +63,7 @@ pub enum BlockEntityData { } /// A processed block entity -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, Serialize)] pub struct BlockEntity { /// Global X coordinate pub x: i32, diff --git a/src/world/json_text.rs b/src/world/json_text.rs index fa18527..6a2d8ba 100644 --- a/src/world/json_text.rs +++ b/src/world/json_text.rs @@ -2,6 +2,7 @@ use std::{collections::VecDeque, fmt::Display}; +use bincode::{Decode, Encode}; use minedmap_resource::Color; use serde::{Deserialize, Serialize}; @@ -12,7 +13,9 @@ use serde::{Deserialize, Serialize}; /// is handled by [DeserializedText]. /// /// Formatting that is not set in a node is inherited from the parent. -#[derive(Debug, Serialize, Deserialize, Default, PartialEq, Eq, PartialOrd, Ord)] +#[derive( + Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Encode, Decode, +)] pub struct FormattedText { #[serde(default)] /// Text content @@ -84,7 +87,7 @@ impl From for FormattedTextTree { } /// List of [FormattedText] -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Encode, Decode)] pub struct FormattedTextList(pub Vec); impl FormattedTextList { diff --git a/src/world/layer.rs b/src/world/layer.rs index e59593c..deb4b48 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, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Encode, Decode)] pub struct BlockHeight(pub i32); impl BlockHeight { diff --git a/src/world/sign.rs b/src/world/sign.rs index eff319f..579f5b3 100644 --- a/src/world/sign.rs +++ b/src/world/sign.rs @@ -2,8 +2,9 @@ use std::fmt::Display; +use bincode::{Decode, Encode}; use minedmap_resource::Color; -use serde::{Deserialize, Serialize}; +use serde::Serialize; use super::{ de, @@ -104,7 +105,7 @@ impl BlockEntitySignExt for de::BlockEntitySign { } } -#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, Default, Serialize, PartialEq, Eq, PartialOrd, Ord, Encode, Decode)] /// Deserialized and linearized sign text pub struct SignText(pub Vec); From 708fb9645dc89f6e454f3564b81f8e9a265457d7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Mar 2025 20:27:51 +0100 Subject: [PATCH 68/96] core/region_processor: refactor Separate configuration and mutable state, also allowing to avoid a few mem::take(). --- src/core/region_processor.rs | 115 ++++++++++++++++++++--------------- 1 file changed, 67 insertions(+), 48 deletions(-) diff --git a/src/core/region_processor.rs b/src/core/region_processor.rs index 56f54ed..e638342 100644 --- a/src/core/region_processor.rs +++ b/src/core/region_processor.rs @@ -1,6 +1,6 @@ //! The [RegionProcessor] and related functions -use std::{ffi::OsStr, mem, path::PathBuf, sync::mpsc, time::SystemTime}; +use std::{ffi::OsStr, path::PathBuf, sync::mpsc, time::SystemTime}; use anyhow::{Context, Result}; use enum_map::{Enum, EnumMap}; @@ -45,6 +45,37 @@ 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 @@ -75,26 +106,13 @@ struct SingleRegionProcessor<'a> { lightmap_needed: bool, /// True if entity output file needs to be updated entities_needed: bool, - /// [IndexSet] of biomes used by the processed region - biome_list: IndexSet, - /// Processed region intermediate data - processed_region: ProcessedRegion, - /// Lightmap intermediate data - lightmap: image::GrayAlphaImage, - /// Processed entity intermediate data - entities: ProcessedEntities, /// Format of generated map tiles image_format: image::ImageFormat, - /// 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)?; @@ -111,11 +129,6 @@ 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 biome_list = IndexSet::default(); - let lightmap = image::GrayAlphaImage::new(N, N); - let entities = ProcessedEntities::default(); - Ok(SingleRegionProcessor { block_types: &processor.block_types, biome_types: &processor.biome_types, @@ -131,12 +144,7 @@ impl<'a> SingleRegionProcessor<'a> { output_needed, lightmap_needed, entities_needed, - processed_region, - biome_list, - lightmap, - entities, image_format: processor.config.tile_image_format(), - has_unknown: false, }) } @@ -160,14 +168,14 @@ 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) -> Result<()> { + fn save_region(&self, processed_region: &ProcessedRegion) -> Result<()> { if !self.output_needed { return Ok(()); } storage::write_file( &self.output_path, - &self.processed_region, + processed_region, REGION_FILE_META_VERSION, self.input_timestamp, ) @@ -176,7 +184,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) -> Result<()> { + fn save_lightmap(&self, lightmap: &image::GrayAlphaImage) -> Result<()> { if !self.lightmap_needed { return Ok(()); } @@ -186,7 +194,7 @@ impl<'a> SingleRegionProcessor<'a> { LIGHTMAP_FILE_META_VERSION, self.input_timestamp, |file| { - self.lightmap + lightmap .write_to(file, self.image_format) .context("Failed to save image") }, @@ -196,27 +204,32 @@ 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(&mut self) -> Result<()> { + fn save_entities(&self, entities: &mut ProcessedEntities) -> Result<()> { if !self.entities_needed { return Ok(()); } - self.entities.block_entities.sort_unstable(); + entities.block_entities.sort_unstable(); storage::write_file( &self.entities_path, - &self.entities, + entities, ENTITIES_FILE_META_VERSION, self.input_timestamp, ) } /// Processes a single chunk - fn process_chunk(&mut self, chunk_coords: ChunkCoords, data: world::de::Chunk) -> Result<()> { + fn process_chunk( + &self, + data: &mut SingleRegionData, + chunk_coords: ChunkCoords, + chunk_data: world::de::Chunk, + ) -> Result<()> { let (chunk, has_unknown) = - world::chunk::Chunk::new(&data, self.block_types, self.biome_types) + world::chunk::Chunk::new(&chunk_data, self.block_types, self.biome_types) .with_context(|| format!("Failed to decode chunk {:?}", chunk_coords))?; - self.has_unknown |= has_unknown; + data.has_unknown |= has_unknown; if self.output_needed || self.lightmap_needed { if let Some(layer::LayerData { @@ -224,11 +237,11 @@ impl<'a> SingleRegionProcessor<'a> { biomes, block_light, depths, - }) = world::layer::top_layer(&mut self.biome_list, &chunk) + }) = world::layer::top_layer(&mut data.biome_list, &chunk) .with_context(|| format!("Failed to process chunk {:?}", chunk_coords))? { if self.output_needed { - self.processed_region.chunks[chunk_coords] = Some(Box::new(ProcessedChunk { + data.chunks[chunk_coords] = Some(Box::new(ProcessedChunk { blocks, biomes, depths, @@ -237,7 +250,7 @@ impl<'a> SingleRegionProcessor<'a> { if self.lightmap_needed { let chunk_lightmap = Self::render_chunk_lightmap(block_light); - overlay_chunk(&mut self.lightmap, &chunk_lightmap, chunk_coords); + overlay_chunk(&mut data.lightmap, &chunk_lightmap, chunk_coords); } } } @@ -249,20 +262,21 @@ impl<'a> SingleRegionProcessor<'a> { chunk_coords, ) })?; - self.entities.block_entities.append(&mut block_entities); + data.entities.block_entities.append(&mut block_entities); } Ok(()) } /// Processes the chunks of the region - 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)) + 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), + ) } /// Processes the region - fn run(mut self) -> Result { + fn run(&self) -> Result { if !self.output_needed && !self.lightmap_needed && !self.entities_needed { debug!( "Skipping unchanged region r.{}.{}.mca", @@ -276,7 +290,9 @@ impl<'a> SingleRegionProcessor<'a> { self.coords.x, self.coords.z ); - if let Err(err) = self.process_chunks() { + let mut data = SingleRegionData::default(); + + if let Err(err) = self.process_chunks(&mut data) { if self.output_timestamp.is_some() && self.lightmap_timestamp.is_some() && self.entities_timestamp.is_some() @@ -295,13 +311,16 @@ impl<'a> SingleRegionProcessor<'a> { } } - self.processed_region.biome_list = mem::take(&mut self.biome_list).into_iter().collect(); + 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 self.has_unknown { + Ok(if data.has_unknown { RegionProcessorStatus::OkWithUnknown } else { RegionProcessorStatus::Ok From 5c8568755441c8e91fc8bf2ea598a021a0bd5477 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Mar 2025 20:40:23 +0100 Subject: [PATCH 69/96] Clean up dependency features --- Cargo.lock | 2 -- Cargo.toml | 4 ++-- crates/resource/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c5d477..4f5bfa2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -296,7 +296,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ "enumflags2_derive", - "serde", ] [[package]] @@ -514,7 +513,6 @@ checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown", - "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4109bfd..da9f2ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ 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 = { version = "2.0.0", features = ["serde"] } +indexmap = "2.0.0" lru = "0.13.0" minedmap-default-alloc = { version = "0.1.0", path = "crates/default-alloc", optional = true } minedmap-nbt = { version = "0.1.1", path = "crates/nbt", default-features = false } @@ -60,7 +60,7 @@ phf = { version = "0.11.2", features = ["macros"] } rayon = "1.7.0" regex = "1.10.2" rustc-hash = "2.0.0" -serde = { version = "1.0.152", features = ["rc", "derive"] } +serde = { version = "1.0.152", features = ["derive"] } serde_json = "1.0.99" tokio = { version = "1.31.0", features = ["rt", "parking_lot", "sync"] } tracing = "0.1.37" diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index c654f40..9fc157c 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -9,5 +9,5 @@ repository.workspace = true [dependencies] bincode = "2.0.1" -enumflags2 = { version = "0.7.7", features = ["serde"] } +enumflags2 = "0.7.7" glam = "0.30.0" From 7bba5bae558780a30e0c3218fc41ff770230b4cc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Mar 2025 21:24:44 +0100 Subject: [PATCH 70/96] Update to Rust 2024 With bincode 2, we require rust 1.85 anyways, so we might as well upgrade, too. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index da9f2ca..0051203 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ members = ["crates/*"] [workspace.package] -edition = "2021" +edition = "2024" license = "MIT" readme = "README.md" repository = "https://github.com/neocturne/MinedMap" From 775fcb2d1b6adcd8aca3196ebdd1b2b0f16818cb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Mar 2025 21:44:10 +0100 Subject: [PATCH 71/96] treewide: cargo fmt with 1.85 --- crates/nbt/src/region.rs | 4 ++-- crates/resource/src/lib.rs | 2 +- crates/types/src/lib.rs | 8 ++++---- src/core/mod.rs | 8 +++++--- src/core/tile_renderer.rs | 2 +- src/world/chunk.rs | 4 ++-- src/world/json_text.rs | 2 +- src/world/section.rs | 8 ++------ 8 files changed, 18 insertions(+), 20 deletions(-) diff --git a/crates/nbt/src/region.rs b/crates/nbt/src/region.rs index 8a52b9d..1325919 100644 --- a/crates/nbt/src/region.rs +++ b/crates/nbt/src/region.rs @@ -2,11 +2,11 @@ use std::{ fs::File, - io::{prelude::*, SeekFrom}, + io::{SeekFrom, prelude::*}, path::Path, }; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use flate2::read::ZlibDecoder; use serde::de::DeserializeOwned; diff --git a/crates/resource/src/lib.rs b/crates/resource/src/lib.rs index 01b460b..86cfb0f 100644 --- a/crates/resource/src/lib.rs +++ b/crates/resource/src/lib.rs @@ -11,7 +11,7 @@ mod legacy_block_types; use std::collections::HashMap; use bincode::{BorrowDecode, Decode, Encode}; -use enumflags2::{bitflags, BitFlags}; +use enumflags2::{BitFlags, bitflags}; /// Flags describing special properties of [BlockType]s #[bitflags] diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index e770f6a..f2dc0e1 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -48,10 +48,10 @@ macro_rules! coord_type { /// Returns an iterator over all possible values of the type #[inline] pub fn iter() -> impl DoubleEndedIterator> - + ExactSizeIterator - + FusedIterator - + Clone - + Debug { + + ExactSizeIterator + + FusedIterator + + Clone + + Debug { (0..Self::MAX as u8).map($t) } } diff --git a/src/core/mod.rs b/src/core/mod.rs index a16f620..fce2cb5 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -205,8 +205,10 @@ pub fn cli() -> Result<()> { 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)?; + pool.install(move || { + loop { + wait_watcher(&args, &watch_channel)?; + generate(&config, &rt)?; + } }) } diff --git a/src/core/tile_renderer.rs b/src/core/tile_renderer.rs index e990a63..9d7e188 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::{block_color, needs_biome, Colorf}, + resource::{Colorf, block_color, needs_biome}, types::*, util::coord_offset, }; diff --git a/src/world/chunk.rs b/src/world/chunk.rs index daee023..c4744d0 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::{btree_map, BTreeMap}, + collections::{BTreeMap, btree_map}, iter::{self, FusedIterator}, }; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use super::{block_entity::BlockEntity, de, section::*}; use crate::{ diff --git a/src/world/json_text.rs b/src/world/json_text.rs index 6a2d8ba..7d3ff3a 100644 --- a/src/world/json_text.rs +++ b/src/world/json_text.rs @@ -185,9 +185,9 @@ mod json_color { use minedmap_resource::Color; use serde::{ + Deserializer, Serializer, de::{self, Visitor}, ser::Error as _, - Deserializer, Serializer, }; /// Named JSON text colors diff --git a/src/world/section.rs b/src/world/section.rs index 845ddae..dc5c9a6 100644 --- a/src/world/section.rs +++ b/src/world/section.rs @@ -5,7 +5,7 @@ use std::fmt::Debug; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use num_integer::div_rem; use tracing::debug; @@ -400,10 +400,6 @@ 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 } } } From 5ee826a11b78905eeefdacfc78fced7592ec8962 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Mar 2025 21:52:35 +0100 Subject: [PATCH 72/96] ci: set fixed Rust version 1.85 Avoid CI failure due to new warnings or fmt changes in new Rust version. --- .github/workflows/MinedMap.yml | 11 +++++------ Dockerfile | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index 24895c9..16a3047 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: stable + toolchain: '1.85' components: rustfmt - run: cargo fmt --all -- --check @@ -58,7 +58,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: stable + toolchain: '1.85' components: clippy - uses: swatinem/rust-cache@v2 - uses: actions-rs/clippy-check@v1 @@ -72,7 +72,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: stable + toolchain: '1.85' components: rust-docs - uses: swatinem/rust-cache@v2 - run: cargo doc --workspace --no-deps --document-private-items @@ -83,12 +83,11 @@ 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: ${{ matrix.rust }} + toolchain: '1.85' - uses: swatinem/rust-cache@v2 - run: cargo test --workspace - run: cargo test --workspace --no-default-features @@ -128,7 +127,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: - toolchain: stable + toolchain: '1.85' targets: '${{ matrix.target }}' - uses: swatinem/rust-cache@v2 diff --git a/Dockerfile b/Dockerfile index 0f0eecd..41d4c6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/library/rust:alpine AS builder +FROM docker.io/library/rust:1.85-alpine AS builder WORKDIR /build RUN apk add --no-cache build-base tini-static From d6cd0fc53bd42209b204311eee0e334e80aaf970 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Mar 2025 12:19:39 +0100 Subject: [PATCH 73/96] ci: include target in cache key Avoid cache keys colliding between build jobs running on the same OS. --- .github/workflows/MinedMap.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index 16a3047..40ea96a 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -131,6 +131,8 @@ jobs: targets: '${{ matrix.target }}' - uses: swatinem/rust-cache@v2 + with: + key: '${{ matrix.target }}' - name: 'Build' shell: 'bash' From e600a9dabb27857f729f97e89e7866b084fef72a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Mar 2025 16:24:22 +0100 Subject: [PATCH 74/96] CHANGELOG.md: mention Bincode update While the update is an internal change, it does affect the MSRV, so it should be mentioned in the changelog. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b7e35..089e28a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,11 @@ "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 From dca365f4e23f7427571bfe943437a65cd48fc864 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Mar 2025 16:29:23 +0100 Subject: [PATCH 75/96] CHANGELOG.md: mention new Docker images and docker-compose example --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 089e28a..4f5c5bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,11 @@ 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 From 6a54f57c509c6455371b0594b32a353920270fa2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Mar 2025 20:02:13 +0100 Subject: [PATCH 76/96] minedmap-types 0.2.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/nbt/Cargo.toml | 2 +- crates/types/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4f5bfa2..80766f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -720,7 +720,7 @@ dependencies = [ [[package]] name = "minedmap-types" -version = "0.1.4" +version = "0.2.0" dependencies = [ "bincode", "itertools", diff --git a/Cargo.toml b/Cargo.toml index 0051203..854a955 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,7 @@ lru = "0.13.0" minedmap-default-alloc = { version = "0.1.0", path = "crates/default-alloc", optional = true } minedmap-nbt = { version = "0.1.1", path = "crates/nbt", default-features = false } minedmap-resource = { version = "0.6.0", path = "crates/resource" } -minedmap-types = { version = "0.1.4", path = "crates/types" } +minedmap-types = { version = "0.2.0", path = "crates/types" } notify = "8.0.0" num-integer = "0.1.45" num_cpus = "1.16.0" diff --git a/crates/nbt/Cargo.toml b/crates/nbt/Cargo.toml index 01bbd78..6a4938e 100644 --- a/crates/nbt/Cargo.toml +++ b/crates/nbt/Cargo.toml @@ -12,7 +12,7 @@ anyhow = "1.0.75" bytemuck = "1.13.1" fastnbt = "2.4.4" flate2 = "1.1.0" -minedmap-types = { version = "0.1.4", path = "../types" } +minedmap-types = { version = "0.2.0", path = "../types" } serde = "1.0.183" [dev-dependencies] diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index 2b83c39..34caa1c 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-types" -version = "0.1.4" +version = "0.2.0" description = "Common types used by several MinedMap crates" edition.workspace = true license.workspace = true From 54ea2b2f2898a272be3ea4841d68081f9d1ff53d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Mar 2025 20:02:36 +0100 Subject: [PATCH 77/96] minedmap-resource 0.7.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/resource/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80766f4..d5159bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -711,7 +711,7 @@ dependencies = [ [[package]] name = "minedmap-resource" -version = "0.6.0" +version = "0.7.0" dependencies = [ "bincode", "enumflags2", diff --git a/Cargo.toml b/Cargo.toml index 854a955..33256e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ indexmap = "2.0.0" lru = "0.13.0" minedmap-default-alloc = { version = "0.1.0", path = "crates/default-alloc", optional = true } minedmap-nbt = { version = "0.1.1", path = "crates/nbt", default-features = false } -minedmap-resource = { version = "0.6.0", path = "crates/resource" } +minedmap-resource = { version = "0.7.0", path = "crates/resource" } minedmap-types = { version = "0.2.0", path = "crates/types" } notify = "8.0.0" num-integer = "0.1.45" diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index 9fc157c..1257a90 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-resource" -version = "0.6.0" +version = "0.7.0" description = "Data describing Minecraft biomes and block types" edition.workspace = true license.workspace = true From 974a0f37df6dab8d0ca529a78bb6615e57ed05db Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Mar 2025 20:02:49 +0100 Subject: [PATCH 78/96] minedmap-nbt 0.2.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/nbt/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d5159bf..726fd48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -698,7 +698,7 @@ dependencies = [ [[package]] name = "minedmap-nbt" -version = "0.1.1" +version = "0.2.0" dependencies = [ "anyhow", "bytemuck", diff --git a/Cargo.toml b/Cargo.toml index 33256e6..9b87ed1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ image = { version = "0.25.1", default-features = false, features = ["png", "webp indexmap = "2.0.0" lru = "0.13.0" minedmap-default-alloc = { version = "0.1.0", path = "crates/default-alloc", optional = true } -minedmap-nbt = { version = "0.1.1", path = "crates/nbt", default-features = false } +minedmap-nbt = { version = "0.2.0", path = "crates/nbt", default-features = false } minedmap-resource = { version = "0.7.0", path = "crates/resource" } minedmap-types = { version = "0.2.0", path = "crates/types" } notify = "8.0.0" diff --git a/crates/nbt/Cargo.toml b/crates/nbt/Cargo.toml index 6a4938e..07a5fd7 100644 --- a/crates/nbt/Cargo.toml +++ b/crates/nbt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-nbt" -version = "0.1.1" +version = "0.2.0" description = "MinedMap's handling of Minecraft NBT data and region files" edition.workspace = true license.workspace = true From 6e5b958912be6e8c3e64d94c8b30d565847ced7f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 16 Mar 2025 12:17:07 +0100 Subject: [PATCH 79/96] default-alloc: fix wildcard dependency --- crates/default-alloc/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/default-alloc/Cargo.toml b/crates/default-alloc/Cargo.toml index 40f9e7e..b03a871 100644 --- a/crates/default-alloc/Cargo.toml +++ b/crates/default-alloc/Cargo.toml @@ -11,7 +11,7 @@ repository.workspace = true tikv-jemallocator = { version = "0.6.0", optional = true } [target.'cfg(target_env = "musl")'.dependencies] -tikv-jemallocator = "*" +tikv-jemallocator = "0.6.0" [features] jemalloc = ["dep:tikv-jemallocator"] From 3008203080e2ae44f2eea35121d8ae790f219dc0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 16 Mar 2025 12:24:29 +0100 Subject: [PATCH 80/96] minedmap 2.5.0 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f5c5bd..482d462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] - ReleaseDate +## [2.5.0] - 2025-03-16 + ### Added - Added experimental watch mode @@ -186,7 +188,8 @@ intermediate data. Full support for custom biomes datapacks might be added in a future release. -[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.4.0...HEAD +[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.5.0...HEAD +[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 diff --git a/Cargo.lock b/Cargo.lock index 726fd48..6b6d6ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -656,7 +656,7 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minedmap" -version = "2.4.0" +version = "2.5.0" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index 9b87ed1..34e5619 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ pre-release-commit-message = "{{crate_name}} {{version}}" [package] name = "minedmap" -version = "2.4.0" +version = "2.5.0" description = "Generate browsable maps from Minecraft save data" edition.workspace = true license.workspace = true From 23b2f274be781fe20b24d778adb36595923be725 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 2 Apr 2025 19:04:15 +0200 Subject: [PATCH 81/96] ci, docker: update to Rust 1.85.1 --- .github/workflows/MinedMap.yml | 10 +++++----- Dockerfile | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index 40ea96a..ece4e50 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85' + toolchain: '1.85.1' components: rustfmt - run: cargo fmt --all -- --check @@ -58,7 +58,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85' + toolchain: '1.85.1' components: clippy - uses: swatinem/rust-cache@v2 - uses: actions-rs/clippy-check@v1 @@ -72,7 +72,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85' + toolchain: '1.85.1' components: rust-docs - uses: swatinem/rust-cache@v2 - run: cargo doc --workspace --no-deps --document-private-items @@ -87,7 +87,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85' + toolchain: '1.85.1' - uses: swatinem/rust-cache@v2 - run: cargo test --workspace - run: cargo test --workspace --no-default-features @@ -127,7 +127,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85' + toolchain: '1.85.1' targets: '${{ matrix.target }}' - uses: swatinem/rust-cache@v2 diff --git a/Dockerfile b/Dockerfile index 41d4c6c..ad36c79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/library/rust:1.85-alpine AS builder +FROM docker.io/library/rust:1.85.1-alpine AS builder WORKDIR /build RUN apk add --no-cache build-base tini-static From 442009eb0804891fdca520edbbbb61dabb12ef2e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 2 Apr 2025 19:05:52 +0200 Subject: [PATCH 82/96] Update dependencies --- Cargo.lock | 105 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 71 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b6d6ff..d9f14f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -161,9 +161,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.2.16" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "jobserver", "libc", @@ -184,9 +184,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" dependencies = [ "clap_builder", "clap_derive", @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" dependencies = [ "anstream", "anstyle", @@ -360,9 +360,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", "libz-rs-sys", @@ -371,9 +371,9 @@ dependencies = [ [[package]] name = "foldhash" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "fsevent-sys" @@ -421,6 +421,18 @@ dependencies = [ "slab", ] +[[package]] +name = "getrandom" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + [[package]] name = "gimli" version = "0.31.1" @@ -449,9 +461,9 @@ dependencies = [ [[package]] name = "glam" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fcdf9683c406c2fc4d124afd29c0d595e22210d633cbdb8695ba9935ab1dc6" +checksum = "bf3aa70d918d2b234126ff4f850f628f172542bf0603ded26b8ee36e5e22d5f9" [[package]] name = "hashbrown" @@ -484,9 +496,9 @@ checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" [[package]] name = "image" -version = "0.25.5" +version = "0.25.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" +checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" dependencies = [ "bytemuck", "byteorder-lite", @@ -558,10 +570,11 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom", "libc", ] @@ -610,18 +623,18 @@ dependencies = [ [[package]] name = "libz-rs-sys" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "902bc563b5d65ad9bba616b490842ef0651066a1a1dc3ce1087113ffcb873c8d" +checksum = "6489ca9bd760fe9642d7644e827b0c9add07df89857b0416ee15c1cc1a3b8c5a" dependencies = [ "zlib-rs", ] [[package]] name = "linux-raw-sys" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" [[package]] name = "lock_api" @@ -635,9 +648,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lru" @@ -744,7 +757,7 @@ checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -822,9 +835,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "overload" @@ -952,6 +965,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "rand" version = "0.8.5" @@ -1039,9 +1058,9 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustix" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" dependencies = [ "bitflags 2.9.0", "errno", @@ -1325,6 +1344,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[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", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1439,10 +1467,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "zlib-rs" -version = "0.4.2" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b20717f0917c908dc63de2e44e97f1e6b126ca58d0e391cee86d504eb8fbd05" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "zlib-rs" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "868b928d7949e09af2f6086dfc1e01936064cc7a819253bce650d4e2a2d63ba8" [[package]] name = "zstd" @@ -1455,18 +1492,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.2.3" +version = "7.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.14+zstd.1.5.7" +version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ "cc", "pkg-config", From ba6e4bae7f072c697e1d204955f72ed2a6bbb148 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 2 Apr 2025 22:39:26 +0200 Subject: [PATCH 83/96] world: rename JSONText to TextValue New Minecraft version do not store text as JSON anymore. --- src/world/de.rs | 12 ++++++------ src/world/mod.rs | 2 +- src/world/sign.rs | 4 ++-- src/world/{json_text.rs => text_value.rs} | 22 +++++++++++----------- 4 files changed, 20 insertions(+), 20 deletions(-) rename src/world/{json_text.rs => text_value.rs} (93%) diff --git a/src/world/de.rs b/src/world/de.rs index 7ab8ba7..0a4b4b6 100644 --- a/src/world/de.rs +++ b/src/world/de.rs @@ -2,7 +2,7 @@ use serde::Deserialize; -use super::json_text::JSONText; +use super::text_value::TextValue; /// 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: JSONText, + text1: TextValue, /// Line 2 of the sign text - text2: JSONText, + text2: TextValue, /// Line 3 of the sign text - text3: JSONText, + text3: TextValue, /// Line 4 of the sign text - text4: JSONText, + text4: TextValue, /// Default text color color: Option, }, diff --git a/src/world/mod.rs b/src/world/mod.rs index 6426c92..8a2e9be 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/sign.rs b/src/world/sign.rs index 579f5b3..c913b6f 100644 --- a/src/world/sign.rs +++ b/src/world/sign.rs @@ -8,7 +8,7 @@ use serde::Serialize; use super::{ de, - json_text::{FormattedText, FormattedTextList, JSONText}, + text_value::{FormattedText, FormattedTextList, TextValue}, }; /// Version-independent reference to (front or back) sign text @@ -18,7 +18,7 @@ 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 JSONText>, + pub messages: Vec<&'a TextValue>, /// Sign color /// /// Defaults to "black". diff --git a/src/world/json_text.rs b/src/world/text_value.rs similarity index 93% rename from src/world/json_text.rs rename to src/world/text_value.rs index 7d3ff3a..336b1b1 100644 --- a/src/world/json_text.rs +++ b/src/world/text_value.rs @@ -1,4 +1,4 @@ -//! Newtype and helper methods for handling Minecraft Raw JSON Text +//! Newtype and helper methods for handling Minecraft text values use std::{collections::VecDeque, fmt::Display}; @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; /// A span of formatted text /// -/// A [JSONText] consists of a tree of [FormattedText] nodes (canonically +/// A [TextValue] consists of a tree of [FormattedText] nodes (canonically /// represented as a [FormattedTextTree], but other kinds are possible with /// is handled by [DeserializedText]. /// @@ -21,7 +21,7 @@ pub struct FormattedText { /// Text content pub text: String, /// Text color - #[serde(skip_serializing_if = "Option::is_none", with = "json_color")] + #[serde(skip_serializing_if = "Option::is_none", with = "text_color")] pub color: Option, /// Bold formatting #[serde(skip_serializing_if = "Option::is_none")] @@ -107,9 +107,9 @@ impl Display for FormattedTextList { } } -/// Raw deserialized [JSONText] +/// Raw deserialized [TextValue] /// -/// A [JSONText] can contain various different JSON types. +/// A [TextValue] can contain various different types serialized as JSON or NBT. #[derive(Debug, Deserialize)] #[serde(untagged)] pub enum DeserializedText { @@ -169,18 +169,18 @@ impl Default for DeserializedText { } } -/// Minecraft Raw JSON Text +/// Minecraft raw text value #[derive(Debug, Deserialize)] -pub struct JSONText(pub String); +pub struct TextValue(pub String); -impl JSONText { - /// Deserializes a [JSONText] into a [DeserializedText] +impl TextValue { + /// Deserializes a [TextValue] into a [DeserializedText] pub fn deserialize(&self) -> DeserializedText { serde_json::from_str(&self.0).unwrap_or_default() } } -mod json_color { +mod text_color { //! Helpers for serializing and deserializing [FormattedText](super::FormattedText) colors use minedmap_resource::Color; @@ -190,7 +190,7 @@ mod json_color { ser::Error as _, }; - /// Named JSON text colors + /// Named text colors static COLORS: phf::Map<&'static str, Color> = phf::phf_map! { "black" => Color([0x00, 0x00, 0x00]), "dark_blue" => Color([0x00, 0x00, 0xAA]), From 5f84ec8ed2c4701c24032bac0ee45175f2904ddc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 2 Apr 2025 22:43:02 +0200 Subject: [PATCH 84/96] world/text_value: add support for new NBT text serialization Starting with DataVersion 4290, text is stored as NBT instead of JSON. The structure remains the same. --- src/world/block_entity.rs | 19 ++++++++++++++----- src/world/chunk.rs | 9 ++++++++- src/world/sign.rs | 4 ++-- src/world/text_value.rs | 14 +++++++++++--- 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/world/block_entity.rs b/src/world/block_entity.rs index 6ad58a1..589a53c 100644 --- a/src/world/block_entity.rs +++ b/src/world/block_entity.rs @@ -41,10 +41,15 @@ pub struct Sign { impl Sign { /// Processes a [de::BlockEntitySign] into a [Sign] - fn new(sign: &de::BlockEntitySign, kind: SignKind, material: Option) -> Sign { + fn new( + sign: &de::BlockEntitySign, + kind: SignKind, + material: Option, + data_version: u32, + ) -> Sign { let (front_text, back_text) = sign.text(); - let front_text = front_text.decode(); - let back_text = back_text.decode(); + let front_text = front_text.decode(data_version); + let back_text = back_text.decode(data_version); Sign { kind, material, @@ -78,7 +83,11 @@ pub struct BlockEntity { impl BlockEntity { /// Processes a [de::BlockEntity] into a [BlockEntity] - pub fn new(entity: &de::BlockEntity, block_type: Option<&BlockType>) -> Option { + pub fn new( + entity: &de::BlockEntity, + block_type: Option<&BlockType>, + data_version: u32, + ) -> Option { let wall_sign = block_type .map(|block_type| block_type.block_color.is(BlockFlag::WallSign)) .unwrap_or_default(); @@ -92,7 +101,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())); + let data = BlockEntityData::Sign(Sign::new(sign, kind, material.cloned(), data_version)); Some(BlockEntity { x: entity.x, diff --git a/src/world/chunk.rs b/src/world/chunk.rs index c4744d0..311fca8 100644 --- a/src/world/chunk.rs +++ b/src/world/chunk.rs @@ -58,6 +58,8 @@ pub struct Chunk<'a> { inner: ChunkInner<'a>, /// Unprocessed block entities block_entities: &'a Vec, + /// Chunk data version + data_version: u32, } impl<'a> Chunk<'a> { @@ -87,6 +89,7 @@ impl<'a> Chunk<'a> { Chunk { inner, block_entities, + data_version, }, has_unknown, )) @@ -292,7 +295,11 @@ 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)) + Ok(BlockEntity::new( + block_entity, + block_type, + self.data_version, + )) }) .collect::>()?; Ok(entities.into_iter().flatten().collect()) diff --git a/src/world/sign.rs b/src/world/sign.rs index c913b6f..8e4e670 100644 --- a/src/world/sign.rs +++ b/src/world/sign.rs @@ -49,7 +49,7 @@ static DYE_COLORS: phf::Map<&'static str, Color> = phf::phf_map! { impl RawSignText<'_> { /// Decodes the [RawSignText] into a [SignText] - pub fn decode(&self) -> SignText { + pub fn decode(&self, data_version: u32) -> SignText { let color = self .color .map(|c| DYE_COLORS.get(c).copied().unwrap_or(DEFAULT_COLOR)); @@ -60,7 +60,7 @@ impl RawSignText<'_> { SignText( self.messages .iter() - .map(|message| message.deserialize().linearize(&parent)) + .map(|message| message.deserialize(data_version).linearize(&parent)) .collect(), ) } diff --git a/src/world/text_value.rs b/src/world/text_value.rs index 336b1b1..75defc4 100644 --- a/src/world/text_value.rs +++ b/src/world/text_value.rs @@ -171,12 +171,20 @@ impl Default for DeserializedText { /// Minecraft raw text value #[derive(Debug, Deserialize)] -pub struct TextValue(pub String); +pub struct TextValue(pub fastnbt::Value); impl TextValue { /// Deserializes a [TextValue] into a [DeserializedText] - pub fn deserialize(&self) -> DeserializedText { - serde_json::from_str(&self.0).unwrap_or_default() + pub fn deserialize(&self, data_version: u32) -> DeserializedText { + if data_version < 4290 { + if let fastnbt::Value::String(json) = &self.0 { + if let Ok(content) = serde_json::from_str(json) { + return content; + } + } + } + + fastnbt::from_value(&self.0).unwrap_or_default() } } From 42b302f493a0824efa912fb8c56cf16c19adc266 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 2 Apr 2025 19:05:09 +0200 Subject: [PATCH 85/96] resource: add new Minecraft 1.21.5 block types --- CHANGELOG.md | 6 ++ crates/resource/src/block_types.rs | 90 ++++++++++++++++++++++++++++++ resource/blocks.json | 11 ++++ src/core/common.rs | 4 +- 4 files changed, 109 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 482d462..f96ddca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] - ReleaseDate +### Added + +- Added support for Minecraft 1.21.5 + + Added new block types and handling for changed sign text storage format. + ## [2.5.0] - 2025-03-16 ### Added diff --git a/crates/resource/src/block_types.rs b/crates/resource/src/block_types.rs index da556b8..044a153 100644 --- a/crates/resource/src/block_types.rs +++ b/crates/resource/src/block_types.rs @@ -1488,6 +1488,16 @@ 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 { @@ -1498,6 +1508,16 @@ 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 { @@ -3808,6 +3828,16 @@ 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 { @@ -4878,6 +4908,16 @@ 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 { @@ -8698,6 +8738,16 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ sign_material: None, }, ), + ( + "short_dry_grass", + ConstBlockType { + block_color: BlockColor { + flags: make_bitflags!(BlockFlag::{Opaque}), + color: Color([187, 158, 108]), + }, + sign_material: None, + }, + ), ( "short_grass", ConstBlockType { @@ -9638,6 +9688,16 @@ 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 { @@ -9678,6 +9738,26 @@ 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 { @@ -10828,6 +10908,16 @@ 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/resource/blocks.json b/resource/blocks.json index a409abb..caf6f8a 100644 --- a/resource/blocks.json +++ b/resource/blocks.json @@ -316,9 +316,13 @@ "bubble_coral_fan": null, "bubble_coral_wall_fan": null, "budding_amethyst": {}, + "bush": { + "grass": true + }, "cactus": { "texture": "cactus_top" }, + "cactus_flower": {}, "cake": { "texture": "cake_top" }, @@ -778,6 +782,7 @@ "fire_coral_block": {}, "fire_coral_fan": null, "fire_coral_wall_fan": null, + "firefly_bush": {}, "fletching_table": { "texture": "fletching_table_top" }, @@ -987,6 +992,7 @@ "lava_cauldron": { "texture": "cauldron_top" }, + "leaf_litter": null, "lectern": { "texture": "lectern_top" }, @@ -1782,6 +1788,7 @@ "sea_lantern": {}, "sea_pickle": {}, "seagrass": {}, + "short_dry_grass": {}, "short_grass": null, "shroomlight": {}, "shulker_box": {}, @@ -2013,6 +2020,7 @@ "sweet_berry_bush": { "texture": "sweet_berry_bush_stage3" }, + "tall_dry_grass": {}, "tall_grass": { "grass": true, "texture": "tall_grass_top" @@ -2024,6 +2032,8 @@ "texture": "target_top" }, "terracotta": {}, + "test_block": null, + "test_instance_block": null, "tinted_glass": {}, "tnt": { "texture": "tnt_top" @@ -2288,6 +2298,7 @@ "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/src/core/common.rs b/src/core/common.rs index 06a3277..d285f4c 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -26,7 +26,7 @@ use crate::{ /// /// 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(6); +pub const REGION_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(7); /// MinedMap map tile data version number /// @@ -38,7 +38,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(4); +pub const LIGHTMAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(5); /// MinedMap mipmap data version number /// From 69b62576ea805c2674144f5f600ad00fecdbb111 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Apr 2025 18:37:36 +0200 Subject: [PATCH 86/96] world/chunk: fix new Rust 1.86 clippy warning --- src/world/chunk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/chunk.rs b/src/world/chunk.rs index 311fca8..aadf882 100644 --- a/src/world/chunk.rs +++ b/src/world/chunk.rs @@ -419,7 +419,7 @@ impl<'a> Iterator for SectionIter<'a> { } fn last(mut self) -> Option { - self.with_iter(|iter| iter.last()) + self.next_back() } } From dd56e842b526774aa0d1bba035b7da6d7cdd57e9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Apr 2025 18:31:41 +0200 Subject: [PATCH 87/96] ci: update to Rust 1.86 There is no official 1.86 Docker image yet. --- .github/workflows/MinedMap.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index ece4e50..4dbb5d2 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85.1' + toolchain: '1.86' components: rustfmt - run: cargo fmt --all -- --check @@ -58,7 +58,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85.1' + toolchain: '1.86' components: clippy - uses: swatinem/rust-cache@v2 - uses: actions-rs/clippy-check@v1 @@ -72,7 +72,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85.1' + toolchain: '1.86' components: rust-docs - uses: swatinem/rust-cache@v2 - run: cargo doc --workspace --no-deps --document-private-items @@ -87,7 +87,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85.1' + toolchain: '1.86' - uses: swatinem/rust-cache@v2 - run: cargo test --workspace - run: cargo test --workspace --no-default-features @@ -127,7 +127,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.85.1' + toolchain: '1.86' targets: '${{ matrix.target }}' - uses: swatinem/rust-cache@v2 From ca880ab3b457a12f775e83a43b3ede5804f7bc63 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Apr 2025 18:26:49 +0200 Subject: [PATCH 88/96] world/text_value: do not fall back to NBT deserialization after DataVersion 4290 An invalid JSON string should not be emitted verbatim; ignore the content instead. Also increment entity meta version, which had been forgotten in the previous commit. --- src/core/common.rs | 2 +- src/world/text_value.rs | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/core/common.rs b/src/core/common.rs index d285f4c..45b541c 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -48,7 +48,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(2); +pub const ENTITIES_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(3); /// Coordinate pair of a generated tile /// diff --git a/src/world/text_value.rs b/src/world/text_value.rs index 75defc4..3de6593 100644 --- a/src/world/text_value.rs +++ b/src/world/text_value.rs @@ -176,15 +176,20 @@ pub struct TextValue(pub fastnbt::Value); 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 { - if let fastnbt::Value::String(json) = &self.0 { - if let Ok(content) = serde_json::from_str(json) { - return content; - } - } - } + let fastnbt::Value::String(json) = &self.0 else { + return DeserializedText::default(); + }; - fastnbt::from_value(&self.0).unwrap_or_default() + serde_json::from_str(json).unwrap_or_default() + } else { + fastnbt::from_value(&self.0).unwrap_or_default() + } } } From ec4fd7986497f9d1e03626c4044ebf07cd561271 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 Jun 2025 17:04:15 +0200 Subject: [PATCH 89/96] Update dependencies --- Cargo.lock | 394 ++++++++++++++++++++++++++++++----------------------- Cargo.toml | 4 +- 2 files changed, 228 insertions(+), 170 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9f14f8..8187256 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" @@ -34,9 +34,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -49,56 +49,56 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "once_cell", + "once_cell_polyfill", "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", "cfg-if", @@ -106,7 +106,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -137,15 +137,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bytemuck" -version = "1.22.0" +version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" [[package]] name = "byteorder" @@ -161,9 +161,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.2.17" +version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ "jobserver", "libc", @@ -178,15 +178,15 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "clap" -version = "4.5.35" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", "clap_derive", @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.35" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", @@ -207,9 +207,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.32" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" dependencies = [ "heck", "proc-macro2", @@ -219,15 +219,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "crc32fast" @@ -291,18 +291,18 @@ dependencies = [ [[package]] name = "enumflags2" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", @@ -317,12 +317,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -337,6 +337,12 @@ 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" @@ -360,9 +366,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", "libz-rs-sys", @@ -423,9 +429,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", @@ -461,15 +467,15 @@ dependencies = [ [[package]] name = "glam" -version = "0.30.1" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf3aa70d918d2b234126ff4f850f628f172542bf0603ded26b8ee36e5e22d5f9" +checksum = "50a99dbe56b72736564cfa4b85bf9a33079f16ae8b74983ab06af3b1a3696b11" [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ "allocator-api2", "equivalent", @@ -484,9 +490,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "humantime" @@ -509,9 +515,9 @@ dependencies = [ [[package]] name = "image-webp" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b77d01e822461baa8409e156015a1d91735549f0f2c17691bd2d996bef238f7f" +checksum = "f6970fe7a5300b4b42e62c52efa0187540a5bef546c60edaf554ef595d2e6f0b" dependencies = [ "byteorder-lite", "quick-error", @@ -519,9 +525,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.8.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown", @@ -533,7 +539,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "inotify-sys", "libc", ] @@ -580,9 +586,9 @@ dependencies = [ [[package]] name = "kqueue" -version = "1.0.8" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" +checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" dependencies = [ "kqueue-sys", "libc", @@ -606,41 +612,41 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "libc", "redox_syscall", ] [[package]] name = "libz-rs-sys" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6489ca9bd760fe9642d7644e827b0c9add07df89857b0416ee15c1cc1a3b8c5a" +checksum = "172a788537a2221661b480fee8dc5f96c580eb34fa88764d3205dc356c7e4221" dependencies = [ "zlib-rs", ] [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -654,18 +660,18 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lru" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "227748d55f2f0ab4735d87fd623798cb6b664512fe979705f829c9f81c934465" +checksum = "0281c2e25e62316a5c9d98f2d2e9e95a37841afdaf4383c177dbb5c1dfab0568" dependencies = [ "hashbrown", ] [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "minedmap" @@ -741,9 +747,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", "simd-adler32", @@ -751,14 +757,14 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -767,7 +773,7 @@ version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "filetime", "fsevent-sys", "inotify", @@ -816,9 +822,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ "hermit-abi", "libc", @@ -839,6 +845,12 @@ version = "1.21.3" 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" + [[package]] name = "overload" version = "0.1.1" @@ -847,9 +859,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -857,42 +869,43 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] name = "phf" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7" dependencies = [ "phf_macros", "phf_shared", + "serde", ] [[package]] name = "phf_generator" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +checksum = "2cbb1126afed61dd6368748dae63b1ee7dc480191c6262a3b4ff1e29d86a6c5b" dependencies = [ + "fastrand", "phf_shared", - "rand", ] [[package]] name = "phf_macros" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +checksum = "d713258393a82f091ead52047ca779d37e5766226d009de21696c4e667044368" dependencies = [ "phf_generator", "phf_shared", @@ -903,9 +916,9 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981" dependencies = [ "siphasher", ] @@ -943,9 +956,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -967,24 +980,9 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rayon" @@ -1008,11 +1006,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.10" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", ] [[package]] @@ -1046,9 +1044,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustc-hash" @@ -1058,11 +1056,11 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustix" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "errno", "libc", "linux-raw-sys", @@ -1160,18 +1158,15 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "strsim" @@ -1181,9 +1176,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.100" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -1202,12 +1197,11 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -1232,9 +1226,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.1" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "parking_lot", @@ -1254,9 +1248,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", @@ -1265,9 +1259,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -1340,9 +1334,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -1384,22 +1378,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", ] [[package]] @@ -1408,14 +1402,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "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", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +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", ] [[package]] @@ -1424,62 +1434,110 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.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" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "wit-bindgen-rt" version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", ] [[package]] name = "zlib-rs" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "868b928d7949e09af2f6086dfc1e01936064cc7a819253bce650d4e2a2d63ba8" +checksum = "626bd9fa9734751fc50d6060752170984d7053f5a39061f524cda68023d4db8a" [[package]] name = "zstd" diff --git a/Cargo.toml b/Cargo.toml index 34e5619..2f7a483 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ 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.13.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.7.0", path = "crates/resource" } @@ -56,7 +56,7 @@ minedmap-types = { version = "0.2.0", path = "crates/types" } notify = "8.0.0" num-integer = "0.1.45" num_cpus = "1.16.0" -phf = { version = "0.11.2", features = ["macros"] } +phf = { version = "0.12.1", features = ["macros"] } rayon = "1.7.0" regex = "1.10.2" rustc-hash = "2.0.0" From 64e7375f2fe171d5d9226f5ab6b938c5316aa198 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 Jun 2025 17:05:59 +0200 Subject: [PATCH 90/96] Fix 1.88.0 clippy warnings --- crates/nbt/examples/nbtdump.rs | 2 +- crates/nbt/examples/regiondump.rs | 2 +- crates/nbt/src/region.rs | 6 +++--- src/core/common.rs | 4 ++-- src/core/region_processor.rs | 11 ++++------- src/core/tile_renderer.rs | 6 +++--- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/crates/nbt/examples/nbtdump.rs b/crates/nbt/examples/nbtdump.rs index 66aaa2a..8b61693 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!("{:#x?}", value); + println!("{value:#x?}"); Ok(()) } diff --git a/crates/nbt/examples/regiondump.rs b/crates/nbt/examples/regiondump.rs index 9315022..7cece8c 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 {:?}: {:#x?}", coords, value); + println!("Chunk {coords:?}: {value:#x?}"); Ok(()) }, ) diff --git a/crates/nbt/src/region.rs b/crates/nbt/src/region.rs index 1325919..6a79a39 100644 --- a/crates/nbt/src/region.rs +++ b/crates/nbt/src/region.rs @@ -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/src/core/common.rs b/src/core/common.rs index 45b541c..3f3e69d 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -237,7 +237,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,7 +275,7 @@ 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() } diff --git a/src/core/region_processor.rs b/src/core/region_processor.rs index e638342..74939bd 100644 --- a/src/core/region_processor.rs +++ b/src/core/region_processor.rs @@ -228,7 +228,7 @@ impl<'a> SingleRegionProcessor<'a> { ) -> 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))?; + .with_context(|| format!("Failed to decode chunk {chunk_coords:?}"))?; data.has_unknown |= has_unknown; if self.output_needed || self.lightmap_needed { @@ -238,7 +238,7 @@ impl<'a> SingleRegionProcessor<'a> { block_light, depths, }) = world::layer::top_layer(&mut data.biome_list, &chunk) - .with_context(|| format!("Failed to process chunk {:?}", chunk_coords))? + .with_context(|| format!("Failed to process chunk {chunk_coords:?}"))? { if self.output_needed { data.chunks[chunk_coords] = Some(Box::new(ProcessedChunk { @@ -257,10 +257,7 @@ impl<'a> SingleRegionProcessor<'a> { 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); } @@ -407,7 +404,7 @@ impl<'a> RegionProcessor<'a> { 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 { region_send.send(coords).unwrap(); diff --git a/src/core/tile_renderer.rs b/src/core/tile_renderer.rs index 9d7e188..0b534b8 100644 --- a/src/core/tile_renderer.rs +++ b/src/core/tile_renderer.rs @@ -249,7 +249,7 @@ impl<'a> TileRenderer<'a> { .filter(|entry| self.region_set.contains(entry)) }) .try_map(|entry| self.processed_source(entry)) - .with_context(|| format!("Region {:?} from previous step must exist", coords))?; + .with_context(|| format!("Region {coords:?} from previous step must exist"))?; let max_timestamp = *sources .iter() @@ -293,7 +293,7 @@ impl<'a> TileRenderer<'a> { let region_group = self .rt .block_on(self.load_region_group(processed_paths)) - .with_context(|| format!("Region {:?} from previous step must be loadable", coords))?; + .with_context(|| format!("Region {coords:?} from previous step must be loadable"))?; let mut image = image::RgbaImage::new(N, N); Self::render_region(&mut image, ®ion_group); @@ -325,7 +325,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))?; From 6a2f5356d90959a2d2664383975cee88fcdb930a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 Jun 2025 17:26:59 +0200 Subject: [PATCH 91/96] ci, docker: update to Rust 1.88.0 --- .github/workflows/MinedMap.yml | 10 +++++----- Dockerfile | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index 4dbb5d2..a0e58cf 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.86' + toolchain: '1.88' components: rustfmt - run: cargo fmt --all -- --check @@ -58,7 +58,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.86' + toolchain: '1.88' components: clippy - uses: swatinem/rust-cache@v2 - uses: actions-rs/clippy-check@v1 @@ -72,7 +72,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.86' + toolchain: '1.88' components: rust-docs - uses: swatinem/rust-cache@v2 - run: cargo doc --workspace --no-deps --document-private-items @@ -87,7 +87,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.86' + toolchain: '1.88' - uses: swatinem/rust-cache@v2 - run: cargo test --workspace - run: cargo test --workspace --no-default-features @@ -127,7 +127,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: - toolchain: '1.86' + toolchain: '1.88' targets: '${{ matrix.target }}' - uses: swatinem/rust-cache@v2 diff --git a/Dockerfile b/Dockerfile index ad36c79..4b9de31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/library/rust:1.85.1-alpine AS builder +FROM docker.io/library/rust:1.88.0-alpine AS builder WORKDIR /build RUN apk add --no-cache build-base tini-static From 19355d8f64732de0be43e736556f5814cfaa4159 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 Jun 2025 23:29:02 +0200 Subject: [PATCH 92/96] README.md: add link to minecraft_map_marker project --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 952163f..6402d21 100644 --- a/README.md +++ b/README.md @@ -120,3 +120,8 @@ cargo install --git 'https://github.com/neocturne/MinedMap.git' 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) From 04aeacbfd41a2b49c84d8cd5710406bf8e0d762a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 Jun 2025 23:53:56 +0200 Subject: [PATCH 93/96] resource: add Minecraft 1.21.6 Dried Ghast block type As Minecraft 1.21.7 is a hotfix release with no new block types or biomes, it is supported as well. --- CHANGELOG.md | 2 +- README.md | 2 +- crates/resource/src/block_types.rs | 10 ++++++++++ resource/blocks.json | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f96ddca..94dbb8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Added -- Added support for Minecraft 1.21.5 +- Added support for Minecraft 1.21.5 to 1.21.7 Added new block types and handling for changed sign text storage format. diff --git a/README.md b/README.md index 6402d21..cd30c8b 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.4 (no mod installation required!) +* Compatible with unmodified Minecraft Java Edition 1.8 up to 1.21.7 (no mod installation required!) * 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 diff --git a/crates/resource/src/block_types.rs b/crates/resource/src/block_types.rs index 044a153..9419690 100644 --- a/crates/resource/src/block_types.rs +++ b/crates/resource/src/block_types.rs @@ -3508,6 +3508,16 @@ 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 { diff --git a/resource/blocks.json b/resource/blocks.json index caf6f8a..15dae2b 100644 --- a/resource/blocks.json +++ b/resource/blocks.json @@ -720,6 +720,9 @@ "dragon_egg": {}, "dragon_head": null, "dragon_wall_head": null, + "dried_ghast": { + "texture": "dried_ghast_hydration_1_top" + }, "dried_kelp_block": { "texture": "dried_kelp_top" }, From 8278185c9c6dff03838423482321d39425eee4a5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 30 Jun 2025 22:00:59 +0200 Subject: [PATCH 94/96] core: update region and lightmap version The versions need to be updated for the new block type. --- src/core/common.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/common.rs b/src/core/common.rs index 3f3e69d..094d567 100644 --- a/src/core/common.rs +++ b/src/core/common.rs @@ -26,7 +26,7 @@ use crate::{ /// /// 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(7); +pub const REGION_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(8); /// MinedMap map tile data version number /// @@ -38,7 +38,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(5); +pub const LIGHTMAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(6); /// MinedMap mipmap data version number /// From 190b92b68d474db18a406146c0c2819439b274c4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 30 Jun 2025 22:07:55 +0200 Subject: [PATCH 95/96] minedmap-resource 0.8.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/resource/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8187256..953a4a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -730,7 +730,7 @@ dependencies = [ [[package]] name = "minedmap-resource" -version = "0.7.0" +version = "0.8.0" dependencies = [ "bincode", "enumflags2", diff --git a/Cargo.toml b/Cargo.toml index 2f7a483..39664f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ 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.7.0", path = "crates/resource" } +minedmap-resource = { version = "0.8.0", path = "crates/resource" } minedmap-types = { version = "0.2.0", path = "crates/types" } notify = "8.0.0" num-integer = "0.1.45" diff --git a/crates/resource/Cargo.toml b/crates/resource/Cargo.toml index 1257a90..b59492c 100644 --- a/crates/resource/Cargo.toml +++ b/crates/resource/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minedmap-resource" -version = "0.7.0" +version = "0.8.0" description = "Data describing Minecraft biomes and block types" edition.workspace = true license.workspace = true From f0ef6d318983580e99082822b965a68d585d4e16 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 30 Jun 2025 22:08:16 +0200 Subject: [PATCH 96/96] minedmap 2.6.0 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94dbb8b..f1f0234 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] - ReleaseDate +## [2.6.0] - 2025-06-30 + ### Added - Added support for Minecraft 1.21.5 to 1.21.7 @@ -194,7 +196,8 @@ intermediate data. Full support for custom biomes datapacks might be added in a future release. -[Unreleased]: https://github.com/neocturne/MinedMap/compare/v2.5.0...HEAD +[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 diff --git a/Cargo.lock b/Cargo.lock index 953a4a3..a000b9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -675,7 +675,7 @@ checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "minedmap" -version = "2.5.0" +version = "2.6.0" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index 39664f7..f0c2bc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ pre-release-commit-message = "{{crate_name}} {{version}}" [package] name = "minedmap" -version = "2.5.0" +version = "2.6.0" description = "Generate browsable maps from Minecraft save data" edition.workspace = true license.workspace = true