From 6379035b852f1b619565d27f5cee3b93042c2312 Mon Sep 17 00:00:00 2001 From: EightFactorial <29801334+EightFactorial@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:31:22 -0800 Subject: [PATCH] Update Bevy and migrate to workspace dependencies and package attributes (#181) * Use workspace `Cargo.toml` for dependencies and package atributes * Fix a couple clippy warnings * Update bevy, update build script, move deps to workspace, and fix clippy warnings * Remove carrots from crate versions The default behavior is the same * Remove unused dependencies Compiles and all tests pass, so it should be fine * Update codegen to use `std::sync::LazyLock` instead of `once_cell::sync::Lazy` * Update Bevy to `0.15.0-rc.3` Surprisingly little needed to be changed * Update to bevy 0.15.0 * Fix leftover merge issues * Clarify the reason the swarm can't connect * Fix duplicate lint, remove `log` dependency --- Cargo.lock | 482 ++++++++++++------ Cargo.toml | 53 +- azalea-auth/Cargo.toml | 12 +- azalea-block/Cargo.toml | 16 +- azalea-block/azalea-block-macros/Cargo.toml | 12 +- azalea-brigadier/Cargo.toml | 12 +- azalea-brigadier/tests/bevy_app_usage.rs | 16 +- azalea-buf/Cargo.toml | 12 +- azalea-buf/azalea-buf-macros/Cargo.toml | 11 +- azalea-chat/Cargo.toml | 16 +- azalea-client/Cargo.toml | 16 +- azalea-client/src/client.rs | 6 +- azalea-client/src/local_player.rs | 2 +- azalea-client/src/packet_handling/game.rs | 12 +- azalea-core/Cargo.toml | 12 +- azalea-crypto/Cargo.toml | 16 +- azalea-entity/Cargo.toml | 24 +- azalea-inventory/Cargo.toml | 23 +- .../azalea-inventory-macros/Cargo.toml | 12 +- azalea-language/Cargo.toml | 12 +- azalea-physics/Cargo.toml | 17 +- azalea-physics/src/lib.rs | 62 +-- azalea-protocol/Cargo.toml | 29 +- .../azalea-protocol-macros/Cargo.toml | 11 +- azalea-protocol/src/lib.rs | 2 +- azalea-protocol/src/read.rs | 2 +- azalea-registry/Cargo.toml | 12 +- .../azalea-registry-macros/Cargo.toml | 12 +- azalea-registry/src/tags/blocks.rs | 3 +- azalea-registry/src/tags/fluids.rs | 3 +- azalea-registry/src/tags/items.rs | 3 +- azalea-world/Cargo.toml | 18 +- azalea/Cargo.toml | 12 +- azalea/build.rs | 43 +- azalea/src/pathfinder/mod.rs | 2 +- azalea/src/pathfinder/simulation.rs | 16 +- azalea/src/swarm/chat.rs | 36 +- azalea/src/swarm/mod.rs | 14 +- codegen/lib/code/shapes.py | 3 +- codegen/lib/code/tags.py | 4 +- rust-toolchain | 1 - rust-toolchain.toml | 3 + 42 files changed, 616 insertions(+), 469 deletions(-) delete mode 100644 rust-toolchain create mode 100644 rust-toolchain.toml diff --git a/Cargo.lock b/Cargo.lock index 7240bb30..478d6042 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,6 +35,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "const-random", "getrandom", "once_cell", "version_check", @@ -129,6 +130,17 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a30a44e99a1c83ccb2a6298c563c888952a1c9134953db26876528f84c93a" +[[package]] +name = "assert_type_match" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f548ad2c4031f2902e3edc1f29c29e835829437de49562d8eb5dc5584d3a1043" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "async-channel" version = "2.3.1" @@ -190,7 +202,7 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "azalea" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "anyhow", "azalea-auth", @@ -229,7 +241,7 @@ dependencies = [ [[package]] name = "azalea-auth" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-buf", "azalea-crypto", @@ -249,7 +261,7 @@ dependencies = [ [[package]] name = "azalea-block" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-block-macros", "azalea-buf", @@ -258,7 +270,7 @@ dependencies = [ [[package]] name = "azalea-block-macros" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "proc-macro2", "quote", @@ -267,7 +279,7 @@ dependencies = [ [[package]] name = "azalea-brigadier" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-buf", "azalea-chat", @@ -278,7 +290,7 @@ dependencies = [ [[package]] name = "azalea-buf" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-buf-macros", "byteorder", @@ -291,7 +303,7 @@ dependencies = [ [[package]] name = "azalea-buf-macros" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "proc-macro2", "quote", @@ -300,7 +312,7 @@ dependencies = [ [[package]] name = "azalea-chat" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-buf", "azalea-language", @@ -313,7 +325,7 @@ dependencies = [ [[package]] name = "azalea-client" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "anyhow", "azalea-auth", @@ -347,7 +359,7 @@ dependencies = [ [[package]] name = "azalea-core" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-buf", "azalea-registry", @@ -361,7 +373,7 @@ dependencies = [ [[package]] name = "azalea-crypto" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "aes", "azalea-buf", @@ -378,7 +390,7 @@ dependencies = [ [[package]] name = "azalea-entity" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-block", "azalea-buf", @@ -401,7 +413,7 @@ dependencies = [ [[package]] name = "azalea-inventory" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-buf", "azalea-chat", @@ -414,7 +426,7 @@ dependencies = [ [[package]] name = "azalea-inventory-macros" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "proc-macro2", "quote", @@ -423,7 +435,7 @@ dependencies = [ [[package]] name = "azalea-language" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "serde", "serde_json", @@ -431,7 +443,7 @@ dependencies = [ [[package]] name = "azalea-physics" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-block", "azalea-core", @@ -441,13 +453,14 @@ dependencies = [ "azalea-world", "bevy_app", "bevy_ecs", + "bevy_time", "parking_lot", "uuid", ] [[package]] name = "azalea-protocol" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "anyhow", "async-recursion", @@ -468,7 +481,6 @@ dependencies = [ "flate2", "futures", "futures-lite", - "log", "serde", "serde_json", "simdnbt", @@ -484,7 +496,7 @@ dependencies = [ [[package]] name = "azalea-protocol-macros" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "proc-macro2", "quote", @@ -493,7 +505,7 @@ dependencies = [ [[package]] name = "azalea-registry" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-buf", "azalea-registry-macros", @@ -503,7 +515,7 @@ dependencies = [ [[package]] name = "azalea-registry-macros" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "quote", "syn", @@ -511,7 +523,7 @@ dependencies = [ [[package]] name = "azalea-world" -version = "0.10.3+mc1.21.4-rc1" +version = "0.10.3+mc1.21.4" dependencies = [ "azalea-block", "azalea-buf", @@ -558,15 +570,18 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bevy_app" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab348a32e46d21c5d61794294a92d415a770d26c7ba8951830b127b40b53ccc4" +checksum = "652574e4c10efcfa70f98036709dd5b67e5cb8d46c58087ef48c2ac6b62df9da" dependencies = [ "bevy_derive", "bevy_ecs", "bevy_reflect", "bevy_tasks", "bevy_utils", + "console_error_panic_hook", + "ctrlc", + "derive_more", "downcast-rs", "wasm-bindgen", "web-sys", @@ -574,9 +589,9 @@ dependencies = [ [[package]] name = "bevy_derive" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e01f8343f391e2d6a63b368b82fb5b252ed43c8713fc87f9a8f2d59407dd00" +checksum = "e141b7eda52a23bb88740b37a291e26394524cb9ee3b034c7014669671fc2bb5" dependencies = [ "bevy_macro_utils", "quote", @@ -585,29 +600,30 @@ dependencies = [ [[package]] name = "bevy_ecs" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98e612a8e7962ead849e370f3a7e972b88df879ced05cd9dad6a0286d14650cf" +checksum = "cb4c4b60d2a712c6d5cbe610bac7ecf0838fc56a095fd5b15f30230873e84f15" dependencies = [ - "async-channel", "bevy_ecs_macros", "bevy_ptr", "bevy_reflect", "bevy_tasks", "bevy_utils", - "downcast-rs", - "fixedbitset", - "rustc-hash 1.1.0", - "serde", - "thiserror 1.0.69", - "thread_local", + "bitflags", + "concurrent-queue", + "derive_more", + "disqualified", + "fixedbitset 0.5.7", + "nonmax", + "petgraph", + "smallvec", ] [[package]] name = "bevy_ecs_macros" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "807b5106c3410e58f4f523b55ea3c071e2a09e31e9510f3c22021c6a04732b5b" +checksum = "cb4296b3254b8bd29769f6a4512731b2e6c4b163343ca18b72316927315b6096" dependencies = [ "bevy_macro_utils", "proc-macro2", @@ -617,72 +633,62 @@ dependencies = [ [[package]] name = "bevy_log" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5eea6c527fd828b7fef8d0f518167f27f405b904a16f227b644687d3f46a809" +checksum = "1a0bdb42b00ac3752f0d6f531fbda8abf313603157a7b3163da8529412119a0a" dependencies = [ "android_log-sys", "bevy_app", "bevy_ecs", "bevy_utils", - "console_error_panic_hook", - "tracing-log 0.1.4", + "tracing-log", + "tracing-oslog", "tracing-subscriber", "tracing-wasm", ] [[package]] name = "bevy_macro_utils" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb270c98a96243b29465139ed10bda2f675d00a11904f6588a5f7fc4774119c7" +checksum = "3954dbb56a66a6c09c783e767f6ceca0dc0492c22e536e2aeaefb5545eac33c6" dependencies = [ "proc-macro2", "quote", - "rustc-hash 1.1.0", "syn", "toml_edit", ] -[[package]] -name = "bevy_math" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f06daa26ffb82d90ba772256c0ba286f6c305c392f6976c9822717974805837c" -dependencies = [ - "glam", - "serde", -] - [[package]] name = "bevy_ptr" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8050e2869fe341db6874203b5a01ff12673807a2c7c80cb829f6c7bea6997268" +checksum = "2af9e30b40fb3f0a80a658419f670f2de1e743efcaca1952c43cdcc923287944" [[package]] name = "bevy_reflect" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccbd7de21d586457a340a0962ad0747dc5098ff925eb6b27a918c4bdd8252f7b" +checksum = "52a37e2ae5ed62df4a0e3f958076effe280b39bc81fe878587350897a89332a2" dependencies = [ - "bevy_math", + "assert_type_match", "bevy_ptr", "bevy_reflect_derive", "bevy_utils", + "derive_more", + "disqualified", "downcast-rs", "erased-serde", - "glam", "serde", + "smallvec", "smol_str", - "thiserror 1.0.69", ] [[package]] name = "bevy_reflect_derive" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce33051bd49036d4a5a62aa3f2068672ec55f3ebe92aa0d003a341f15cc37ac" +checksum = "94c683fc68c75fc26f90bb1e529590095380d7cec66f6610dbe6b93d9fd26f94" dependencies = [ "bevy_macro_utils", "proc-macro2", @@ -693,62 +699,78 @@ dependencies = [ [[package]] name = "bevy_tasks" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07fcc4969b357de143509925b39c9a2c56eaa8750828d97f319ca9ed41897cb" +checksum = "5171c605b462b4e3249e01986505e62e3933aa27642a9f793c841814fcbbfb4f" dependencies = [ "async-channel", "async-executor", - "async-task", "concurrent-queue", + "futures-channel", "futures-lite", + "pin-project", "wasm-bindgen-futures", ] [[package]] name = "bevy_time" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ea5ae9fe7f56f555dbb05a88d34931907873e3f0c7dc426591839eef72fe3e" +checksum = "291b6993b899c04554fc034ebb9e0d7fde9cb9b2fb58dcd912bfa6247abdedbb" dependencies = [ "bevy_app", "bevy_ecs", "bevy_reflect", "bevy_utils", "crossbeam-channel", - "thiserror 1.0.69", ] [[package]] name = "bevy_utils" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9f845a985c00e0ee8dc2d8af3f417be925fb52aad4bda5b96e2e58a2b4d2eb" +checksum = "a0a48bad33c385a7818b7683a16c8b5c6930eded05cd3f176264fc1f5acea473" dependencies = [ "ahash", "bevy_utils_proc_macros", "getrandom", "hashbrown 0.14.5", - "nonmax", - "petgraph", - "smallvec", - "thiserror 1.0.69", + "thread_local", "tracing", - "uuid", - "web-time 0.2.4", + "web-time", ] [[package]] name = "bevy_utils_proc_macros" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef158627f30503d5c18c20c60b444829f698d343516eeaf6eeee078c9a45163" +checksum = "3dfd8d4a525b8f04f85863e45ccad3e922d4c11ed4a8d54f7f62a40bf83fb90f" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex", + "syn", +] + [[package]] name = "bitflags" version = "2.6.0" @@ -770,12 +792,6 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" -[[package]] -name = "bytemuck" -version = "1.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" - [[package]] name = "byteorder" version = "1.5.0" @@ -784,9 +800,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cast" @@ -796,9 +812,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "shlex", ] @@ -809,6 +825,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfb8" version = "0.8.1" @@ -877,6 +902,17 @@ dependencies = [ "inout", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "4.5.21" @@ -933,6 +969,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + [[package]] name = "cpufeatures" version = "0.2.16" @@ -963,7 +1019,7 @@ dependencies = [ "clap", "criterion-plot", "is-terminal", - "itertools", + "itertools 0.10.5", "num-traits", "once_cell", "oorandom", @@ -984,7 +1040,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -1037,6 +1093,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "ctrlc" +version = "3.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" +dependencies = [ + "nix", + "windows-sys 0.59.0", +] + [[package]] name = "data-encoding" version = "2.6.0" @@ -1072,6 +1138,7 @@ dependencies = [ "proc-macro2", "quote", "syn", + "unicode-xid", ] [[package]] @@ -1096,6 +1163,12 @@ dependencies = [ "syn", ] +[[package]] +name = "disqualified" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9c272297e804878a2a4b707cfcfc6d2328b5bb936944613b4fdf2b9269afdfd" + [[package]] name = "downcast-rs" version = "1.2.1" @@ -1192,6 +1265,12 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + [[package]] name = "flate2" version = "1.0.35" @@ -1349,14 +1428,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] -name = "glam" -version = "0.25.0" +name = "glob" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" -dependencies = [ - "bytemuck", - "serde", -] +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "half" @@ -1391,12 +1466,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hermit-abi" version = "0.4.0" @@ -1685,7 +1754,7 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi", "libc", "windows-sys 0.52.0", ] @@ -1705,6 +1774,15 @@ dependencies = [ "either", ] +[[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.14" @@ -1713,9 +1791,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "fb15147158e79fd8b8afd0252522769c4f48725460b37338544d8379d94fc8f9" dependencies = [ "wasm-bindgen", ] @@ -1731,9 +1809,19 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.166" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] [[package]] name = "libm" @@ -1815,6 +1903,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d60a6352e005f1f86008644a9fe336a66f74c94428182162cc69eb8c6fff458d" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.8.0" @@ -1826,22 +1920,43 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi", "windows-sys 0.52.0", ] +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "nohash-hasher" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nonmax" version = "0.5.5" @@ -2029,10 +2144,30 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ - "fixedbitset", + "fixedbitset 0.4.2", "indexmap", ] +[[package]] +name = "pin-project" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -2103,6 +2238,16 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "priority-queue" version = "2.1.1" @@ -2158,7 +2303,7 @@ dependencies = [ "thiserror 2.0.3", "tinyvec", "tracing", - "web-time 1.1.0", + "web-time", ] [[package]] @@ -2432,7 +2577,7 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" dependencies = [ - "web-time 1.1.0", + "web-time", ] [[package]] @@ -2640,9 +2785,6 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -dependencies = [ - "serde", -] [[package]] name = "smol_str" @@ -2655,9 +2797,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2709,9 +2851,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -2798,6 +2940,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinystr" version = "0.7.6" @@ -2894,9 +3045,9 @@ checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "toml_datetime", @@ -2941,17 +3092,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -2964,10 +3104,25 @@ dependencies = [ ] [[package]] -name = "tracing-subscriber" -version = "0.3.18" +name = "tracing-oslog" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "528bdd1f0e27b5dd9a4ededf154e824b0532731e4af73bb531de46276e0aab1e" +dependencies = [ + "bindgen", + "cc", + "cfg-if", + "once_cell", + "parking_lot", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -2978,7 +3133,7 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", ] [[package]] @@ -3075,6 +3230,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "untrusted" version = "0.9.0" @@ -3170,9 +3331,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "21d3b25c3ea1126a2ad5f4f9068483c2af1e64168f847abe863a526b8dbfe00b" dependencies = [ "cfg-if", "once_cell", @@ -3181,9 +3342,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "52857d4c32e496dc6537646b5b117081e71fd2ff06de792e3577a150627db283" dependencies = [ "bumpalo", "log", @@ -3196,21 +3357,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "951fe82312ed48443ac78b66fa43eded9999f738f6022e67aead7b708659e49a" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "920b0ffe069571ebbfc9ddc0b36ba305ef65577c94b06262ed793716a1afd981" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3218,9 +3380,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "bf59002391099644be3524e23b781fa43d2be0c5aa0719a18c0731b9d195cab6" dependencies = [ "proc-macro2", "quote", @@ -3231,25 +3393,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "e5047c5392700766601942795a436d7d2599af60dcc3cc1248c9120bfb0827b0" [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" +checksum = "476364ff87d0ae6bfb661053a9104ab312542658c3d8f963b7ace80b6f9b26b9" dependencies = [ "js-sys", "wasm-bindgen", @@ -3419,9 +3571,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index af748c1e..d163c106 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,37 +1,46 @@ [workspace] members = [ "azalea", - "azalea-client", - "azalea-protocol", - "azalea-chat", - "azalea-core", "azalea-auth", - "azalea-brigadier", - "azalea-crypto", - "azalea-world", - "azalea-language", "azalea-block", + "azalea-brigadier", "azalea-buf", - "azalea-physics", - "azalea-registry", - "azalea-inventory", + "azalea-chat", + "azalea-client", + "azalea-core", + "azalea-crypto", "azalea-entity", + "azalea-inventory", + "azalea-language", + "azalea-physics", + "azalea-protocol", + "azalea-registry", + "azalea-world", ] resolver = "2" +# --- Workspace Settings --- + +[workspace.package] +version = "0.10.3+mc1.21.4" +edition = "2021" +license = "MIT" +repository = "https://github.com/azalea-rs/azalea" +# homepage = "https://github.com/azalea-rs/azalea" + [workspace.dependencies] aes = "0.8.4" anyhow = "1.0.93" async-recursion = "1.1.1" async-trait = "0.1.83" base64 = "0.22.1" -bevy_app = "0.13.2" -bevy_ecs = { version = "0.13.2", default-features = false } -bevy_log = "0.13.2" -bevy_tasks = "0.13.2" -bevy_time = "0.13.2" +bevy_app = "0.15.0" +bevy_ecs = { version = "0.15.0", default-features = false } +bevy_log = "0.15.0" +bevy_tasks = "0.15.0" +bevy_time = "0.15.0" byteorder = "1.5.0" -bytes = "1.8.0" +bytes = "1.9.0" cfb8 = "0.8.1" chrono = { version = "0.4.38", default-features = false } criterion = "0.5.1" @@ -55,7 +64,7 @@ quote = "1.0.37" rand = "0.8.5" regex = "1.11.1" reqwest = { version = "0.12.9", default-features = false } -rsa = "0.9.6" +rsa = "0.9.7" rsa_public_encrypt_pkcs1 = "0.4.0" rustc-hash = "2.0.0" serde = "1.0.215" @@ -65,15 +74,17 @@ sha2 = "0.10.8" simdnbt = "0.6" #smallvec = "1.13.2" socks5-impl = "0.5.17" -syn = "2.0.89" +syn = "2.0.90" thiserror = "2.0.3" tokio = "1.41.1" tokio-util = "0.7.12" -tracing = "0.1.40" -tracing-subscriber = "0.3.18" +tracing = "0.1.41" +tracing-subscriber = "0.3.19" trust-dns-resolver = { version = "0.23.2", default-features = false } uuid = "1.11.0" +# --- Profile Settings --- + [profile.release] debug = true diff --git a/azalea-auth/Cargo.toml b/azalea-auth/Cargo.toml index 3c83a515..d7507e37 100644 --- a/azalea-auth/Cargo.toml +++ b/azalea-auth/Cargo.toml @@ -1,12 +1,10 @@ [package] -description = "A port of Mojang's Authlib and launcher authentication." -edition = "2021" -license = "MIT" name = "azalea-auth" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-auth" -version = "0.10.3+mc1.21.4" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "A port of Mojang's Authlib and launcher authentication." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dependencies] azalea-buf = { path = "../azalea-buf", version = "0.10.0" } diff --git a/azalea-block/Cargo.toml b/azalea-block/Cargo.toml index 9f5bf967..b3f16f0a 100644 --- a/azalea-block/Cargo.toml +++ b/azalea-block/Cargo.toml @@ -1,16 +1,12 @@ [package] -description = "Representation of Minecraft block states." -edition = "2021" -license = "MIT" name = "azalea-block" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-block" -version = "0.10.3+mc1.21.4" - -[lib] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "Representation of Minecraft block states." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dependencies] azalea-block-macros = { path = "./azalea-block-macros", version = "0.10.0" } azalea-buf = { path = "../azalea-buf", version = "0.10.0" } -azalea-registry = { version = "0.10.0", path = "../azalea-registry" } +azalea-registry = { path = "../azalea-registry", version = "0.10.0" } diff --git a/azalea-block/azalea-block-macros/Cargo.toml b/azalea-block/azalea-block-macros/Cargo.toml index 46c60d1d..20a87020 100644 --- a/azalea-block/azalea-block-macros/Cargo.toml +++ b/azalea-block/azalea-block-macros/Cargo.toml @@ -1,16 +1,14 @@ [package] -description = "Proc macros used by azalea-block." -edition = "2021" -license = "MIT" name = "azalea-block-macros" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-block/azalea-block-macros" -version = "0.10.3+mc1.21.4" +description = "Proc macros used by azalea-block." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [lib] proc-macro = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] proc-macro2 = { workspace = true } quote = { workspace = true } diff --git a/azalea-brigadier/Cargo.toml b/azalea-brigadier/Cargo.toml index 12efd0fd..88d36967 100644 --- a/azalea-brigadier/Cargo.toml +++ b/azalea-brigadier/Cargo.toml @@ -1,12 +1,10 @@ [package] -description = "A port of Mojang's Brigadier command parsing and dispatching library." -edition = "2021" -license = "MIT" name = "azalea-brigadier" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-brigadier" -version = "0.10.3+mc1.21.4" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "A port of Mojang's Brigadier command parsing and dispatching library." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dev-dependencies] bevy_app = { workspace = true } diff --git a/azalea-brigadier/tests/bevy_app_usage.rs b/azalea-brigadier/tests/bevy_app_usage.rs index 1ed1fc99..fee541e7 100644 --- a/azalea-brigadier/tests/bevy_app_usage.rs +++ b/azalea-brigadier/tests/bevy_app_usage.rs @@ -23,12 +23,20 @@ fn bevy_app() { app.init_resource::(); // Process commands from bevy - app.world - .run_system_once(DispatchStorage::bevy_process_commands); + if let Err(err) = app + .world_mut() + .run_system_once(DispatchStorage::bevy_process_commands) + { + panic!("Failed to process commands: {err}"); + } // Verify spawned entities exist after processing commands - app.world - .run_system_once(DispatchStorage::verify_spawned_entities); + if let Err(err) = app + .world_mut() + .run_system_once(DispatchStorage::verify_spawned_entities) + { + panic!("Failed to verify spawned entities: {err}"); + } } #[derive(Resource)] diff --git a/azalea-buf/Cargo.toml b/azalea-buf/Cargo.toml index 992f379c..59494d6b 100644 --- a/azalea-buf/Cargo.toml +++ b/azalea-buf/Cargo.toml @@ -1,12 +1,10 @@ [package] -description = "Serialize and deserialize buffers from Minecraft." -edition = "2021" -license = "MIT" name = "azalea-buf" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-buf" -version = "0.10.3+mc1.21.4" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "Serialize and deserialize buffers from Minecraft." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dependencies] azalea-buf-macros = { path = "./azalea-buf-macros", version = "0.10.0" } diff --git a/azalea-buf/azalea-buf-macros/Cargo.toml b/azalea-buf/azalea-buf-macros/Cargo.toml index ade60dae..0400e77e 100644 --- a/azalea-buf/azalea-buf-macros/Cargo.toml +++ b/azalea-buf/azalea-buf-macros/Cargo.toml @@ -1,14 +1,13 @@ [package] -description = "#[derive(AzBuf)]" -edition = "2021" -license = "MIT" name = "azalea-buf-macros" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-buf" -version = "0.10.3+mc1.21.4" +description = "#[derive(AzBuf)]" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [lib] proc-macro = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] proc-macro2 = { workspace = true } diff --git a/azalea-chat/Cargo.toml b/azalea-chat/Cargo.toml index 75429939..55432396 100644 --- a/azalea-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -1,12 +1,10 @@ [package] -description = "Parse Minecraft chat messages." -edition = "2021" -license = "MIT" name = "azalea-chat" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-chat" -version = "0.10.3+mc1.21.4" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "Parse Minecraft chat messages." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [features] default = [] @@ -15,9 +13,9 @@ azalea-buf = ["dep:azalea-buf", "simdnbt"] numbers = ["dep:azalea-registry", "dep:simdnbt"] [dependencies] -azalea-buf = { path = "../azalea-buf", features = [ +azalea-buf = { path = "../azalea-buf", version = "0.10.0", optional = true, features = [ "serde_json", -], version = "0.10.0", optional = true } +] } azalea-language = { path = "../azalea-language", version = "0.10.0" } azalea-registry = { path = "../azalea-registry", version = "0.10.0", optional = true } serde = { workspace = true, features = ["derive"] } diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index 01001dfa..1d7de5bf 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -1,12 +1,10 @@ [package] -description = "A headless Minecraft client." -edition = "2021" -license = "MIT" name = "azalea-client" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-client" -version = "0.10.3+mc1.21.4" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "A headless Minecraft client." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dependencies] anyhow = { workspace = true } @@ -16,8 +14,8 @@ azalea-buf = { path = "../azalea-buf", version = "0.10.0" } azalea-chat = { path = "../azalea-chat", version = "0.10.0" } azalea-core = { path = "../azalea-core", version = "0.10.0" } azalea-crypto = { path = "../azalea-crypto", version = "0.10.0" } -azalea-entity = { version = "0.10.0", path = "../azalea-entity" } -azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" } +azalea-entity = { path = "../azalea-entity", version = "0.10.0" } +azalea-inventory = { path = "../azalea-inventory", version = "0.10.0" } azalea-physics = { path = "../azalea-physics", version = "0.10.0" } azalea-protocol = { path = "../azalea-protocol", version = "0.10.0" } azalea-registry = { path = "../azalea-registry", version = "0.10.0" } diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 5158eedf..57bf878b 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -728,17 +728,17 @@ impl Plugin for AzaleaPlugin { /// [`DefaultPlugins`]. #[doc(hidden)] pub fn start_ecs_runner( - app: App, + mut app: App, run_schedule_receiver: mpsc::UnboundedReceiver<()>, run_schedule_sender: mpsc::UnboundedSender<()>, ) -> Arc> { // all resources should have been added by now so we can take the ecs from the // app - let ecs = Arc::new(Mutex::new(app.world)); + let ecs = Arc::new(Mutex::new(std::mem::take(app.world_mut()))); tokio::spawn(run_schedule_loop( ecs.clone(), - app.main_schedule_label, + *app.main().update_schedule.as_ref().unwrap(), run_schedule_receiver, )); tokio::spawn(tick_run_schedule_loop(run_schedule_sender)); diff --git a/azalea-client/src/local_player.rs b/azalea-client/src/local_player.rs index d2fce3f1..c01dcef6 100644 --- a/azalea-client/src/local_player.rs +++ b/azalea-client/src/local_player.rs @@ -137,8 +137,8 @@ pub fn death_event(query: Query<&LocalPlayerEvents, Added>) { } } -#[allow(clippy::large_enum_variant)] #[derive(Error, Debug)] +#[expect(clippy::large_enum_variant)] pub enum HandlePacketError { #[error("{0}")] Poison(String), diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index 38178a63..e9be45c7 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -730,7 +730,7 @@ pub fn process_packet_events(ecs: &mut World) { // we use RelativeEntityUpdate because it makes sure changes aren't made // multiple times - commands.entity(entity).add(RelativeEntityUpdate { + commands.entity(entity).queue(RelativeEntityUpdate { partial_world: instance_holder.partial_instance.clone(), update: Box::new(move |entity| { let entity_id = entity.id(); @@ -781,7 +781,7 @@ pub fn process_packet_events(ecs: &mut World) { z: p.za as f64 / 8000., }); - commands.entity(entity).add(RelativeEntityUpdate { + commands.entity(entity).queue(RelativeEntityUpdate { partial_world: instance_holder.partial_instance.clone(), update: Box::new(move |entity_mut| { entity_mut.world_scope(|world| { @@ -838,7 +838,7 @@ pub fn process_packet_events(ecs: &mut World) { x_rot: (p.x_rot as i32 * 360) as f32 / 256., y_rot: (p.y_rot as i32 * 360) as f32 / 256., }; - commands.entity(entity).add(RelativeEntityUpdate { + commands.entity(entity).queue(RelativeEntityUpdate { partial_world: instance_holder.partial_instance.clone(), update: Box::new(move |entity| { let mut position = entity.get_mut::().unwrap(); @@ -875,7 +875,7 @@ pub fn process_packet_events(ecs: &mut World) { if let Some(entity) = entity { let delta = p.delta.clone(); - commands.entity(entity).add(RelativeEntityUpdate { + commands.entity(entity).queue(RelativeEntityUpdate { partial_world: instance_holder.partial_instance.clone(), update: Box::new(move |entity_mut| { let mut position = entity_mut.get_mut::().unwrap(); @@ -911,7 +911,7 @@ pub fn process_packet_events(ecs: &mut World) { y_rot: (p.y_rot as i32 * 360) as f32 / 256., }; - commands.entity(entity).add(RelativeEntityUpdate { + commands.entity(entity).queue(RelativeEntityUpdate { partial_world: instance_holder.partial_instance.clone(), update: Box::new(move |entity_mut| { let mut position = entity_mut.get_mut::().unwrap(); @@ -951,7 +951,7 @@ pub fn process_packet_events(ecs: &mut World) { y_rot: (p.y_rot as i32 * 360) as f32 / 256., }; - commands.entity(entity).add(RelativeEntityUpdate { + commands.entity(entity).queue(RelativeEntityUpdate { partial_world: instance_holder.partial_instance.clone(), update: Box::new(move |entity_mut| { let mut look_direction = entity_mut.get_mut::().unwrap(); diff --git a/azalea-core/Cargo.toml b/azalea-core/Cargo.toml index 8f9674d0..3a5e00d8 100644 --- a/azalea-core/Cargo.toml +++ b/azalea-core/Cargo.toml @@ -1,12 +1,10 @@ [package] -description = "Miscellaneous things in Azalea." -edition = "2021" -license = "MIT" name = "azalea-core" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-core" -version = "0.10.3+mc1.21.4" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "Miscellaneous things in Azalea." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dependencies] azalea-buf = { path = "../azalea-buf", version = "0.10.0" } diff --git a/azalea-crypto/Cargo.toml b/azalea-crypto/Cargo.toml index 4243ac44..d3447d1b 100644 --- a/azalea-crypto/Cargo.toml +++ b/azalea-crypto/Cargo.toml @@ -1,12 +1,13 @@ [package] -description = "Cryptography features used in Minecraft." -edition = "2021" -license = "MIT" name = "azalea-crypto" -version = "0.10.3+mc1.21.4" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-crypto" +description = "Cryptography features used in Minecraft." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[dev-dependencies] +criterion = { workspace = true } [dependencies] aes = { workspace = true } @@ -20,9 +21,6 @@ sha-1 = { workspace = true } sha2 = { workspace = true } uuid = { workspace = true } -[dev-dependencies] -criterion = { workspace = true, features = ["html_reports"] } - [[bench]] harness = false name = "my_benchmark" diff --git a/azalea-entity/Cargo.toml b/azalea-entity/Cargo.toml index 2508e092..b4f1c232 100644 --- a/azalea-entity/Cargo.toml +++ b/azalea-entity/Cargo.toml @@ -1,23 +1,21 @@ [package] name = "azalea-entity" -version = "0.10.3+mc1.21.4" -edition = "2021" description = "Things related to Minecraft entities used by Azalea" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-entity" -license = "MIT" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dependencies] -azalea-block = { version = "0.10.0", path = "../azalea-block" } -azalea-buf = { version = "0.10.0", path = "../azalea-buf" } -azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = [ +azalea-block = { path = "../azalea-block", version = "0.10.0" } +azalea-buf = { path = "../azalea-buf", version = "0.10.0" } +azalea-chat = { path = "../azalea-chat", version = "0.10.0", features = [ "azalea-buf", ] } -azalea-core = { version = "0.10.0", path = "../azalea-core" } -azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" } -azalea-registry = { version = "0.10.0", path = "../azalea-registry" } -azalea-world = { version = "0.10.0", path = "../azalea-world" } +azalea-core = { path = "../azalea-core", version = "0.10.0" } +azalea-inventory = { path = "../azalea-inventory", version = "0.10.0" } +azalea-registry = { path = "../azalea-registry", version = "0.10.0" } +azalea-world = { path = "../azalea-world", version = "0.10.0" } bevy_app = { workspace = true } bevy_ecs = { workspace = true } derive_more = { workspace = true } diff --git a/azalea-inventory/Cargo.toml b/azalea-inventory/Cargo.toml index 2c1b6fc2..9c9ddf20 100644 --- a/azalea-inventory/Cargo.toml +++ b/azalea-inventory/Cargo.toml @@ -1,20 +1,19 @@ [package] -description = "Representations of various inventory data structures in Minecraft." -edition = "2021" -license = "MIT" name = "azalea-inventory" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-inventory-macros" -version = "0.10.3+mc1.21.4" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "Representations of various inventory data structures in Minecraft." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dependencies] -azalea-buf = { version = "0.10.0", path = "../azalea-buf" } -azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = [ +azalea-buf = { path = "../azalea-buf", version = "0.10.0" } +azalea-chat = { path = "../azalea-chat", version = "0.10.0", features = [ "azalea-buf", ] } -azalea-core = { version = "0.10.0", path = "../azalea-core" } -azalea-inventory-macros = { version = "0.10.0", path = "./azalea-inventory-macros" } -azalea-registry = { version = "0.10.0", path = "../azalea-registry" } +azalea-core = { path = "../azalea-core", version = "0.10.0" } +azalea-inventory-macros = { path = "./azalea-inventory-macros", version = "0.10.0" } +azalea-registry = { path = "../azalea-registry", version = "0.10.0" } + simdnbt = { workspace = true } uuid = { workspace = true } diff --git a/azalea-inventory/azalea-inventory-macros/Cargo.toml b/azalea-inventory/azalea-inventory-macros/Cargo.toml index 555d8612..5e850b3c 100644 --- a/azalea-inventory/azalea-inventory-macros/Cargo.toml +++ b/azalea-inventory/azalea-inventory-macros/Cargo.toml @@ -1,16 +1,14 @@ [package] -description = "Internal macros for azalea-inventory." -edition = "2021" -license = "MIT" name = "azalea-inventory-macros" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-inventory/azalea-inventory-macros" -version = "0.10.3+mc1.21.4" +description = "Internal macros for azalea-inventory." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [lib] proc-macro = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] proc-macro2 = { workspace = true } quote = { workspace = true } diff --git a/azalea-language/Cargo.toml b/azalea-language/Cargo.toml index 20636a39..53167dc7 100644 --- a/azalea-language/Cargo.toml +++ b/azalea-language/Cargo.toml @@ -1,12 +1,10 @@ [package] -description = "Translate Minecraft strings from their id." -edition = "2021" -license = "MIT" name = "azalea-language" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-language" -version = "0.10.3+mc1.21.4" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "Translate Minecraft strings from their id." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dependencies] serde = { workspace = true } diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index cd711ebb..01c5f5d8 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -1,12 +1,14 @@ [package] -description = "Physics for Minecraft entities." -edition = "2021" -license = "MIT" name = "azalea-physics" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-physics" -version = "0.10.3+mc1.21.4" +description = "Physics for Minecraft entities." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[dev-dependencies] +bevy_time = { workspace = true } +uuid = { workspace = true } [dependencies] azalea-block = { path = "../azalea-block", version = "0.10.0" } @@ -18,6 +20,3 @@ azalea-world = { path = "../azalea-world", version = "0.10.0" } bevy_app = { workspace = true } bevy_ecs = { workspace = true } parking_lot = { workspace = true } - -[dev-dependencies] -uuid = { workspace = true } diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index 998fb300..c50095e4 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -440,7 +440,7 @@ mod tests { #[test] fn test_gravity() { let mut app = make_test_app(); - let world_lock = app.world.resource_mut::().insert( + let world_lock = app.world_mut().resource_mut::().insert( ResourceLocation::new("minecraft:overworld"), 384, -64, @@ -454,7 +454,7 @@ mod tests { ); let entity = app - .world + .world_mut() .spawn(( EntityBundle::new( Uuid::nil(), @@ -471,24 +471,24 @@ mod tests { )) .id(); { - let entity_pos = *app.world.get::(entity).unwrap(); + let entity_pos = *app.world_mut().get::(entity).unwrap(); // y should start at 70 assert_eq!(entity_pos.y, 70.); } app.update(); - app.world.run_schedule(GameTick); + app.world_mut().run_schedule(GameTick); app.update(); { - let entity_pos = *app.world.get::(entity).unwrap(); + let entity_pos = *app.world_mut().get::(entity).unwrap(); // delta is applied before gravity, so the first tick only sets the delta assert_eq!(entity_pos.y, 70.); - let entity_physics = app.world.get::(entity).unwrap(); + let entity_physics = app.world_mut().get::(entity).unwrap(); assert!(entity_physics.velocity.y < 0.); } - app.world.run_schedule(GameTick); + app.world_mut().run_schedule(GameTick); app.update(); { - let entity_pos = *app.world.get::(entity).unwrap(); + let entity_pos = *app.world_mut().get::(entity).unwrap(); // the second tick applies the delta to the position, so now it should go down assert!( entity_pos.y < 70., @@ -500,7 +500,7 @@ mod tests { #[test] fn test_collision() { let mut app = make_test_app(); - let world_lock = app.world.resource_mut::().insert( + let world_lock = app.world_mut().resource_mut::().insert( ResourceLocation::new("minecraft:overworld"), 384, -64, @@ -513,7 +513,7 @@ mod tests { &mut world_lock.write().chunks, ); let entity = app - .world + .world_mut() .spawn(( EntityBundle::new( Uuid::nil(), @@ -539,19 +539,19 @@ mod tests { "Block state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed" ); app.update(); - app.world.run_schedule(GameTick); + app.world_mut().run_schedule(GameTick); app.update(); { - let entity_pos = *app.world.get::(entity).unwrap(); + let entity_pos = *app.world_mut().get::(entity).unwrap(); // delta will change, but it won't move until next tick assert_eq!(entity_pos.y, 70.); - let entity_physics = app.world.get::(entity).unwrap(); + let entity_physics = app.world_mut().get::(entity).unwrap(); assert!(entity_physics.velocity.y < 0.); } - app.world.run_schedule(GameTick); + app.world_mut().run_schedule(GameTick); app.update(); { - let entity_pos = *app.world.get::(entity).unwrap(); + let entity_pos = *app.world_mut().get::(entity).unwrap(); // the second tick applies the delta to the position, but it also does collision assert_eq!(entity_pos.y, 70.); } @@ -560,7 +560,7 @@ mod tests { #[test] fn test_slab_collision() { let mut app = make_test_app(); - let world_lock = app.world.resource_mut::().insert( + let world_lock = app.world_mut().resource_mut::().insert( ResourceLocation::new("minecraft:overworld"), 384, -64, @@ -573,7 +573,7 @@ mod tests { &mut world_lock.write().chunks, ); let entity = app - .world + .world_mut() .spawn(( EntityBundle::new( Uuid::nil(), @@ -604,17 +604,17 @@ mod tests { ); // do a few steps so we fall on the slab for _ in 0..20 { - app.world.run_schedule(GameTick); + app.world_mut().run_schedule(GameTick); app.update(); } - let entity_pos = app.world.get::(entity).unwrap(); + let entity_pos = app.world_mut().get::(entity).unwrap(); assert_eq!(entity_pos.y, 69.5); } #[test] fn test_top_slab_collision() { let mut app = make_test_app(); - let world_lock = app.world.resource_mut::().insert( + let world_lock = app.world_mut().resource_mut::().insert( ResourceLocation::new("minecraft:overworld"), 384, -64, @@ -627,7 +627,7 @@ mod tests { &mut world_lock.write().chunks, ); let entity = app - .world + .world_mut() .spawn(( EntityBundle::new( Uuid::nil(), @@ -657,17 +657,17 @@ mod tests { ); // do a few steps so we fall on the slab for _ in 0..20 { - app.world.run_schedule(GameTick); + app.world_mut().run_schedule(GameTick); app.update(); } - let entity_pos = app.world.get::(entity).unwrap(); + let entity_pos = app.world_mut().get::(entity).unwrap(); assert_eq!(entity_pos.y, 70.); } #[test] fn test_weird_wall_collision() { let mut app = make_test_app(); - let world_lock = app.world.resource_mut::().insert( + let world_lock = app.world_mut().resource_mut::().insert( ResourceLocation::new("minecraft:overworld"), 384, -64, @@ -680,7 +680,7 @@ mod tests { &mut world_lock.write().chunks, ); let entity = app - .world + .world_mut() .spawn(( EntityBundle::new( Uuid::nil(), @@ -714,18 +714,18 @@ mod tests { ); // do a few steps so we fall on the wall for _ in 0..20 { - app.world.run_schedule(GameTick); + app.world_mut().run_schedule(GameTick); app.update(); } - let entity_pos = app.world.get::(entity).unwrap(); + let entity_pos = app.world_mut().get::(entity).unwrap(); assert_eq!(entity_pos.y, 70.5); } #[test] fn test_negative_coordinates_weird_wall_collision() { let mut app = make_test_app(); - let world_lock = app.world.resource_mut::().insert( + let world_lock = app.world_mut().resource_mut::().insert( ResourceLocation::new("minecraft:overworld"), 384, -64, @@ -738,7 +738,7 @@ mod tests { &mut world_lock.write().chunks, ); let entity = app - .world + .world_mut() .spawn(( EntityBundle::new( Uuid::nil(), @@ -776,11 +776,11 @@ mod tests { ); // do a few steps so we fall on the wall for _ in 0..20 { - app.world.run_schedule(GameTick); + app.world_mut().run_schedule(GameTick); app.update(); } - let entity_pos = app.world.get::(entity).unwrap(); + let entity_pos = app.world_mut().get::(entity).unwrap(); assert_eq!(entity_pos.y, 70.5); } } diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 1d053a76..fa8aa31b 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -1,17 +1,20 @@ [package] -description = "Send and receive Minecraft packets." -edition = "2021" -license = "MIT" name = "azalea-protocol" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-protocol" -version = "0.10.3+mc1.21.4" +description = "Send and receive Minecraft packets." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[dev-dependencies] +anyhow = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } [dependencies] async-recursion = { workspace = true } azalea-auth = { path = "../azalea-auth", version = "0.10.0" } -azalea-block = { path = "../azalea-block", default-features = false, version = "0.10.0" } +azalea-block = { path = "../azalea-block", version = "0.10.0", default-features = false } azalea-brigadier = { path = "../azalea-brigadier", version = "0.10.0", features = [ "azalea-buf", ] } @@ -20,12 +23,12 @@ azalea-chat = { path = "../azalea-chat", version = "0.10.0", features = [ "numbers", "azalea-buf", ] } -azalea-core = { path = "../azalea-core", optional = true, version = "0.10.0", features = [ +azalea-core = { path = "../azalea-core", version = "0.10.0", optional = true, features = [ "serde", ] } azalea-crypto = { path = "../azalea-crypto", version = "0.10.0" } -azalea-entity = { version = "0.10.0", path = "../azalea-entity" } -azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" } +azalea-entity = { path = "../azalea-entity", version = "0.10.0" } +azalea-inventory = { path = "../azalea-inventory", version = "0.10.0" } azalea-protocol-macros = { path = "./azalea-protocol-macros", version = "0.10.0" } azalea-registry = { path = "../azalea-registry", version = "0.10.0" } azalea-world = { path = "../azalea-world", version = "0.10.0" } @@ -36,7 +39,6 @@ flate2 = { workspace = true } futures = { workspace = true } futures-lite = { workspace = true } #futures-util = { workspace = true } -log = { workspace = true } serde = { workspace = true, features = ["serde_derive"] } serde_json = { workspace = true } simdnbt = { workspace = true } @@ -52,8 +54,3 @@ uuid = { workspace = true } connecting = [] default = ["packets"] packets = ["connecting", "dep:azalea-core"] - -[dev-dependencies] -anyhow = { workspace = true } -tracing = { workspace = true } -tracing-subscriber = { workspace = true } diff --git a/azalea-protocol/azalea-protocol-macros/Cargo.toml b/azalea-protocol/azalea-protocol-macros/Cargo.toml index 0b5e0fda..5f54fc37 100644 --- a/azalea-protocol/azalea-protocol-macros/Cargo.toml +++ b/azalea-protocol/azalea-protocol-macros/Cargo.toml @@ -1,14 +1,13 @@ [package] -description = "Macros internally used in azalea-protocol." -edition = "2021" -license = "MIT" name = "azalea-protocol-macros" -version = "0.10.3+mc1.21.4" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-protocol/azalea-protocol-macros" +description = "Macros internally used in azalea-protocol." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [lib] proc-macro = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] proc-macro2 = { workspace = true } diff --git a/azalea-protocol/src/lib.rs b/azalea-protocol/src/lib.rs index fb271433..be706ebe 100644 --- a/azalea-protocol/src/lib.rs +++ b/azalea-protocol/src/lib.rs @@ -41,7 +41,7 @@ pub struct ServerAddress { pub port: u16, } -impl TryFrom<&'_ str> for ServerAddress { +impl TryFrom<&str> for ServerAddress { type Error = String; /// Convert a Minecraft server address (host:port, the port is optional) to diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs index 3e333e52..8569ca73 100755 --- a/azalea-protocol/src/read.rs +++ b/azalea-protocol/src/read.rs @@ -350,7 +350,7 @@ where .map_err(ReadPacketError::from)?; } - if log::log_enabled!(log::Level::Trace) { + if tracing::enabled!(tracing::Level::TRACE) { const DO_NOT_CUT_OFF_PACKET_LOGS: bool = false; let buf_string: String = { diff --git a/azalea-registry/Cargo.toml b/azalea-registry/Cargo.toml index 45d16c4a..32d08bbe 100644 --- a/azalea-registry/Cargo.toml +++ b/azalea-registry/Cargo.toml @@ -1,12 +1,10 @@ [package] -description = "Use Minecraft's registries." -edition = "2021" -license = "MIT" name = "azalea-registry" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-registry" -version = "0.10.3+mc1.21.4" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "Use Minecraft's registries." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [dependencies] azalea-buf = { path = "../azalea-buf", version = "0.10.0" } diff --git a/azalea-registry/azalea-registry-macros/Cargo.toml b/azalea-registry/azalea-registry-macros/Cargo.toml index f9e21c57..409ca831 100644 --- a/azalea-registry/azalea-registry-macros/Cargo.toml +++ b/azalea-registry/azalea-registry-macros/Cargo.toml @@ -1,16 +1,14 @@ [package] -description = "Macros internally used in azalea-registry." -edition = "2021" -license = "MIT" name = "azalea-registry-macros" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-registry/azalea-registry-macros" -version = "0.10.3+mc1.21.4" +description = "Macros internally used in azalea-registry." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [lib] proc-macro = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] #proc-macro2 = { workspace = true } quote = { workspace = true } diff --git a/azalea-registry/src/tags/blocks.rs b/azalea-registry/src/tags/blocks.rs index f4b2aaf5..08def1b3 100644 --- a/azalea-registry/src/tags/blocks.rs +++ b/azalea-registry/src/tags/blocks.rs @@ -1,7 +1,6 @@ // This file was generated by codegen/lib/code/tags.py, don't edit it manually! -use std::collections::HashSet; -use std::sync::LazyLock; +use std::{collections::HashSet, sync::LazyLock}; use crate::Block; diff --git a/azalea-registry/src/tags/fluids.rs b/azalea-registry/src/tags/fluids.rs index 299fb301..0713a655 100644 --- a/azalea-registry/src/tags/fluids.rs +++ b/azalea-registry/src/tags/fluids.rs @@ -1,7 +1,6 @@ // This file was generated by codegen/lib/code/tags.py, don't edit it manually! -use std::collections::HashSet; -use std::sync::LazyLock; +use std::{collections::HashSet, sync::LazyLock}; use crate::Fluid; diff --git a/azalea-registry/src/tags/items.rs b/azalea-registry/src/tags/items.rs index f20b5f66..f7ec01a5 100644 --- a/azalea-registry/src/tags/items.rs +++ b/azalea-registry/src/tags/items.rs @@ -1,7 +1,6 @@ // This file was generated by codegen/lib/code/tags.py, don't edit it manually! -use std::collections::HashSet; -use std::sync::LazyLock; +use std::{collections::HashSet, sync::LazyLock}; use crate::Item; diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index a1e1a769..549111da 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -1,12 +1,14 @@ [package] -description = "The Minecraft world representation used in Azalea." -edition = "2021" -license = "MIT" name = "azalea-world" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-world" -version = "0.10.3+mc1.21.4" +description = "The Minecraft world representation used in Azalea." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[dev-dependencies] +azalea-client = { path = "../azalea-client" } +criterion = "0.5.1" [dependencies] azalea-block = { path = "../azalea-block", default-features = false, version = "0.10.0" } @@ -24,10 +26,6 @@ simdnbt = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } -[dev-dependencies] -azalea-client = { path = "../azalea-client" } -criterion = { workspace = true } - [[bench]] name = "chunks" harness = false diff --git a/azalea/Cargo.toml b/azalea/Cargo.toml index 504280cf..a658c3a8 100644 --- a/azalea/Cargo.toml +++ b/azalea/Cargo.toml @@ -1,10 +1,10 @@ [package] -description = "A framework for creating Minecraft bots." -edition = "2021" -license = "MIT" name = "azalea" -repository = "https://github.com/azalea-rs/azalea/tree/main/azalea" -version = "0.10.3+mc1.21.4" +description = "A framework for creating Minecraft bots." +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } [package.metadata.release] pre-release-replacements = [ @@ -30,7 +30,7 @@ azalea-world = { version = "0.10.0", path = "../azalea-world" } bevy_app = { workspace = true } bevy_ecs = { workspace = true } bevy_log = { workspace = true } -bevy_tasks = { workspace = true, features = ["multi-threaded"] } +bevy_tasks = { workspace = true, features = ["multi_threaded"] } #bevy_time = { workspace = true } derive_more = { workspace = true, features = ["deref", "deref_mut"] } futures = { workspace = true } diff --git a/azalea/build.rs b/azalea/build.rs index 9a503749..18300151 100644 --- a/azalea/build.rs +++ b/azalea/build.rs @@ -2,25 +2,30 @@ use std::env; use std::process::Command; fn main() { - match env::var("RUSTUP_TOOLCHAIN") { - Ok(rust_toolchain) if !rust_toolchain.starts_with("nightly") => { - // stable & beta - panic!("Azalea currently requires nightly Rust. You can use `rustup override set nightly` to set the toolchain for this directory."); - } - Ok(_) => {} // nightly - Err(_) => { - // probably not installed via rustup, run rustc and parse its output - let rustc_command = env::var("RUSTC") - .or_else(|_| env::var("CARGO_BUILD_RUSTC")) - .unwrap_or(String::from("rustc")); - let rustc_version_output = Command::new(rustc_command).arg("-V").output().unwrap(); - if !rustc_version_output.status.success() - || !String::from_utf8(rustc_version_output.stdout) - .unwrap() - .contains("nightly") - { - panic!("Azalea currently requires nightly Rust. It seems that you did not install Rust via rustup. Please check the documentation for your installation method, to find out how to use nightly Rust."); - } + // If using `rustup`, check the toolchain via `RUSTUP_TOOLCHAIN` + if let Ok(toolchain) = env::var("RUSTUP_TOOLCHAIN") { + if toolchain.contains("nightly") { + return; + } else { + panic!("Azalea currently requires nightly Rust. You can run `rustup override set nightly` to set the toolchain for this directory."); } } + + // Get the path to the Rust compiler, defaulting to `rustc` + let rustc_path = env::var("RUSTC") + .or_else(|_| env::var("CARGO_BUILD_RUSTC")) + .unwrap_or(String::from("rustc")); + + // Run `rustc -V` to check the toolchain version + let rustc_command = Command::new(&rustc_path).arg("-V").output().unwrap(); + + if rustc_command.status.success() { + let rustc_output = String::from_utf8(rustc_command.stdout).unwrap(); + if !rustc_output.contains("nightly") { + panic!("Azalea currently requires nightly Rust. Please check the documentation for your installation method and ensure you are using the nightly toolchain."); + } + } else { + let rustc_output = String::from_utf8(rustc_command.stderr).unwrap(); + panic!("Failed to run `{rustc_path} -V` to check the toolchain version, {rustc_output}"); + } } diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index 88ae5da0..eab07348 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -875,7 +875,7 @@ mod tests { // filter: "".to_string(), // }); - simulation.app.world.send_event(GotoEvent { + simulation.app.world_mut().send_event(GotoEvent { entity: simulation.entity, goal: Arc::new(BlockPosGoal(end_pos)), successors_fn: moves::default_move, diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs index ae76896c..ca15fb7a 100644 --- a/azalea/src/pathfinder/simulation.rs +++ b/azalea/src/pathfinder/simulation.rs @@ -130,7 +130,7 @@ pub struct Simulation { impl Simulation { pub fn new(chunks: ChunkStorage, player: SimulatedPlayerBundle) -> Self { let (mut app, instance) = create_simulation_instance(chunks); - let entity = create_simulation_player(&mut app.world, instance.clone(), player); + let entity = create_simulation_player(app.world_mut(), instance.clone(), player); Self { app, entity, @@ -140,13 +140,13 @@ impl Simulation { pub fn tick(&mut self) { self.app.update(); - self.app.world.run_schedule(GameTick); + self.app.world_mut().run_schedule(GameTick); } pub fn component(&self) -> T { - self.app.world.get::(self.entity).unwrap().clone() + self.app.world().get::(self.entity).unwrap().clone() } pub fn get_component(&self) -> Option { - self.app.world.get::(self.entity).cloned() + self.app.world().get::(self.entity).cloned() } pub fn position(&self) -> Vec3 { *self.component::() @@ -171,17 +171,17 @@ impl SimulationSet { } pub fn tick(&mut self) { self.app.update(); - self.app.world.run_schedule(GameTick); + self.app.world_mut().run_schedule(GameTick); } pub fn spawn(&mut self, player: SimulatedPlayerBundle) -> Entity { - create_simulation_player(&mut self.app.world, self.instance.clone(), player) + create_simulation_player(self.app.world_mut(), self.instance.clone(), player) } pub fn despawn(&mut self, entity: Entity) { - self.app.world.despawn(entity); + self.app.world_mut().despawn(entity); } pub fn position(&self, entity: Entity) -> Vec3 { - **self.app.world.get::(entity).unwrap() + **self.app.world().get::(entity).unwrap() } } diff --git a/azalea/src/swarm/chat.rs b/azalea/src/swarm/chat.rs index cf01c60b..f56c1511 100644 --- a/azalea/src/swarm/chat.rs +++ b/azalea/src/swarm/chat.rs @@ -188,70 +188,70 @@ mod tests { async fn test_swarm_chat() { let mut app = make_test_app(); - let bot0 = app.world.spawn_empty().id(); - let bot1 = app.world.spawn_empty().id(); + let bot0 = app.world_mut().spawn_empty().id(); + let bot1 = app.world_mut().spawn_empty().id(); - app.world.send_event(ChatReceivedEvent { + app.world_mut().send_event(ChatReceivedEvent { entity: bot0, packet: ChatPacket::new("a"), }); app.update(); // the swarm should get the event immediately after the bot gets it - assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("a")]); + assert_eq!(drain_events(app.world_mut()), vec![ChatPacket::new("a")]); assert_eq!( - app.world.get::(bot0).unwrap().chat_index, + app.world().get::(bot0).unwrap().chat_index, 1 ); // and a second bot sending the event shouldn't do anything - app.world.send_event(ChatReceivedEvent { + app.world_mut().send_event(ChatReceivedEvent { entity: bot1, packet: ChatPacket::new("a"), }); app.update(); - assert_eq!(drain_events(&mut app.world), vec![]); + assert_eq!(drain_events(app.world_mut()), vec![]); assert_eq!( - app.world.get::(bot1).unwrap().chat_index, + app.world().get::(bot1).unwrap().chat_index, 1 ); // but if the first one gets it again, it should sent it again - app.world.send_event(ChatReceivedEvent { + app.world_mut().send_event(ChatReceivedEvent { entity: bot0, packet: ChatPacket::new("a"), }); app.update(); - assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("a")]); + assert_eq!(drain_events(app.world_mut()), vec![ChatPacket::new("a")]); // alright and now the second bot got a different chat message and it should be // sent - app.world.send_event(ChatReceivedEvent { + app.world_mut().send_event(ChatReceivedEvent { entity: bot1, packet: ChatPacket::new("b"), }); app.update(); - assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("b")]); + assert_eq!(drain_events(app.world_mut()), vec![ChatPacket::new("b")]); } #[tokio::test] async fn test_new_bot() { let mut app = make_test_app(); - let bot0 = app.world.spawn_empty().id(); + let bot0 = app.world_mut().spawn_empty().id(); // bot0 gets a chat message - app.world.send_event(ChatReceivedEvent { + app.world_mut().send_event(ChatReceivedEvent { entity: bot0, packet: ChatPacket::new("a"), }); app.update(); - assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("a")]); - let bot1 = app.world.spawn_empty().id(); - app.world.send_event(ChatReceivedEvent { + assert_eq!(drain_events(app.world_mut()), vec![ChatPacket::new("a")]); + let bot1 = app.world_mut().spawn_empty().id(); + app.world_mut().send_event(ChatReceivedEvent { entity: bot1, packet: ChatPacket::new("b"), }); app.update(); - assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("b")]); + assert_eq!(drain_events(app.world_mut()), vec![ChatPacket::new("b")]); } } diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 31f018cf..24b336fd 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -368,7 +368,7 @@ where let (run_schedule_sender, run_schedule_receiver) = mpsc::unbounded_channel(); - let main_schedule_label = self.app.main_schedule_label; + let main_schedule_label = self.app.main().update_schedule.unwrap(); let ecs_lock = start_ecs_runner(self.app, run_schedule_receiver, run_schedule_sender.clone()); @@ -671,7 +671,17 @@ impl Swarm { let delay = (Duration::from_secs(5) * 2u32.pow(disconnects.min(16))) .min(Duration::from_secs(15)); let username = account.username.clone(); - error!("Error joining as {username}: {e}. Waiting {delay:?} and trying again."); + + if let JoinError::Disconnect { reason } = &e { + error!( + "Error joining as {username}, server says: \"{reason}\". Waiting {delay:?} and trying again." + ); + } else { + error!( + "Error joining as {username}: {e}. Waiting {delay:?} and trying again." + ); + } + tokio::time::sleep(delay).await; } } diff --git a/codegen/lib/code/shapes.py b/codegen/lib/code/shapes.py index c4964fa6..a7dd58fb 100755 --- a/codegen/lib/code/shapes.py +++ b/codegen/lib/code/shapes.py @@ -119,10 +119,11 @@ def generate_block_shapes_code(blocks: dict, shapes: dict, block_states_report): #![allow(clippy::explicit_auto_deref)] #![allow(clippy::redundant_closure)] +use std::sync::LazyLock; + use super::VoxelShape; use crate::collision::{{self, Shapes}}; use azalea_block::*; -use std::sync::LazyLock; pub trait BlockWithShape {{ fn shape(&self) -> &'static VoxelShape; diff --git a/codegen/lib/code/tags.py b/codegen/lib/code/tags.py index d43b0071..51b41f50 100644 --- a/codegen/lib/code/tags.py +++ b/codegen/lib/code/tags.py @@ -8,8 +8,8 @@ def generate_tags(registries: dict, file_name: str, struct_name: str): generated = f'''// This file was generated by codegen/lib/code/tags.py, don't edit it manually! -use std::collections::HashSet; -use std::sync::LazyLock; +use std::{collections::HashSet, sync::LazyLock}; + use crate::{struct_name}; diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index f36406d3..00000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly-2024-11-11 \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..e5458740 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "nightly-2024-11-11" +# channel = "nightly"