From d1afd02aa84e7b4450c1607277f078eb2a0f1bf3 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:11:29 -0500 Subject: [PATCH] Update to Bevy 0.11 (#94) * update to bevy 0.11 * clippy --------- Co-authored-by: mat --- Cargo.lock | 507 +++++++++--------- azalea-auth/Cargo.toml | 22 +- azalea-block/azalea-block-macros/Cargo.toml | 6 +- azalea-block/azalea-block-macros/src/lib.rs | 10 +- azalea-brigadier/src/command_dispatcher.rs | 2 +- .../src/context/command_context.rs | 2 +- .../src/context/command_context_builder.rs | 8 +- azalea-buf/Cargo.toml | 6 +- azalea-buf/azalea-buf-macros/Cargo.toml | 6 +- azalea-buf/azalea-buf-macros/src/read.rs | 4 +- azalea-buf/azalea-buf-macros/src/write.rs | 4 +- azalea-chat/Cargo.toml | 6 +- azalea-chat/src/component.rs | 2 +- azalea-client/Cargo.toml | 30 +- azalea-client/src/chat.rs | 10 +- azalea-client/src/client.rs | 45 +- azalea-client/src/disconnect.rs | 6 +- azalea-client/src/events.rs | 27 +- azalea-client/src/interact.rs | 7 +- azalea-client/src/inventory.rs | 14 +- azalea-client/src/local_player.rs | 8 +- azalea-client/src/mining.rs | 5 +- azalea-client/src/movement.rs | 18 +- azalea-client/src/packet_handling.rs | 25 +- azalea-client/src/respawn.rs | 6 +- azalea-client/src/task_pool.rs | 9 +- azalea-core/Cargo.toml | 4 +- azalea-crypto/Cargo.toml | 12 +- .../azalea-inventory-macros/Cargo.toml | 6 +- .../src/parse_macro.rs | 4 +- azalea-language/Cargo.toml | 4 +- azalea-nbt/Cargo.toml | 12 +- azalea-physics/Cargo.toml | 10 +- azalea-physics/src/lib.rs | 35 +- azalea-protocol/Cargo.toml | 34 +- .../azalea-protocol-macros/Cargo.toml | 6 +- .../clientbound_update_advancements_packet.rs | 1 + .../azalea-registry-macros/Cargo.toml | 6 +- .../azalea-registry-macros/src/lib.rs | 4 +- azalea-world/Cargo.toml | 14 +- azalea-world/src/entity/info.rs | 47 +- azalea/Cargo.toml | 26 +- azalea/src/auto_respawn.rs | 3 +- azalea/src/bot.rs | 29 +- azalea/src/container.rs | 4 +- azalea/src/lib.rs | 12 +- azalea/src/pathfinder/mod.rs | 31 +- azalea/src/swarm/chat.rs | 15 +- azalea/src/swarm/events.rs | 5 +- azalea/src/swarm/mod.rs | 14 +- 50 files changed, 588 insertions(+), 545 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d29c12b2..ec106c39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", "cipher", @@ -30,10 +30,11 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ + "cfg-if", "getrandom", "once_cell", "version_check", @@ -48,6 +49,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -56,9 +63,9 @@ checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] name = "android_log-sys" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" +checksum = "27f0fc03f560e1aebde41c2398b691cb98b5ea5996a6184a7a67bbbb77448969" [[package]] name = "anes" @@ -66,6 +73,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + [[package]] name = "anyhow" version = "1.0.71" @@ -85,9 +98,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.3.15" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +checksum = "5b0122885821398cc923ece939e24d1056a2384ee719432397fa9db87230ff11" dependencies = [ "flate2", "futures-core", @@ -127,7 +140,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -138,24 +151,13 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "syn 2.0.25", ] [[package]] @@ -235,7 +237,7 @@ version = "0.7.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] @@ -265,7 +267,7 @@ version = "0.7.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] @@ -363,7 +365,7 @@ version = "0.7.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] @@ -383,7 +385,7 @@ dependencies = [ "byteorder", "compact_str", "criterion", - "enum-as-inner", + "enum-as-inner 0.6.0", "fastnbt", "flate2", "graphite_binary", @@ -454,7 +456,7 @@ version = "0.7.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] @@ -472,7 +474,7 @@ version = "0.7.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] @@ -490,7 +492,7 @@ dependencies = [ "bevy_app", "bevy_ecs", "derive_more", - "enum-as-inner", + "enum-as-inner 0.6.0", "log", "nohash-hasher", "once_cell", @@ -501,15 +503,15 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide 0.6.2", + "miniz_oxide", "object", "rustc-demangle", ] @@ -528,13 +530,14 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bevy_app" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01db46963eb9486f7884121527ec69751d0e448f9e1d5329e80ea3424118a31a" +checksum = "1817e8d5b1146ea9e7730a7264d3470394840e0754d15abded26473f867967a0" dependencies = [ "bevy_derive", "bevy_ecs", "bevy_reflect", + "bevy_tasks", "bevy_utils", "downcast-rs", "wasm-bindgen", @@ -543,20 +546,20 @@ dependencies = [ [[package]] name = "bevy_derive" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff0add5ab4a6b2b7e86e18f9043bb48b6386faa3b56abaa0ed97a3d669a1992" +checksum = "e1477347b17df781756ba0dfd677e2975e57e930752cd3cd42e6cdd8fdaa3223" dependencies = [ "bevy_macro_utils", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "bevy_ecs" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed2f74687ccf13046c0f8e3b00dc61d7e656877b4a1380cf04635bb74d8e586" +checksum = "032c81ba7d919c1004b0abc33cc6c588c8f896a4d7c55a7c7aa1e46382242f43" dependencies = [ "async-channel", "bevy_ecs_macros", @@ -569,26 +572,27 @@ dependencies = [ "fixedbitset", "rustc-hash", "serde", + "thiserror", "thread_local", ] [[package]] name = "bevy_ecs_macros" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97fd126a0db7b30fb1833614b3a657b44ac88485741c33b2780e25de0f96d78" +checksum = "a15ff7fcafdb8fe464ddd300b4860a76d5c6f9d684472e4bf21852d6f0ff3991" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "bevy_log" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25980c90ceaad34d09a53291e72ca56fcc754a974cd4654fffcf5b68b283b7a7" +checksum = "487dfd1fc75fada8f3f2f4773addf3fbba53a2a91cb913616e6dc6c26dd62995" dependencies = [ "android_log-sys", "bevy_app", @@ -602,20 +606,21 @@ dependencies = [ [[package]] name = "bevy_macro_utils" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b2fee53b2497cdc3bffff2ddf52afa751242424a5fd0d51d227d4dab081d0d9" +checksum = "fd3868e555723249fde3786891f35893b3001b2be4efb51f431467cb7fc378cd" dependencies = [ "quote", - "syn 1.0.109", + "rustc-hash", + "syn 2.0.25", "toml_edit", ] [[package]] name = "bevy_math" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6a1109d06fe947990db032e719e162414cf9bf7a478dcc52742f1c7136c42a" +checksum = "25088c6598fe0b8ded992c781dc49e613993c7a4e6a731c0f2ab0408add6afdb" dependencies = [ "glam", "serde", @@ -623,15 +628,15 @@ dependencies = [ [[package]] name = "bevy_ptr" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b88451d4c5a353bff67dbaa937b6886efd26ae114769c17f2b35099c7a4de" +checksum = "c74fcf37593a0053f539c3b088f34f268cbefed031d8eb8ff0fb10d175160242" [[package]] name = "bevy_reflect" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc3979471890e336f3ba87961ef3ecd45c331cf2cb2f582c885e541af228b48" +checksum = "362492a6b66f676176705cc06017b012320fa260a9cf4baf3513387e9c05693e" dependencies = [ "bevy_math", "bevy_ptr", @@ -644,43 +649,43 @@ dependencies = [ "parking_lot", "serde", "smallvec", + "smol_str", "thiserror", ] [[package]] name = "bevy_reflect_derive" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc7ea7c9bc2c531eb29ba5619976613d6680453ff5dd4a7fcd08848e8bec5ad" +checksum = "8e974d78eaf1b45e1b4146711b5c16e37c24234e12f3a52f5f2e28332c969d3c" dependencies = [ "bevy_macro_utils", "bit-set", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", "uuid", ] [[package]] name = "bevy_tasks" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3de86364316e151aeb0897eaaa917c3ad5ee5ef1471a939023cf7f2d5ab76955" +checksum = "faab904296a3d6976bb8a12bc0f42f6c98fb6cd87a96244e0151d359f684ec2d" dependencies = [ "async-channel", "async-executor", "async-task", "concurrent-queue", "futures-lite", - "once_cell", "wasm-bindgen-futures", ] [[package]] name = "bevy_time" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3edbd605df1bced312eb9888d6be3d5a5fcac3d4140038bbe3233d218399eef" +checksum = "d09225ad2ffef14da000080143730b36ba225844ae479e4791cdb9d08066d06a" dependencies = [ "bevy_app", "bevy_ecs", @@ -692,14 +697,14 @@ dependencies = [ [[package]] name = "bevy_utils" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a88ebbca55d360d72e9fe78df0d22e25cd419933c9559e79dae2757f7c4d066" +checksum = "10bfde141f0cdd15e07bca72f4439a9db80877c283738f581d061972ef483b1b" dependencies = [ "ahash", "bevy_utils_proc_macros", "getrandom", - "hashbrown", + "hashbrown 0.14.0", "instant", "petgraph", "thiserror", @@ -709,13 +714,13 @@ dependencies = [ [[package]] name = "bevy_utils_proc_macros" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630b92e32fa5cd7917c7d4fdbf63a90af958b01e096239f71bc4f8f3cf40c0d2" +checksum = "9e37f2e885b0e8af59dc19871c313d3cf2a2495db35bb4d4ae0a61b3f87d5401" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] @@ -739,6 +744,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + [[package]] name = "block-buffer" version = "0.10.4" @@ -864,30 +875,34 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" +version = "4.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" dependencies = [ - "bitflags", + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" +dependencies = [ + "anstyle", "clap_lex", - "indexmap", - "textwrap", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "compact_str" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff0805f79ecb1b35163f3957a6934ea8d04fcd36ef98b52e7316f63e72e73d1" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" dependencies = [ "castaway", "cfg-if", @@ -930,9 +945,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" dependencies = [ "libc", ] @@ -948,19 +963,19 @@ dependencies = [ [[package]] name = "criterion" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" dependencies = [ "anes", - "atty", "cast", "ciborium", "clap", "criterion-plot", + "is-terminal", "itertools", - "lazy_static", "num-traits", + "once_cell", "oorandom", "plotters", "rayon", @@ -1109,6 +1124,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.25", +] + [[package]] name = "env_logger" version = "0.10.0" @@ -1122,6 +1149,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + [[package]] name = "erased-serde" version = "0.3.25" @@ -1192,7 +1225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", - "miniz_oxide 0.7.1", + "miniz_oxide", ] [[package]] @@ -1281,7 +1314,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -1339,15 +1372,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "glam" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e4afd9ad95555081e109fe1d21f2a30c691b5f0919c67dfa690a2e1eb6bd51c" +checksum = "42218cb640844e3872cc3c153dc975229e080a6c4733b34709ef445610550226" dependencies = [ "bytemuck", "serde", @@ -1380,9 +1413,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -1390,7 +1423,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -1408,8 +1441,15 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" dependencies = [ "ahash", + "allocator-api2", "serde", ] @@ -1421,27 +1461,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "http" @@ -1485,9 +1507,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1548,7 +1570,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", ] [[package]] @@ -1572,31 +1604,19 @@ dependencies = [ "web-sys", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys", -] - [[package]] name = "ipnet" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", + "hermit-abi", "rustix", "windows-sys", ] @@ -1636,9 +1656,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libm" @@ -1660,9 +1680,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" [[package]] name = "lock_api" @@ -1695,7 +1715,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -1725,15 +1745,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1866,19 +1877,19 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] [[package]] name = "object" -version = "0.30.4" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ "memchr", ] @@ -1895,12 +1906,6 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "os_str_bytes" -version = "6.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" - [[package]] name = "overload" version = "0.1.1" @@ -1971,14 +1976,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -2009,9 +2014,9 @@ dependencies = [ [[package]] name = "plotters" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" dependencies = [ "num-traits", "plotters-backend", @@ -2022,15 +2027,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" [[package]] name = "plotters-svg" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" dependencies = [ "plotters-backend", ] @@ -2043,28 +2048,28 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "priority-queue" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca9c6be70d989d21a136eb86c2d83e4b328447fac4a88dace2143c179c86267" +checksum = "fff39edfcaec0d64e8d0da38564fad195d2d51b680940295fcc307366e101e61" dependencies = [ "autocfg", - "indexmap", + "indexmap 1.9.3", ] [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -2127,7 +2132,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -2136,18 +2141,19 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.8.4" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.2", + "regex-automata 0.3.2", + "regex-syntax 0.7.3", ] [[package]] @@ -2159,6 +2165,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d3daa6976cffb758ec878f108ba0e062a45b2d6ca3a2cca965338855476caf" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.3", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -2167,9 +2184,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" [[package]] name = "reqwest" @@ -2282,13 +2299,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.20" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "fbc6396159432b5c8490d4e301d8c705f61860b8b6c863bf79942ce5401968f3" dependencies = [ - "bitflags", + "bitflags 2.3.3", "errno", - "io-lifetimes", "libc", "linux-raw-sys", "windows-sys", @@ -2296,9 +2312,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" dependencies = [ "log", "ring", @@ -2308,9 +2324,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ "base64", ] @@ -2370,38 +2386,38 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "a56657f512baabca8f840542f9ca8152aecf182c473c26e46e58d6aab4f6e439" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.9" +version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" +checksum = "f3c5113243e4a3a1c96587342d067f3e6b0f50790b6cf40d2868eb647a3eef0e" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "77d477848e6b23adba0db397777d5aad864555bc17fd9c89abb3b8009788b7b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" dependencies = [ "itoa", "ryu", @@ -2433,9 +2449,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", @@ -2493,9 +2509,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +dependencies = [ + "serde", +] + +[[package]] +name = "smol_str" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c" dependencies = [ "serde", ] @@ -2551,9 +2576,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" dependencies = [ "proc-macro2", "quote", @@ -2569,30 +2594,24 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -2643,11 +2662,12 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.2" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -2668,7 +2688,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -2697,17 +2717,17 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" dependencies = [ - "indexmap", + "indexmap 2.0.0", "toml_datetime", "winnow", ] @@ -2732,13 +2752,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", ] [[package]] @@ -2800,7 +2820,7 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner", + "enum-as-inner 0.5.1", "futures-channel", "futures-io", "futures-util", @@ -2854,9 +2874,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" [[package]] name = "unicode-normalization" @@ -2886,9 +2906,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.3.4" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa2982af2eec27de306107c027578ff7f423d65f7250e40ce0fea8f45248b81" +checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" dependencies = [ "getrandom", "serde", @@ -2935,11 +2955,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -2970,7 +2989,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", "wasm-bindgen-shared", ] @@ -3004,7 +3023,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.25", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3086,9 +3105,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -3143,9 +3162,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" dependencies = [ "memchr", ] diff --git a/azalea-auth/Cargo.toml b/azalea-auth/Cargo.toml index 2d154514..82982e8e 100644 --- a/azalea-auth/Cargo.toml +++ b/azalea-auth/Cargo.toml @@ -11,23 +11,23 @@ version = "0.7.0" [dependencies] azalea-buf = { path = "../azalea-buf", version = "^0.7.0" } azalea-crypto = { path = "../azalea-crypto", version = "^0.7.0" } -base64 = "0.21.0" -chrono = { version = "0.4.24", default-features = false, features = ["serde"] } -log = "0.4.17" +base64 = "0.21.2" +chrono = { version = "0.4.26", default-features = false, features = ["serde"] } +log = "0.4.19" num-bigint = "0.4.3" -once_cell = "1.17.1" +once_cell = "1.18.0" parking_lot = "0.12.1" -reqwest = { version = "0.11.16", default-features = false, features = [ +reqwest = { version = "0.11.18", default-features = false, features = [ "json", "rustls-tls", ] } rsa = "0.9.2" -serde = { version = "1.0.159", features = ["derive"] } -serde_json = "1.0.95" -thiserror = "1.0.40" -tokio = { version = "1.27.0", features = ["fs"] } -uuid = { version = "1.3.0", features = ["serde"] } +serde = { version = "1.0.170", features = ["derive"] } +serde_json = "1.0.100" +thiserror = "1.0.43" +tokio = { version = "1.29.1", features = ["fs"] } +uuid = { version = "1.4.0", features = ["serde"] } [dev-dependencies] env_logger = "0.10.0" -tokio = { version = "1.27.0", features = ["full"] } +tokio = { version = "1.29.1", features = ["full"] } diff --git a/azalea-block/azalea-block-macros/Cargo.toml b/azalea-block/azalea-block-macros/Cargo.toml index 80d9a818..16262f12 100644 --- a/azalea-block/azalea-block-macros/Cargo.toml +++ b/azalea-block/azalea-block-macros/Cargo.toml @@ -12,6 +12,6 @@ proc-macro = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -proc-macro2 = "1.0.39" -quote = "1.0.18" -syn = "1.0.95" +proc-macro2 = "1.0.64" +quote = "1.0.29" +syn = "2.0.25" diff --git a/azalea-block/azalea-block-macros/src/lib.rs b/azalea-block/azalea-block-macros/src/lib.rs index 6892987e..c12f7b86 100755 --- a/azalea-block/azalea-block-macros/src/lib.rs +++ b/azalea-block/azalea-block-macros/src/lib.rs @@ -109,7 +109,7 @@ impl Parse for PropertyType { } else { let content; braced!(content in input); - let variants = content.parse_terminated(Ident::parse)?; + let variants = content.parse_terminated(Ident::parse, Token![,])?; Ok(Self::Enum { type_name: keyword, variants, @@ -172,8 +172,8 @@ impl Parse for BlockDefinition { let mut properties_and_defaults = Vec::new(); // read the things comma-separated - let property_and_default_punctuated: Punctuated = - content.parse_terminated(PropertyWithNameAndDefault::parse)?; + let property_and_default_punctuated = + content.parse_terminated(PropertyWithNameAndDefault::parse, Token![,])?; for property_and_default in property_and_default_punctuated { properties_and_defaults.push(property_and_default); @@ -191,8 +191,8 @@ impl Parse for BlockDefinitions { fn parse(input: ParseStream) -> Result { let mut blocks = Vec::new(); - let block_definitions_punctuated: Punctuated = - input.parse_terminated(BlockDefinition::parse)?; + let block_definitions_punctuated = + input.parse_terminated(BlockDefinition::parse, Token![,])?; for block_definition in block_definitions_punctuated { blocks.push(block_definition); } diff --git a/azalea-brigadier/src/command_dispatcher.rs b/azalea-brigadier/src/command_dispatcher.rs index 595bc57d..672a250b 100755 --- a/azalea-brigadier/src/command_dispatcher.rs +++ b/azalea-brigadier/src/command_dispatcher.rs @@ -105,7 +105,7 @@ impl CommandDispatcher { let parse = self .parse_nodes(redirect, &reader, child_context) .expect("Parsing nodes failed"); - context.with_child(Arc::new(parse.context)); + context.with_child(Rc::new(parse.context)); return Ok(ParseResults { context, reader: parse.reader, diff --git a/azalea-brigadier/src/context/command_context.rs b/azalea-brigadier/src/context/command_context.rs index 1734bb05..a8efeeeb 100755 --- a/azalea-brigadier/src/context/command_context.rs +++ b/azalea-brigadier/src/context/command_context.rs @@ -16,7 +16,7 @@ pub struct CommandContext { pub root_node: Arc>>, pub nodes: Vec>, pub range: StringRange, - pub child: Option>>, + pub child: Option>>, pub modifier: Option>>, pub forks: bool, } diff --git a/azalea-brigadier/src/context/command_context_builder.rs b/azalea-brigadier/src/context/command_context_builder.rs index 78088941..2fc8d4ac 100755 --- a/azalea-brigadier/src/context/command_context_builder.rs +++ b/azalea-brigadier/src/context/command_context_builder.rs @@ -9,7 +9,7 @@ use crate::{ modifier::RedirectModifier, tree::{Command, CommandNode}, }; -use std::{collections::HashMap, fmt::Debug, sync::Arc}; +use std::{collections::HashMap, fmt::Debug, rc::Rc, sync::Arc}; pub struct CommandContextBuilder<'a, S> { pub arguments: HashMap, @@ -18,7 +18,7 @@ pub struct CommandContextBuilder<'a, S> { pub dispatcher: &'a CommandDispatcher, pub source: Arc, pub command: Command, - pub child: Option>>, + pub child: Option>>, pub range: StringRange, pub modifier: Option>>, pub forks: bool, @@ -66,7 +66,7 @@ impl<'a, S> CommandContextBuilder<'a, S> { self.command = command.clone(); self } - pub fn with_child(&mut self, child: Arc>) -> &Self { + pub fn with_child(&mut self, child: Rc>) -> &Self { self.child = Some(child); self } @@ -92,7 +92,7 @@ impl<'a, S> CommandContextBuilder<'a, S> { nodes: self.nodes.clone(), source: self.source.clone(), command: self.command.clone(), - child: self.child.clone().map(|c| Arc::new(c.build(input))), + child: self.child.clone().map(|c| Rc::new(c.build(input))), range: self.range.clone(), forks: self.forks, modifier: self.modifier.clone(), diff --git a/azalea-buf/Cargo.toml b/azalea-buf/Cargo.toml index cbd00bef..1236e865 100644 --- a/azalea-buf/Cargo.toml +++ b/azalea-buf/Cargo.toml @@ -11,10 +11,10 @@ version = "0.7.0" [dependencies] azalea-buf-macros = { path = "./azalea-buf-macros", version = "^0.7.0" } byteorder = "^1.4.3" -log = "0.4.17" +log = "0.4.19" serde_json = { version = "^1.0", optional = true } -thiserror = "1.0.37" -uuid = "^1.1.2" +thiserror = "1.0.43" +uuid = "^1.4.0" [features] serde_json = ["dep:serde_json"] diff --git a/azalea-buf/azalea-buf-macros/Cargo.toml b/azalea-buf/azalea-buf-macros/Cargo.toml index 2aa98fd7..61c25532 100644 --- a/azalea-buf/azalea-buf-macros/Cargo.toml +++ b/azalea-buf/azalea-buf-macros/Cargo.toml @@ -11,6 +11,6 @@ proc-macro = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -proc-macro2 = "^1.0.36" -quote = "^1.0.10" -syn = { version = "^1.0.82", features = ["extra-traits"] } +proc-macro2 = "^1.0.64" +quote = "^1.0.29" +syn = { version = "^2.0.25", features = ["extra-traits"] } diff --git a/azalea-buf/azalea-buf-macros/src/read.rs b/azalea-buf/azalea-buf-macros/src/read.rs index 82fd1ce8..010c7f57 100644 --- a/azalea-buf/azalea-buf-macros/src/read.rs +++ b/azalea-buf/azalea-buf-macros/src/read.rs @@ -13,7 +13,7 @@ fn read_named_fields( // if it's a string, use buf.write_string match field_type { syn::Type::Path(_) | syn::Type::Array(_) => { - if f.attrs.iter().any(|a| a.path.is_ident("var")) { + if f.attrs.iter().any(|a| a.path().is_ident("var")) { quote! { let #field_name = azalea_buf::McBufVarReadable::var_read_from(buf)?; } @@ -98,7 +98,7 @@ pub fn create_impl_mcbufreadable(ident: &Ident, data: &Data) -> proc_macro2::Tok syn::Fields::Unnamed(fields) => { let mut reader_code = quote! {}; for f in &fields.unnamed { - if f.attrs.iter().any(|attr| attr.path.is_ident("var")) { + if f.attrs.iter().any(|attr| attr.path().is_ident("var")) { reader_code.extend(quote! { Self::#variant_name(azalea_buf::McBufVarReadable::var_read_from(buf)?), }); diff --git a/azalea-buf/azalea-buf-macros/src/write.rs b/azalea-buf/azalea-buf-macros/src/write.rs index b491a550..bc493f38 100644 --- a/azalea-buf/azalea-buf-macros/src/write.rs +++ b/azalea-buf/azalea-buf-macros/src/write.rs @@ -17,7 +17,7 @@ fn write_named_fields( // if it's a string, use buf.write_string match field_type { syn::Type::Path(_) | syn::Type::Array(_) => { - if f.attrs.iter().any(|attr| attr.path.is_ident("var")) { + if f.attrs.iter().any(|attr| attr.path().is_ident("var")) { quote! { azalea_buf::McBufVarWritable::var_write_into(#ident_dot_field, buf)?; } @@ -133,7 +133,7 @@ pub fn create_impl_mcbufwritable(ident: &Ident, data: &Data) -> proc_macro2::Tok for (i, f) in fields.unnamed.iter().enumerate() { let param_ident = Ident::new(&format!("data{i}"), Span::call_site()); params_code.extend(quote! { #param_ident, }); - if f.attrs.iter().any(|attr| attr.path.is_ident("var")) { + if f.attrs.iter().any(|attr| attr.path().is_ident("var")) { writers_code.extend(quote! { azalea_buf::McBufVarWritable::var_write_into(#param_ident, buf)?; }); diff --git a/azalea-chat/Cargo.toml b/azalea-chat/Cargo.toml index 8a9cf2ef..cc67628e 100644 --- a/azalea-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -16,7 +16,7 @@ azalea-buf = { path = "../azalea-buf", features = [ "serde_json", ], version = "^0.7.0", optional = true } azalea-language = { path = "../azalea-language", version = "^0.7.0" } -log = "0.4.17" -once_cell = "1.16.0" +log = "0.4.19" +once_cell = "1.18.0" serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0.93" +serde_json = "^1.0.100" diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 59e11bbf..e087713c 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -128,7 +128,7 @@ impl IntoIterator for FormattedText { let mut v: Vec = Vec::with_capacity(siblings.len() + 1); v.push(self); for sibling in siblings { - v.extend(sibling.into_iter()); + v.extend(sibling); } v.into_iter() diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index dc4ff2e0..fb96fccb 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -9,9 +9,9 @@ version = "0.7.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -reqwest = { version = "0.11.12", default-features = false } -anyhow = "1.0.59" -async-trait = "0.1.58" +reqwest = { version = "0.11.18", default-features = false } +anyhow = "1.0.71" +async-trait = "0.1.71" azalea-auth = { path = "../azalea-auth", version = "0.7.0" } azalea-block = { path = "../azalea-block", version = "0.7.0" } azalea-nbt = { path = "../azalea-nbt", version = "0.7.0" } @@ -22,22 +22,22 @@ azalea-physics = { path = "../azalea-physics", version = "0.7.0" } azalea-protocol = { path = "../azalea-protocol", version = "0.7.0" } azalea-registry = { path = "../azalea-registry", version = "0.7.0" } azalea-world = { path = "../azalea-world", version = "0.7.0" } -bevy_app = "0.10.0" -bevy_ecs = "0.10.0" -bevy_log = "0.10.0" -bevy_tasks = "0.10.0" -bevy_time = "0.10.0" +bevy_app = "0.11.0" +bevy_ecs = "0.11.0" +bevy_log = "0.11.0" +bevy_tasks = "0.11.0" +bevy_time = "0.11.0" azalea-inventory = { path = "../azalea-inventory", version = "0.7.0" } derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } -futures = "0.3.25" -log = "0.4.17" +futures = "0.3.28" +log = "0.4.19" nohash-hasher = "0.2.0" -once_cell = "1.16.0" +once_cell = "1.18.0" parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } -regex = "1.7.0" -thiserror = "^1.0.34" -tokio = { version = "^1.24.2", features = ["sync"] } -uuid = "^1.1.2" +regex = "1.9.1" +thiserror = "^1.0.43" +tokio = { version = "^1.29.1", features = ["sync"] } +uuid = "^1.4.0" [features] default = ["log"] diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs index 90618c80..337bce51 100755 --- a/azalea-client/src/chat.rs +++ b/azalea-client/src/chat.rs @@ -7,11 +7,12 @@ use azalea_protocol::packets::game::{ serverbound_chat_command_packet::ServerboundChatCommandPacket, serverbound_chat_packet::{LastSeenMessagesUpdate, ServerboundChatPacket}, }; -use bevy_app::{App, Plugin}; +use bevy_app::{App, Plugin, Update}; use bevy_ecs::{ entity::Entity, event::{EventReader, EventWriter}, - schedule::{IntoSystemConfig, IntoSystemConfigs}, + prelude::Event, + schedule::IntoSystemConfigs, }; use std::{ sync::Arc, @@ -170,6 +171,7 @@ impl Plugin for ChatPlugin { .add_event::() .add_event::() .add_systems( + Update, ( handle_send_chat_event, handle_send_chat_kind_event.after(handle_send_packet_event), @@ -180,13 +182,14 @@ impl Plugin for ChatPlugin { } /// A client received a chat message packet. -#[derive(Debug, Clone)] +#[derive(Event, Debug, Clone)] pub struct ChatReceivedEvent { pub entity: Entity, pub packet: ChatPacket, } /// Send a chat message (or command, if it starts with a slash) to the server. +#[derive(Event)] pub struct SendChatEvent { pub entity: Entity, pub content: String, @@ -222,6 +225,7 @@ fn handle_send_chat_event( /// /// If you're wondering why this isn't two separate events, it's so ordering is /// preserved if multiple chat messages and commands are sent at the same time. +#[derive(Event)] pub struct SendChatKindEvent { pub entity: Entity, pub content: String, diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index ee133dd5..725cd9f3 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -45,13 +45,12 @@ use azalea_world::{ entity::{EntityPlugin, EntityUpdateSet, Local, Position, WorldName}, Instance, InstanceContainer, PartialInstance, }; -use bevy_app::{App, CoreSchedule, IntoSystemAppConfig, Plugin, PluginGroup, PluginGroupBuilder}; +use bevy_app::{App, FixedUpdate, Main, Plugin, PluginGroup, PluginGroupBuilder, Update}; use bevy_ecs::{ bundle::Bundle, component::Component, entity::Entity, - schedule::IntoSystemConfig, - schedule::{LogLevel, ScheduleBuildSettings, ScheduleLabel}, + schedule::{IntoSystemConfigs, LogLevel, ScheduleBuildSettings, ScheduleLabel}, system::{ResMut, Resource}, world::World, }; @@ -568,20 +567,20 @@ pub struct AzaleaPlugin; impl Plugin for AzaleaPlugin { fn build(&self, app: &mut App) { // Minecraft ticks happen every 50ms - app.insert_resource(FixedTime::new(Duration::from_millis(50))); - - app.add_system(update_in_loaded_chunk.after(PhysicsSet)); - - // fire the Death event when the player dies. - app.add_system(death_event); - - // add GameProfileComponent when we get an AddPlayerEvent - app.add_system(retroactively_add_game_profile_component.after(EntityUpdateSet::Index)); - - app.add_event::() - .add_system(handle_send_packet_event); - - app.init_resource::(); + app.insert_resource(FixedTime::new(Duration::from_millis(50))) + .add_systems( + Update, + ( + update_in_loaded_chunk.after(PhysicsSet), + // fire the Death event when the player dies. + death_event, + // add GameProfileComponent when we get an AddPlayerEvent + retroactively_add_game_profile_component.after(EntityUpdateSet::Index), + handle_send_packet_event, + ), + ) + .add_event::() + .init_resource::(); } } @@ -591,19 +590,17 @@ impl Plugin for AzaleaPlugin { /// [`DefaultPlugins`]. #[doc(hidden)] pub fn start_ecs( - mut app: App, + app: App, run_schedule_receiver: mpsc::UnboundedReceiver<()>, run_schedule_sender: mpsc::UnboundedSender<()>, ) -> Arc> { - app.setup(); - // 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)); tokio::spawn(run_schedule_loop( ecs.clone(), - app.outer_schedule_label, + app.main_schedule_label, run_schedule_receiver, )); tokio::spawn(tick_run_schedule_loop(run_schedule_sender)); @@ -620,7 +617,7 @@ async fn run_schedule_loop( // whenever we get an event from run_schedule_receiver, run the schedule run_schedule_receiver.recv().await; let mut ecs = ecs.lock(); - ecs.run_schedule_ref(&*outer_schedule_label); + ecs.run_schedule(&outer_schedule_label); ecs.clear_trackers(); } } @@ -671,14 +668,14 @@ pub struct TickBroadcastPlugin; impl Plugin for TickBroadcastPlugin { fn build(&self, app: &mut App) { app.insert_resource(TickBroadcast(broadcast::channel(1).0)) - .add_system(send_tick_broadcast.in_schedule(CoreSchedule::FixedUpdate)); + .add_systems(FixedUpdate, send_tick_broadcast); } } pub struct AmbiguityLoggerPlugin; impl Plugin for AmbiguityLoggerPlugin { fn build(&self, app: &mut App) { - app.edit_schedule(CoreSchedule::Main, |schedule| { + app.edit_schedule(Main, |schedule| { schedule.set_build_settings(ScheduleBuildSettings { ambiguity_detection: LogLevel::Warn, ..Default::default() diff --git a/azalea-client/src/disconnect.rs b/azalea-client/src/disconnect.rs index 3b8d133e..10aef7ba 100644 --- a/azalea-client/src/disconnect.rs +++ b/azalea-client/src/disconnect.rs @@ -1,10 +1,11 @@ //! Disconnect a client from the server. -use bevy_app::{App, CoreSet, Plugin}; +use bevy_app::{App, Plugin, PostUpdate}; use bevy_ecs::{ component::Component, entity::Entity, event::{EventReader, EventWriter}, + prelude::Event, query::Changed, schedule::IntoSystemConfigs, system::{Commands, Query}, @@ -17,18 +18,19 @@ pub struct DisconnectPlugin; impl Plugin for DisconnectPlugin { fn build(&self, app: &mut App) { app.add_event::().add_systems( + PostUpdate, ( update_read_packets_task_running_component, disconnect_on_read_packets_ended, remove_components_from_disconnected_players, ) - .in_base_set(CoreSet::PostUpdate) .chain(), ); } } /// An event sent when a client is getting disconnected. +#[derive(Event)] pub struct DisconnectEvent { pub entity: Entity, } diff --git a/azalea-client/src/events.rs b/azalea-client/src/events.rs index c7ff20aa..e97f3477 100644 --- a/azalea-client/src/events.rs +++ b/azalea-client/src/events.rs @@ -7,7 +7,7 @@ use azalea_protocol::packets::game::{ clientbound_player_combat_kill_packet::ClientboundPlayerCombatKillPacket, ClientboundGamePacket, }; use azalea_world::entity::MinecraftEntityId; -use bevy_app::{App, CoreSchedule, IntoSystemAppConfig, Plugin}; +use bevy_app::{App, FixedUpdate, Plugin, Update}; use bevy_ecs::{component::Component, event::EventReader, query::Added, system::Query}; use derive_more::{Deref, DerefMut}; use tokio::sync::mpsc; @@ -100,16 +100,21 @@ pub struct LocalPlayerEvents(pub mpsc::UnboundedSender); pub struct EventPlugin; impl Plugin for EventPlugin { fn build(&self, app: &mut App) { - app.add_system(chat_listener) - .add_system(login_listener) - .add_system(init_listener) - .add_system(packet_listener) - .add_system(add_player_listener) - .add_system(update_player_listener) - .add_system(remove_player_listener) - .add_system(death_listener) - .add_system(keepalive_listener) - .add_system(tick_listener.in_schedule(CoreSchedule::FixedUpdate)); + app.add_systems( + Update, + ( + chat_listener, + login_listener, + init_listener, + packet_listener, + add_player_listener, + update_player_listener, + remove_player_listener, + death_listener, + keepalive_listener, + ), + ) + .add_systems(FixedUpdate, tick_listener); } } diff --git a/azalea-client/src/interact.rs b/azalea-client/src/interact.rs index c389f2f3..45b845f9 100644 --- a/azalea-client/src/interact.rs +++ b/azalea-client/src/interact.rs @@ -11,12 +11,13 @@ use azalea_world::{ entity::{clamp_look_direction, view_vector, EyeHeight, LookDirection, Position, WorldName}, Instance, InstanceContainer, }; -use bevy_app::{App, Plugin}; +use bevy_app::{App, Plugin, Update}; use bevy_ecs::{ component::Component, entity::Entity, event::EventReader, - schedule::{IntoSystemConfig, IntoSystemConfigs}, + prelude::Event, + schedule::IntoSystemConfigs, system::{Commands, Query, Res}, }; use derive_more::{Deref, DerefMut}; @@ -33,6 +34,7 @@ pub struct InteractPlugin; impl Plugin for InteractPlugin { fn build(&self, app: &mut App) { app.add_event::().add_systems( + Update, ( update_hit_result_component.after(clamp_look_direction), handle_block_interact_event, @@ -61,6 +63,7 @@ impl Client { /// Right click a block. The behavior of this depends on the target block, /// and it'll either place the block you're holding in your hand or use the /// block you clicked (like toggling a lever). +#[derive(Event)] pub struct BlockInteractEvent { /// The local player entity that's opening the container. pub entity: Entity, diff --git a/azalea-client/src/inventory.rs b/azalea-client/src/inventory.rs index b7269ef1..25ce157e 100644 --- a/azalea-client/src/inventory.rs +++ b/azalea-client/src/inventory.rs @@ -14,13 +14,13 @@ use azalea_protocol::packets::game::{ serverbound_container_close_packet::ServerboundContainerClosePacket, }; use azalea_registry::MenuKind; -use bevy_app::{App, Plugin}; +use bevy_app::{App, Plugin, Update}; use bevy_ecs::{ component::Component, entity::Entity, event::EventReader, - prelude::EventWriter, - schedule::{IntoSystemConfig, IntoSystemConfigs}, + prelude::{Event, EventWriter}, + schedule::IntoSystemConfigs, system::Query, }; use log::warn; @@ -36,6 +36,7 @@ impl Plugin for InventoryPlugin { .add_event::() .add_event::() .add_systems( + Update, ( handle_menu_opened_event, handle_set_container_content_event, @@ -563,7 +564,7 @@ impl Default for InventoryComponent { /// Sent from the server when a menu (like a chest or crafting table) was /// opened by the client. -#[derive(Debug)] +#[derive(Event, Debug)] pub struct MenuOpenedEvent { pub entity: Entity, pub window_id: u32, @@ -585,6 +586,7 @@ fn handle_menu_opened_event( /// /// Note that this is also sent when the client closes its own inventory, even /// though there is no packet for opening its inventory. +#[derive(Event)] pub struct CloseContainerEvent { pub entity: Entity, /// The ID of the container to close. 0 for the player's inventory. If this @@ -621,6 +623,7 @@ fn handle_container_close_event( /// Close a container without notifying the server. /// /// Note that this also gets fired when we get a [`CloseContainerEvent`]. +#[derive(Event)] pub struct ClientSideCloseContainerEvent { pub entity: Entity, } @@ -635,7 +638,7 @@ pub fn handle_client_side_close_container_event( } } -#[derive(Debug)] +#[derive(Event, Debug)] pub struct ContainerClickEvent { pub entity: Entity, pub window_id: u8, @@ -687,6 +690,7 @@ pub fn handle_container_click_event( /// Sent from the server when the contents of a container are replaced. Usually /// triggered by the `ContainerSetContent` packet. +#[derive(Event)] pub struct SetContainerContentEvent { pub entity: Entity, pub slots: Vec, diff --git a/azalea-client/src/local_player.rs b/azalea-client/src/local_player.rs index 691f9ced..4368c47c 100644 --- a/azalea-client/src/local_player.rs +++ b/azalea-client/src/local_player.rs @@ -11,6 +11,7 @@ use bevy_ecs::{ component::Component, entity::Entity, event::EventReader, + prelude::Event, query::Added, system::{Query, Res}, }; @@ -20,7 +21,7 @@ use thiserror::Error; use tokio::{sync::mpsc, task::JoinHandle}; use crate::{ - events::{Event, LocalPlayerEvents}, + events::{Event as AzaleaEvent, LocalPlayerEvents}, ClientInformation, WalkDirection, }; @@ -155,7 +156,7 @@ pub fn update_in_loaded_chunk( /// Send the "Death" event for [`LocalPlayer`]s that died with no reason. pub fn death_event(query: Query<&LocalPlayerEvents, Added>) { for local_player_events in &query { - local_player_events.send(Event::Death(None)).unwrap(); + local_player_events.send(AzaleaEvent::Death(None)).unwrap(); } } @@ -168,7 +169,7 @@ pub enum HandlePacketError { #[error(transparent)] Other(#[from] anyhow::Error), #[error("{0}")] - Send(#[from] mpsc::error::SendError), + Send(#[from] mpsc::error::SendError), } impl From> for HandlePacketError { @@ -178,6 +179,7 @@ impl From> for HandlePacketError { } /// Event for sending a packet to the server. +#[derive(Event)] pub struct SendPacketEvent { pub entity: Entity, pub packet: ServerboundGamePacket, diff --git a/azalea-client/src/mining.rs b/azalea-client/src/mining.rs index ab141661..241c4fde 100644 --- a/azalea-client/src/mining.rs +++ b/azalea-client/src/mining.rs @@ -1,5 +1,5 @@ use azalea_core::BlockPos; -use bevy_app::{App, Plugin}; +use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::*; use crate::Client; @@ -9,7 +9,7 @@ pub struct MinePlugin; impl Plugin for MinePlugin { fn build(&self, app: &mut App) { app.add_event::() - .add_system(handle_start_mining_block_event); + .add_systems(Update, handle_start_mining_block_event); } } @@ -23,6 +23,7 @@ impl Client { } } +#[derive(Event)] pub struct StartMiningBlockEvent { pub entity: Entity, pub position: BlockPos, diff --git a/azalea-client/src/movement.rs b/azalea-client/src/movement.rs index d68be8b8..2db392b4 100644 --- a/azalea-client/src/movement.rs +++ b/azalea-client/src/movement.rs @@ -14,14 +14,11 @@ use azalea_world::{ entity::{self, metadata::Sprinting, Attributes, Jumping, MinecraftEntityId}, MoveEntityError, }; -use bevy_app::{App, CoreSchedule, IntoSystemAppConfigs, Plugin}; +use bevy_app::{App, FixedUpdate, Plugin, Update}; +use bevy_ecs::prelude::Event; use bevy_ecs::{ - component::Component, - entity::Entity, - event::EventReader, - query::With, - schedule::{IntoSystemConfig, IntoSystemConfigs}, - system::Query, + component::Component, entity::Entity, event::EventReader, query::With, + schedule::IntoSystemConfigs, system::Query, }; use std::backtrace::Backtrace; use thiserror::Error; @@ -51,17 +48,18 @@ impl Plugin for PlayerMovePlugin { app.add_event::() .add_event::() .add_systems( + Update, (sprint_listener, walk_listener) .chain() .before(force_jump_listener), ) .add_systems( + FixedUpdate, ( local_player_ai_step.in_set(PhysicsSet), send_position.after(update_in_loaded_chunk), ) - .chain() - .in_schedule(CoreSchedule::FixedUpdate), + .chain(), ); } } @@ -379,6 +377,7 @@ impl Client { /// An event sent when the client starts walking. This does not get sent for /// non-local entities. +#[derive(Event)] pub struct StartWalkEvent { pub entity: Entity, pub direction: WalkDirection, @@ -402,6 +401,7 @@ pub fn walk_listener( /// An event sent when the client starts sprinting. This does not get sent for /// non-local entities. +#[derive(Event)] pub struct StartSprintEvent { pub entity: Entity, pub direction: SprintDirection, diff --git a/azalea-client/src/packet_handling.rs b/azalea-client/src/packet_handling.rs index 50887096..2371d834 100644 --- a/azalea-client/src/packet_handling.rs +++ b/azalea-client/src/packet_handling.rs @@ -24,12 +24,13 @@ use azalea_world::{ entity::{LoadedBy, RelativeEntityUpdate}, InstanceContainer, PartialInstance, }; -use bevy_app::{App, CoreSet, Plugin}; +use bevy_app::{App, First, Plugin, PreUpdate}; use bevy_ecs::{ component::Component, entity::Entity, event::{EventReader, EventWriter, Events}, - schedule::IntoSystemConfig, + prelude::Event, + schedule::IntoSystemConfigs, system::{Commands, Query, ResMut, SystemState}, world::World, }; @@ -69,7 +70,7 @@ use crate::{ /// } /// } /// ``` -#[derive(Debug, Clone)] +#[derive(Event, Debug, Clone)] pub struct PacketEvent { /// The client entity that received the packet. pub entity: Entity, @@ -81,10 +82,10 @@ pub struct PacketHandlerPlugin; impl Plugin for PacketHandlerPlugin { fn build(&self, app: &mut App) { - app.add_system(send_packet_events.in_base_set(CoreSet::First)) - .add_system( + app.add_systems(First, send_packet_events) + .add_systems( + PreUpdate, process_packet_events - .in_base_set(CoreSet::PreUpdate) // we want to index and deindex right after .before(EntityUpdateSet::Deindex), ) @@ -100,7 +101,7 @@ impl Plugin for PacketHandlerPlugin { /// A player joined the game (or more specifically, was added to the tab /// list of a local player). -#[derive(Debug, Clone)] +#[derive(Event, Debug, Clone)] pub struct AddPlayerEvent { /// The local player entity that received this event. pub entity: Entity, @@ -108,7 +109,7 @@ pub struct AddPlayerEvent { } /// A player left the game (or maybe is still in the game and was just /// removed from the tab list of a local player). -#[derive(Debug, Clone)] +#[derive(Event, Debug, Clone)] pub struct RemovePlayerEvent { /// The local player entity that received this event. pub entity: Entity, @@ -116,7 +117,7 @@ pub struct RemovePlayerEvent { } /// A player was updated in the tab list of a local player (gamemode, display /// name, or latency changed). -#[derive(Debug, Clone)] +#[derive(Event, Debug, Clone)] pub struct UpdatePlayerEvent { /// The local player entity that received this event. pub entity: Entity, @@ -126,7 +127,7 @@ pub struct UpdatePlayerEvent { /// Event for when an entity dies. dies. If it's a local player and there's a /// reason in the death screen, the [`ClientboundPlayerCombatKillPacket`] will /// be included. -#[derive(Debug, Clone)] +#[derive(Event, Debug, Clone)] pub struct DeathEvent { pub entity: Entity, pub packet: Option, @@ -134,7 +135,7 @@ pub struct DeathEvent { /// A KeepAlive packet is sent from the server to verify that the client is /// still connected. -#[derive(Debug, Clone)] +#[derive(Event, Debug, Clone)] pub struct KeepAliveEvent { pub entity: Entity, /// The ID of the keepalive. This is an arbitrary number, but vanilla @@ -143,7 +144,7 @@ pub struct KeepAliveEvent { } /// Something that receives packets from the server. -#[derive(Component, Clone)] +#[derive(Event, Component, Clone)] pub struct PacketReceiver { pub packets: Arc>>, pub run_schedule_sender: mpsc::UnboundedSender<()>, diff --git a/azalea-client/src/respawn.rs b/azalea-client/src/respawn.rs index 3ac17612..d0ef1cca 100644 --- a/azalea-client/src/respawn.rs +++ b/azalea-client/src/respawn.rs @@ -1,13 +1,13 @@ use azalea_protocol::packets::game::serverbound_client_command_packet::{ self, ServerboundClientCommandPacket, }; -use bevy_app::{App, Plugin}; +use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::*; use crate::local_player::{handle_send_packet_event, SendPacketEvent}; /// Tell the server that we're respawning. -#[derive(Debug, Clone)] +#[derive(Event, Debug, Clone)] pub struct PerformRespawnEvent { pub entity: Entity, } @@ -17,7 +17,7 @@ pub struct RespawnPlugin; impl Plugin for RespawnPlugin { fn build(&self, app: &mut App) { app.add_event::() - .add_system(perform_respawn.before(handle_send_packet_event)); + .add_systems(Update, perform_respawn.before(handle_send_packet_event)); } } diff --git a/azalea-client/src/task_pool.rs b/azalea-client/src/task_pool.rs index 8df554f0..982c3396 100644 --- a/azalea-client/src/task_pool.rs +++ b/azalea-client/src/task_pool.rs @@ -2,11 +2,8 @@ use std::marker::PhantomData; -use bevy_app::{App, CoreSet, Plugin}; -use bevy_ecs::{ - schedule::IntoSystemConfig, - system::{NonSend, Resource}, -}; +use bevy_app::{App, Last, Plugin}; +use bevy_ecs::system::{NonSend, Resource}; use bevy_tasks::{ tick_global_task_pools_on_main_thread, AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool, TaskPoolBuilder, @@ -27,7 +24,7 @@ impl Plugin for TaskPoolPlugin { self.task_pool_options.create_default_pools(); #[cfg(not(target_arch = "wasm32"))] - app.add_system(tick_global_task_pools.in_base_set(CoreSet::Last)); + app.add_systems(Last, tick_global_task_pools); } } diff --git a/azalea-core/Cargo.toml b/azalea-core/Cargo.toml index 1982f878..99725414 100644 --- a/azalea-core/Cargo.toml +++ b/azalea-core/Cargo.toml @@ -14,10 +14,10 @@ azalea-chat = { path = "../azalea-chat", version = "^0.7.0" } azalea-inventory = { version = "0.7.0", path = "../azalea-inventory" } azalea-nbt = { path = "../azalea-nbt", version = "^0.7.0" } azalea-registry = { path = "../azalea-registry", version = "^0.7.0" } -bevy_ecs = { version = "0.10.0", default-features = false, optional = true } +bevy_ecs = { version = "0.11.0", default-features = false, optional = true } num-traits = "0.2.15" serde = { version = "^1.0", optional = true } -uuid = "^1.1.2" +uuid = "^1.4.0" [features] bevy_ecs = ["dep:bevy_ecs"] diff --git a/azalea-crypto/Cargo.toml b/azalea-crypto/Cargo.toml index f9847645..d317fbd8 100644 --- a/azalea-crypto/Cargo.toml +++ b/azalea-crypto/Cargo.toml @@ -9,19 +9,19 @@ repository = "https://github.com/mat-1/azalea/tree/main/azalea-crypto" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -aes = "0.8.1" +aes = "0.8.3" azalea-buf = { path = "../azalea-buf", version = "^0.7.0" } cfb8 = "0.8.1" num-bigint = "^0.4.3" -rand = { version = "^0.8.4", features = ["getrandom"] } +rand = { version = "^0.8.5", features = ["getrandom"] } rsa = { version = "0.9.2", features = ["sha2"] } rsa_public_encrypt_pkcs1 = "0.4.0" -sha-1 = "^0.10.0" -sha2 = "0.10.6" -uuid = "^1.1.2" +sha-1 = "^0.10.1" +sha2 = "0.10.7" +uuid = "^1.4.0" [dev-dependencies] -criterion = { version = "^0.4.0", features = ["html_reports"] } +criterion = { version = "^0.5.1", features = ["html_reports"] } [[bench]] harness = false diff --git a/azalea-inventory/azalea-inventory-macros/Cargo.toml b/azalea-inventory/azalea-inventory-macros/Cargo.toml index ee41c6b6..56590aec 100644 --- a/azalea-inventory/azalea-inventory-macros/Cargo.toml +++ b/azalea-inventory/azalea-inventory-macros/Cargo.toml @@ -12,6 +12,6 @@ proc-macro = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -proc-macro2 = "1.0.47" -quote = "1.0.21" -syn = "1.0.104" +proc-macro2 = "1.0.64" +quote = "1.0.29" +syn = "2.0.25" diff --git a/azalea-inventory/azalea-inventory-macros/src/parse_macro.rs b/azalea-inventory/azalea-inventory-macros/src/parse_macro.rs index 8eada4ec..6aafe16f 100644 --- a/azalea-inventory/azalea-inventory-macros/src/parse_macro.rs +++ b/azalea-inventory/azalea-inventory-macros/src/parse_macro.rs @@ -39,7 +39,7 @@ impl Parse for Menu { let content; braced!(content in input); let fields = content - .parse_terminated::(Field::parse)? + .parse_terminated(Field::parse, Token![,])? .into_iter() .collect(); @@ -61,7 +61,7 @@ pub struct DeclareMenus { impl Parse for DeclareMenus { fn parse(input: ParseStream) -> Result { let menus = input - .parse_terminated::(Menu::parse)? + .parse_terminated(Menu::parse, Token![,])? .into_iter() .collect(); Ok(Self { menus }) diff --git a/azalea-language/Cargo.toml b/azalea-language/Cargo.toml index ae24aed3..d79b7c42 100644 --- a/azalea-language/Cargo.toml +++ b/azalea-language/Cargo.toml @@ -9,7 +9,7 @@ version = "0.7.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -once_cell = "1.16.0" +once_cell = "1.18.0" serde = "^1.0" -serde_json = "^1.0.93" +serde_json = "^1.0.100" # tokio = {version = "^1.21.2", features = ["fs"]} diff --git a/azalea-nbt/Cargo.toml b/azalea-nbt/Cargo.toml index e2c253f5..bfbc6c5d 100644 --- a/azalea-nbt/Cargo.toml +++ b/azalea-nbt/Cargo.toml @@ -11,18 +11,18 @@ repository = "https://github.com/mat-1/azalea/tree/main/azalea-nbt" [dependencies] azalea-buf = { path = "../azalea-buf", version = "^0.7.0" } byteorder = "^1.4.3" -compact_str = { version = "0.7.0", features = ["serde"] } -enum-as-inner = "0.5.1" -flate2 = "^1.0.25" -log = "0.4.17" +compact_str = { version = "0.7.1", features = ["serde"] } +enum-as-inner = "0.6.0" +flate2 = "^1.0.26" +log = "0.4.19" packed_simd_2 = "0.3.8" serde = { version = "^1.0", features = ["derive"], optional = true } [dev-dependencies] -criterion = { version = "^0.4.0", features = ["html_reports"] } +criterion = { version = "^0.5.1", features = ["html_reports"] } graphite_binary = "0.1.0" valence_nbt = "0.4.0" -fastnbt = "2.4.3" +fastnbt = "2.4.4" [features] default = [] diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index 086620dc..7209420c 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -14,11 +14,11 @@ azalea-core = { path = "../azalea-core", version = "^0.7.0" } azalea-inventory = { version = "0.7.0", path = "../azalea-inventory" } azalea-registry = { path = "../azalea-registry", version = "^0.7.0" } azalea-world = { path = "../azalea-world", version = "^0.7.0" } -bevy_app = "0.10.0" -bevy_ecs = "0.10.0" -once_cell = "1.16.0" +bevy_app = "0.11.0" +bevy_ecs = "0.11.0" +once_cell = "1.18.0" parking_lot = "^0.12.1" [dev-dependencies] -bevy_time = "0.10.0" -uuid = "^1.1.2" +bevy_time = "0.11.0" +uuid = "^1.4.0" diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index 57c2100e..0d9f3be4 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -13,12 +13,13 @@ use azalea_world::{ }, Instance, InstanceContainer, }; -use bevy_app::{App, CoreSchedule, IntoSystemAppConfigs, Plugin}; +use bevy_app::{App, FixedUpdate, Plugin, Update}; use bevy_ecs::{ entity::Entity, event::{EventReader, EventWriter}, + prelude::Event, query::With, - schedule::{IntoSystemConfig, IntoSystemConfigs, SystemSet}, + schedule::{IntoSystemConfigs, SystemSet}, system::{Query, Res}, }; use collision::{move_colliding, MoverType}; @@ -31,17 +32,13 @@ pub struct PhysicsPlugin; impl Plugin for PhysicsPlugin { fn build(&self, app: &mut App) { app.add_event::() - .add_system( + .add_systems( + Update, force_jump_listener .before(azalea_world::entity::update_bounding_box) .after(clamp_look_direction), ) - .add_systems( - (ai_step, travel) - .chain() - .in_set(PhysicsSet) - .in_schedule(CoreSchedule::FixedUpdate), - ); + .add_systems(FixedUpdate, (ai_step, travel).chain().in_set(PhysicsSet)); } } @@ -170,6 +167,7 @@ pub fn ai_step( } /// Jump even if we aren't on the ground. +#[derive(Event)] pub struct ForceJumpEvent(pub Entity); pub fn force_jump_listener( @@ -340,8 +338,7 @@ mod tests { /// You need an app to spawn entities in the world and do updates. fn make_test_app() -> App { let mut app = App::new(); - app.add_plugin(PhysicsPlugin) - .add_plugin(EntityPlugin) + app.add_plugins((PhysicsPlugin, EntityPlugin)) .insert_resource(FixedTime::new(Duration::from_millis(50))) .init_resource::(); app @@ -378,7 +375,7 @@ mod tests { // y should start at 70 assert_eq!(entity_pos.y, 70.); } - app.world.run_schedule(CoreSchedule::FixedUpdate); + app.world.run_schedule(FixedUpdate); app.update(); { let entity_pos = *app.world.get::(entity).unwrap(); @@ -387,7 +384,7 @@ mod tests { let entity_physics = app.world.get::(entity).unwrap().clone(); assert!(entity_physics.delta.y < 0.); } - app.world.run_schedule(CoreSchedule::FixedUpdate); + app.world.run_schedule(FixedUpdate); app.update(); { let entity_pos = *app.world.get::(entity).unwrap(); @@ -440,7 +437,7 @@ mod tests { block_state.is_some(), "Block state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed" ); - app.world.run_schedule(CoreSchedule::FixedUpdate); + app.world.run_schedule(FixedUpdate); app.update(); { let entity_pos = *app.world.get::(entity).unwrap(); @@ -449,7 +446,7 @@ mod tests { let entity_physics = app.world.get::(entity).unwrap().clone(); assert!(entity_physics.delta.y < 0.); } - app.world.run_schedule(CoreSchedule::FixedUpdate); + app.world.run_schedule(FixedUpdate); app.update(); { let entity_pos = *app.world.get::(entity).unwrap(); @@ -505,7 +502,7 @@ mod tests { ); // do a few steps so we fall on the slab for _ in 0..20 { - app.world.run_schedule(CoreSchedule::FixedUpdate); + app.world.run_schedule(FixedUpdate); app.update(); } let entity_pos = app.world.get::(entity).unwrap(); @@ -558,7 +555,7 @@ mod tests { ); // do a few steps so we fall on the slab for _ in 0..20 { - app.world.run_schedule(CoreSchedule::FixedUpdate); + app.world.run_schedule(FixedUpdate); app.update(); } let entity_pos = app.world.get::(entity).unwrap(); @@ -615,7 +612,7 @@ mod tests { ); // do a few steps so we fall on the wall for _ in 0..20 { - app.world.run_schedule(CoreSchedule::FixedUpdate); + app.world.run_schedule(FixedUpdate); app.update(); } @@ -677,7 +674,7 @@ mod tests { ); // do a few steps so we fall on the wall for _ in 0..20 { - app.world.run_schedule(CoreSchedule::FixedUpdate); + app.world.run_schedule(FixedUpdate); app.update(); } diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 8f702aa4..ebe49e64 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -9,11 +9,11 @@ version = "0.7.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -async-compression = { version = "^0.3.8", features = [ +async-compression = { version = "^0.4.0", features = [ "tokio", "zlib", ], optional = true } -async-recursion = "1.0.0" +async-recursion = "1.0.4" azalea-auth = { path = "../azalea-auth", version = "^0.7.0" } azalea-block = { path = "../azalea-block", default-features = false, version = "^0.7.0" } azalea-brigadier = { path = "../azalea-brigadier", version = "^0.7.0", features = [ @@ -32,22 +32,22 @@ azalea-nbt = { path = "../azalea-nbt", version = "^0.7.0", features = [ azalea-protocol-macros = { path = "./azalea-protocol-macros", version = "^0.7.0" } azalea-registry = { path = "../azalea-registry", version = "^0.7.0" } azalea-world = { path = "../azalea-world", version = "^0.7.0" } -bevy_ecs = { version = "0.10.0", default-features = false } +bevy_ecs = { version = "0.11.0", default-features = false } byteorder = "^1.4.3" -bytes = "^1.1.0" -flate2 = "1.0.25" -futures = "0.3.24" -futures-util = "0.3.24" -log = "0.4.17" +bytes = "^1.4.0" +flate2 = "1.0.26" +futures = "0.3.28" +futures-util = "0.3.28" +log = "0.4.19" serde = { version = "^1.0", features = ["serde_derive"] } -serde_json = "^1.0.93" -thiserror = "1.0.37" -tokio = { version = "^1.24.2", features = ["io-util", "net", "macros"] } -tokio-util = { version = "0.7.4", features = ["codec"] } +serde_json = "^1.0.100" +thiserror = "1.0.43" +tokio = { version = "^1.29.1", features = ["io-util", "net", "macros"] } +tokio-util = { version = "0.7.8", features = ["codec"] } trust-dns-resolver = { version = "^0.22.0", default-features = false, features = [ "tokio-runtime", ] } -uuid = "1.1.2" +uuid = "1.4.0" [features] connecting = [] @@ -56,7 +56,7 @@ packets = ["connecting", "dep:async-compression", "dep:azalea-core"] strict_registry = ["packets"] [dev-dependencies] -anyhow = "^1.0.65" -tracing = "^0.1.36" -tracing-subscriber = "^0.3.15" -once_cell = "1.17.0" +anyhow = "^1.0.71" +tracing = "^0.1.37" +tracing-subscriber = "^0.3.17" +once_cell = "1.18.0" diff --git a/azalea-protocol/azalea-protocol-macros/Cargo.toml b/azalea-protocol/azalea-protocol-macros/Cargo.toml index dcd9a329..e78368f4 100644 --- a/azalea-protocol/azalea-protocol-macros/Cargo.toml +++ b/azalea-protocol/azalea-protocol-macros/Cargo.toml @@ -11,6 +11,6 @@ proc-macro = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -proc-macro2 = "^1.0.36" -quote = "^1.0.10" -syn = "^1.0.82" +proc-macro2 = "^1.0.64" +quote = "^1.0.29" +syn = "^2.0.25" diff --git a/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs index a561fa9c..81704b37 100755 --- a/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs @@ -142,6 +142,7 @@ mod tests { }), criteria: HashMap::new(), requirements: Vec::new(), + sends_telemetry_event: false, }, )] .into_iter() diff --git a/azalea-registry/azalea-registry-macros/Cargo.toml b/azalea-registry/azalea-registry-macros/Cargo.toml index 1bb659ac..daebb4d0 100644 --- a/azalea-registry/azalea-registry-macros/Cargo.toml +++ b/azalea-registry/azalea-registry-macros/Cargo.toml @@ -12,9 +12,9 @@ proc-macro = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -proc-macro2 = "1.0.39" -quote = "1.0.18" -syn = "1.0.95" +proc-macro2 = "1.0.64" +quote = "1.0.29" +syn = "2.0.25" [features] serde = [] diff --git a/azalea-registry/azalea-registry-macros/src/lib.rs b/azalea-registry/azalea-registry-macros/src/lib.rs index f8f4feb6..3bf798a5 100755 --- a/azalea-registry/azalea-registry-macros/src/lib.rs +++ b/azalea-registry/azalea-registry-macros/src/lib.rs @@ -43,8 +43,8 @@ impl Parse for Registry { let name = input.parse()?; let content; braced!(content in input); - let items: Punctuated = - content.parse_terminated(RegistryItem::parse)?; + let items: Punctuated = + content.parse_terminated(RegistryItem::parse, Token![,])?; Ok(Registry { name, diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index b2c1aa5c..9f3ea8ee 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -18,16 +18,16 @@ azalea-core = { path = "../azalea-core", version = "^0.7.0", features = [ azalea-inventory = { version = "0.7.0", path = "../azalea-inventory" } azalea-nbt = { path = "../azalea-nbt", version = "^0.7.0" } azalea-registry = { path = "../azalea-registry", version = "^0.7.0" } -bevy_app = "0.10.0" -bevy_ecs = "0.10.0" +bevy_app = "0.11.0" +bevy_ecs = "0.11.0" derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } -enum-as-inner = "0.5.1" -log = "0.4.17" +enum-as-inner = "0.6.0" +log = "0.4.19" nohash-hasher = "0.2.0" -once_cell = "1.16.0" +once_cell = "1.18.0" parking_lot = "^0.12.1" -thiserror = "1.0.34" -uuid = "1.1.2" +thiserror = "1.0.43" +uuid = "1.4.0" [profile.release] lto = true diff --git a/azalea-world/src/entity/info.rs b/azalea-world/src/entity/info.rs index 525b57fa..03b72f94 100644 --- a/azalea-world/src/entity/info.rs +++ b/azalea-world/src/entity/info.rs @@ -9,12 +9,12 @@ use crate::{ update_entity_by_id_index, update_uuid_index, InstanceContainer, PartialInstance, }; use azalea_core::ChunkPos; -use bevy_app::{App, CoreSet, Plugin}; +use bevy_app::{App, Plugin, PostUpdate, PreUpdate, Update}; use bevy_ecs::{ component::Component, entity::Entity, query::{Added, Changed, With, Without}, - schedule::{IntoSystemConfig, IntoSystemConfigs, SystemSet}, + schedule::{IntoSystemConfigs, SystemSet}, system::{Commands, EntityCommand, Query, Res, ResMut, Resource}, world::{EntityMut, World}, }; @@ -51,32 +51,33 @@ impl Plugin for EntityPlugin { // added to indexes during update (done by this plugin) // modified during update // despawned post-update (done by this plugin) - app.add_system( - remove_despawned_entities_from_indexes - .in_base_set(CoreSet::PreUpdate) - .in_set(EntityUpdateSet::Deindex), + app.add_systems( + PreUpdate, + remove_despawned_entities_from_indexes.in_set(EntityUpdateSet::Deindex), ) .add_systems( - (deduplicate_entities, deduplicate_local_entities) - .in_base_set(CoreSet::PostUpdate) - .in_set(EntityUpdateSet::Deduplicate), + PostUpdate, + (deduplicate_entities, deduplicate_local_entities).in_set(EntityUpdateSet::Deduplicate), ) .add_systems( + Update, ( - update_entity_chunk_positions, - update_uuid_index, - update_entity_by_id_index, - ) - .in_set(EntityUpdateSet::Index), + ( + update_entity_chunk_positions, + update_uuid_index, + update_entity_by_id_index, + ) + .in_set(EntityUpdateSet::Index), + ( + add_updates_received, + debug_new_entity, + debug_detect_updates_received_on_local_entities, + add_dead, + update_bounding_box, + clamp_look_direction, + ), + ), ) - .add_systems(( - add_updates_received, - debug_new_entity, - debug_detect_updates_received_on_local_entities, - add_dead, - update_bounding_box, - clamp_look_direction, - )) .init_resource::(); } } @@ -152,7 +153,7 @@ pub struct RelativeEntityUpdate { pub update: Box, } impl EntityCommand for RelativeEntityUpdate { - fn write(self, entity: Entity, world: &mut World) { + fn apply(self, entity: Entity, world: &mut World) { let partial_entity_infos = &mut self.partial_world.write().entity_infos; let mut entity_mut = world.entity_mut(entity); diff --git a/azalea/Cargo.toml b/azalea/Cargo.toml index 4e83bdc0..4b396e39 100644 --- a/azalea/Cargo.toml +++ b/azalea/Cargo.toml @@ -12,8 +12,8 @@ pre-release-replacements = [ ] [dependencies] -anyhow = "^1.0.65" -async-trait = "0.1.58" +anyhow = "^1.0.71" +async-trait = "0.1.71" azalea-block = { version = "0.7.0", path = "../azalea-block" } azalea-chat = { version = "0.7.0", path = "../azalea-chat" } azalea-client = { version = "0.7.0", path = "../azalea-client" } @@ -25,21 +25,21 @@ azalea-registry = { version = "0.7.0", path = "../azalea-registry" } azalea-world = { version = "0.7.0", path = "../azalea-world" } azalea-auth = { version = "0.7.0", path = "../azalea-auth" } azalea-brigadier = { version = "0.7.0", path = "../azalea-brigadier" } -bevy_app = "0.10.0" -bevy_ecs = "0.10.0" -bevy_tasks = "0.10.0" +bevy_app = "0.11.0" +bevy_ecs = "0.11.0" +bevy_tasks = "0.11.0" derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } -futures = "0.3.25" -futures-lite = "1.12.0" -log = "0.4.17" +futures = "0.3.28" +futures-lite = "1.13.0" +log = "0.4.19" nohash-hasher = "0.2.0" num-traits = "0.2.15" parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } -priority-queue = "1.3.0" -thiserror = "^1.0.37" -tokio = "^1.24.2" -uuid = "1.2.2" -bevy_log = "0.10.1" +priority-queue = "1.3.2" +thiserror = "^1.0.43" +tokio = "^1.29.1" +uuid = "1.4.0" +bevy_log = "0.11.0" [features] default = ["log"] diff --git a/azalea/src/auto_respawn.rs b/azalea/src/auto_respawn.rs index d2973a2f..77a75b4b 100644 --- a/azalea/src/auto_respawn.rs +++ b/azalea/src/auto_respawn.rs @@ -1,6 +1,7 @@ use crate::app::{App, Plugin}; use azalea_client::packet_handling::DeathEvent; use azalea_client::respawn::{perform_respawn, PerformRespawnEvent}; +use bevy_app::Update; use bevy_ecs::prelude::*; /// A plugin that makes [`DeathEvent`]s send [`PerformRespawnEvent`]s. @@ -8,7 +9,7 @@ use bevy_ecs::prelude::*; pub struct AutoRespawnPlugin; impl Plugin for AutoRespawnPlugin { fn build(&self, app: &mut App) { - app.add_system(auto_respawn.before(perform_respawn)); + app.add_systems(Update, auto_respawn.before(perform_respawn)); } } diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs index 13b33bb0..47c825ca 100644 --- a/azalea/src/bot.rs +++ b/azalea/src/bot.rs @@ -1,4 +1,4 @@ -use crate::app::{App, CoreSchedule, IntoSystemAppConfig, Plugin, PluginGroup, PluginGroupBuilder}; +use crate::app::{App, Plugin, PluginGroup, PluginGroupBuilder}; use crate::auto_respawn::AutoRespawnPlugin; use crate::container::ContainerPlugin; use crate::ecs::{ @@ -6,13 +6,15 @@ use crate::ecs::{ entity::Entity, event::EventReader, query::{With, Without}, - schedule::IntoSystemConfig, system::{Commands, Query}, }; use azalea_core::Vec3; use azalea_physics::{force_jump_listener, PhysicsSet}; use azalea_world::entity::{clamp_look_direction, EyeHeight, LookDirection}; use azalea_world::entity::{metadata::Player, Jumping, Local, Position}; +use bevy_app::{FixedUpdate, Update}; +use bevy_ecs::prelude::Event; +use bevy_ecs::schedule::IntoSystemConfigs; use std::f64::consts::PI; use crate::pathfinder::PathfinderPlugin; @@ -23,16 +25,17 @@ impl Plugin for BotPlugin { fn build(&self, app: &mut App) { app.add_event::() .add_event::() - .add_systems(( - insert_bot, - look_at_listener - .before(force_jump_listener) - .before(clamp_look_direction), - jump_listener, - stop_jumping - .in_schedule(CoreSchedule::FixedUpdate) - .after(PhysicsSet), - )); + .add_systems( + Update, + ( + insert_bot, + look_at_listener + .before(force_jump_listener) + .before(clamp_look_direction), + jump_listener, + ), + ) + .add_systems(FixedUpdate, stop_jumping.after(PhysicsSet)); } } @@ -85,6 +88,7 @@ impl BotClientExt for azalea_client::Client { } /// Event to jump once. +#[derive(Event)] pub struct JumpEvent(pub Entity); fn jump_listener(mut query: Query<(&mut Jumping, &mut Bot)>, mut events: EventReader) { @@ -97,6 +101,7 @@ fn jump_listener(mut query: Query<(&mut Jumping, &mut Bot)>, mut events: EventRe } /// Make an entity look towards a certain position in the world. +#[derive(Event)] pub struct LookAtEvent { pub entity: Entity, /// The position we want the entity to be looking at. diff --git a/azalea/src/container.rs b/azalea/src/container.rs index fefcf189..dc0ba169 100644 --- a/azalea/src/container.rs +++ b/azalea/src/container.rs @@ -8,14 +8,14 @@ use azalea_client::{ use azalea_core::BlockPos; use azalea_inventory::{operations::ClickOperation, ItemSlot, Menu}; use azalea_protocol::packets::game::ClientboundGamePacket; -use bevy_app::{App, Plugin}; +use bevy_app::{App, Plugin, Update}; use bevy_ecs::{component::Component, prelude::EventReader, system::Commands}; use std::fmt::Debug; pub struct ContainerPlugin; impl Plugin for ContainerPlugin { fn build(&self, app: &mut App) { - app.add_system(handle_menu_opened_event); + app.add_systems(Update, handle_menu_opened_event); } } diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index ec967708..1c6966c5 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -10,7 +10,7 @@ pub mod pathfinder; pub mod prelude; pub mod swarm; -use app::{App, Plugin, PluginGroup}; +use app::{App, Plugins}; pub use azalea_auth as auth; pub use azalea_block as blocks; pub use azalea_brigadier as brigadier; @@ -148,16 +148,10 @@ where self.state = state; self } - /// Add a plugin to the client. - #[must_use] - pub fn add_plugin(mut self, plugin: T) -> Self { - self.app.add_plugin(plugin); - self - } /// Add a group of plugins to the client. #[must_use] - pub fn add_plugins(mut self, plugin_group: T) -> Self { - self.app.add_plugins(plugin_group); + pub fn add_plugins(mut self, plugins: impl Plugins) -> Self { + self.app.add_plugins(plugins); self } diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index b7ed222d..9547d263 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -5,13 +5,12 @@ use crate::bot::{JumpEvent, LookAtEvent}; use crate::pathfinder::astar::a_star; use crate::{SprintDirection, WalkDirection}; -use crate::app::{App, CoreSchedule, IntoSystemAppConfig, Plugin}; +use crate::app::{App, Plugin}; use crate::ecs::{ component::Component, entity::Entity, event::{EventReader, EventWriter}, query::{With, Without}, - schedule::IntoSystemConfig, system::{Commands, Query, Res}, }; use astar::Edge; @@ -24,6 +23,9 @@ use azalea_world::{ entity::{Physics, Position, WorldName}, InstanceContainer, }; +use bevy_app::{FixedUpdate, Update}; +use bevy_ecs::prelude::Event; +use bevy_ecs::schedule::IntoSystemConfigs; use bevy_tasks::{AsyncComputeTaskPool, Task}; use futures_lite::future; use log::{debug, error}; @@ -36,17 +38,20 @@ impl Plugin for PathfinderPlugin { fn build(&self, app: &mut App) { app.add_event::() .add_event::() - .add_system( - // Adding `.in_schedule(CoreSchedule::FixedUpdate)` makes a system run every - // Minecraft tick (every 50 milliseconds). - tick_execute_path - .in_schedule(CoreSchedule::FixedUpdate) - .before(PhysicsSet), + .add_systems( + FixedUpdate, + // putting systems in the FixedUpdate schedule makes them run every Minecraft tick + // (every 50 milliseconds). + tick_execute_path.before(PhysicsSet), ) - .add_system(goto_listener) - .add_system(add_default_pathfinder) - .add_system(handle_tasks.before(path_found_listener)) - .add_system(path_found_listener); + .add_systems( + Update, + ( + goto_listener, + add_default_pathfinder, + (handle_tasks, path_found_listener).chain(), + ), + ); } } @@ -84,10 +89,12 @@ impl PathfinderClientExt for azalea_client::Client { }); } } +#[derive(Event)] pub struct GotoEvent { pub entity: Entity, pub goal: Arc, } +#[derive(Event)] pub struct PathFoundEvent { pub entity: Entity, pub path: VecDeque, diff --git a/azalea/src/swarm/chat.rs b/azalea/src/swarm/chat.rs index 303ce35b..6cf4d6b6 100644 --- a/azalea/src/swarm/chat.rs +++ b/azalea/src/swarm/chat.rs @@ -20,7 +20,8 @@ use crate::ecs::{ system::{Commands, Query, Res, ResMut, Resource}, }; use azalea_client::chat::{ChatPacket, ChatReceivedEvent}; -use bevy_app::{App, Plugin}; +use bevy_app::{App, Plugin, Update}; +use bevy_ecs::prelude::Event; use std::collections::VecDeque; use super::{Swarm, SwarmEvent}; @@ -30,7 +31,10 @@ pub struct SwarmChatPlugin; impl Plugin for SwarmChatPlugin { fn build(&self, app: &mut App) { app.add_event::() - .add_systems((chat_listener, update_min_index_and_shrink_queue).chain()) + .add_systems( + Update, + (chat_listener, update_min_index_and_shrink_queue).chain(), + ) .insert_resource(GlobalChatState { chat_queue: VecDeque::new(), chat_min_index: 0, @@ -44,7 +48,7 @@ pub struct ClientChatState { } /// A chat message that no other bots have seen yet was received by a bot. -#[derive(Debug)] +#[derive(Event, Debug)] pub struct NewChatMessageEvent(ChatPacket); #[derive(Resource)] @@ -160,7 +164,10 @@ mod tests { // event mangement in drain_events app.init_resource::>() .init_resource::>() - .add_systems((chat_listener, update_min_index_and_shrink_queue).chain()) + .add_systems( + Update, + (chat_listener, update_min_index_and_shrink_queue).chain(), + ) .insert_resource(GlobalChatState { chat_queue: VecDeque::new(), chat_min_index: 0, diff --git a/azalea/src/swarm/events.rs b/azalea/src/swarm/events.rs index 62593029..b4752abf 100644 --- a/azalea/src/swarm/events.rs +++ b/azalea/src/swarm/events.rs @@ -1,6 +1,6 @@ use azalea_client::LocalPlayer; use azalea_world::entity::MinecraftEntityId; -use bevy_app::{App, Plugin}; +use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::*; use derive_more::{Deref, DerefMut}; @@ -8,12 +8,13 @@ pub struct SwarmPlugin; impl Plugin for SwarmPlugin { fn build(&self, app: &mut App) { app.add_event::() - .add_system(check_ready) + .add_systems(Update, check_ready) .init_resource::(); } } /// All the bots from the swarm are now in the world. +#[derive(Event)] pub struct SwarmReadyEvent; #[derive(Default, Resource, Deref, DerefMut)] diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index ed70dacd..13741aa0 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -14,7 +14,7 @@ use azalea_protocol::{ ServerAddress, }; use azalea_world::InstanceContainer; -use bevy_app::{App, Plugin, PluginGroup, PluginGroupBuilder}; +use bevy_app::{App, PluginGroup, PluginGroupBuilder, Plugins}; use bevy_ecs::{component::Component, entity::Entity, system::Resource, world::World}; use futures::future::join_all; use log::error; @@ -234,16 +234,10 @@ where self } - /// Add a plugin to the swarm. + /// Add one or more plugins to this swarm. #[must_use] - pub fn add_plugin(mut self, plugin: T) -> Self { - self.app.add_plugin(plugin); - self - } - /// Add a group of plugins to the swarm. - #[must_use] - pub fn add_plugins(mut self, plugin_group: T) -> Self { - self.app.add_plugins(plugin_group); + pub fn add_plugins(mut self, plugins: impl Plugins) -> Self { + self.app.add_plugins(plugins); self }