From cacb04718dd4142bded181d004f1fa40fe7ae178 Mon Sep 17 00:00:00 2001 From: veronoicc <64193056+veronoicc@users.noreply.github.com> Date: Thu, 28 Dec 2023 22:50:55 +0100 Subject: [PATCH 01/37] Make check_ownership pub (#126) --- azalea-auth/src/auth.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs index efb0daa10..67a45aa3c 100755 --- a/azalea-auth/src/auth.rs +++ b/azalea-auth/src/auth.rs @@ -522,7 +522,7 @@ pub enum CheckOwnershipError { Http(#[from] reqwest::Error), } -async fn check_ownership( +pub async fn check_ownership( client: &reqwest::Client, minecraft_access_token: &str, ) -> Result { From cbb2ffad920ba88ad042a5d3ea932a62d42f3d4b Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 28 Dec 2023 17:49:41 -0600 Subject: [PATCH 02/37] read nbt as optional in more places --- Cargo.lock | 6 ++---- azalea-buf/Cargo.toml | 2 +- azalea-chat/Cargo.toml | 2 +- azalea-chat/src/component.rs | 10 +++++++--- azalea-client/Cargo.toml | 2 +- azalea-core/Cargo.toml | 2 +- azalea-entity/Cargo.toml | 2 +- azalea-inventory/Cargo.toml | 2 +- azalea-protocol/Cargo.toml | 2 +- .../game/clientbound_block_entity_data_packet.rs | 4 ++-- azalea-registry/Cargo.toml | 4 ++-- azalea-world/Cargo.toml | 2 +- 12 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4903876d8..68fedc619 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2439,8 +2439,7 @@ dependencies = [ [[package]] name = "simdnbt" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d42fda2b44594e802fc92a5b3c633cd442cdb1c0a31e0b624ec5c6aab0d063" +source = "git+https://github.com/azalea-rs/simdnbt#922701104ab432eea6185a1a5e96211eaeba5bda" dependencies = [ "byteorder", "flate2", @@ -2452,8 +2451,7 @@ dependencies = [ [[package]] name = "simdnbt-derive" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6241f3aeb4a7cf50ab268d21af2d0cf5d5ede8d928d3c2709e01425fc7e8d54c" +source = "git+https://github.com/azalea-rs/simdnbt#922701104ab432eea6185a1a5e96211eaeba5bda" dependencies = [ "proc-macro2", "quote", diff --git a/azalea-buf/Cargo.toml b/azalea-buf/Cargo.toml index 15e8d3dce..f15525b7a 100644 --- a/azalea-buf/Cargo.toml +++ b/azalea-buf/Cargo.toml @@ -9,13 +9,13 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf-macros = { path = "./azalea-buf-macros", version = "0.9.0" } byteorder = "^1.5.0" tracing = "0.1.40" serde_json = { version = "^1.0", optional = true } thiserror = "1.0.50" uuid = "^1.6.1" -simdnbt = "0.3" [features] serde_json = ["dep:serde_json"] diff --git a/azalea-chat/Cargo.toml b/azalea-chat/Cargo.toml index 5aaf7125c..247285c51 100644 --- a/azalea-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -19,7 +19,7 @@ azalea-buf = { path = "../azalea-buf", features = [ "serde_json", ], version = "0.9.0", optional = true } azalea-language = { path = "../azalea-language", version = "0.9.0" } -simdnbt = { version = "0.3", optional = true } +simdnbt = { version = "0.3", optional = true, git = "https://github.com/azalea-rs/simdnbt" } tracing = "0.1.40" once_cell = "1.18.0" serde = { version = "^1.0", features = ["derive"] } diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 94a5125fa..bd9b72694 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -412,9 +412,13 @@ impl simdnbt::FromNbtTag for FormattedText { #[cfg(feature = "azalea-buf")] impl McBufReadable for FormattedText { fn read_from(buf: &mut std::io::Cursor<&[u8]>) -> Result { - let nbt = simdnbt::borrow::NbtTag::read(buf)?; - FormattedText::from_nbt_tag(&nbt) - .ok_or(BufReadError::Custom("couldn't read nbt".to_owned())) + let nbt = simdnbt::borrow::NbtTag::read_optional(buf)?; + if let Some(nbt) = nbt { + FormattedText::from_nbt_tag(&nbt) + .ok_or(BufReadError::Custom("couldn't read nbt".to_owned())) + } else { + Ok(FormattedText::default()) + } } } diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index abda1829c..117911015 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -9,12 +9,12 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } reqwest = { version = "0.11.22", default-features = false } anyhow = "1.0.75" async-trait = "0.1.74" azalea-auth = { path = "../azalea-auth", version = "0.9.0" } azalea-block = { path = "../azalea-block", version = "0.9.0" } -simdnbt = "0.3" azalea-chat = { path = "../azalea-chat", version = "0.9.0" } azalea-core = { path = "../azalea-core", version = "0.9.0" } azalea-crypto = { path = "../azalea-crypto", version = "0.9.0" } diff --git a/azalea-core/Cargo.toml b/azalea-core/Cargo.toml index 89d378e66..2b862d3ce 100644 --- a/azalea-core/Cargo.toml +++ b/azalea-core/Cargo.toml @@ -9,9 +9,9 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } -simdnbt = "0.3" azalea-registry = { path = "../azalea-registry", version = "0.9.0" } bevy_ecs = { version = "0.12.1", default-features = false, optional = true } nohash-hasher = "0.2.0" diff --git a/azalea-entity/Cargo.toml b/azalea-entity/Cargo.toml index f7123d060..b3762da83 100644 --- a/azalea-entity/Cargo.toml +++ b/azalea-entity/Cargo.toml @@ -9,6 +9,7 @@ license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } azalea-block = { version = "0.9.0", path = "../azalea-block" } azalea-buf = { version = "0.9.0", path = "../azalea-buf" } azalea-chat = { version = "0.9.0", path = "../azalea-chat", features = [ @@ -16,7 +17,6 @@ azalea-chat = { version = "0.9.0", path = "../azalea-chat", features = [ ] } azalea-core = { version = "0.9.0", path = "../azalea-core" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } -simdnbt = "0.3" azalea-registry = { version = "0.9.0", path = "../azalea-registry" } azalea-world = { version = "0.9.0", path = "../azalea-world" } bevy_app = "0.12.1" diff --git a/azalea-inventory/Cargo.toml b/azalea-inventory/Cargo.toml index b4c196bb1..b3c66eceb 100644 --- a/azalea-inventory/Cargo.toml +++ b/azalea-inventory/Cargo.toml @@ -9,7 +9,7 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf = { version = "0.9.0", path = "../azalea-buf" } azalea-inventory-macros = { version = "0.9.0", path = "./azalea-inventory-macros" } -simdnbt = "0.3" azalea-registry = { version = "0.9.0", path = "../azalea-registry" } diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index e5ff38248..3928af41a 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -9,6 +9,7 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } async-recursion = "1.0.5" azalea-auth = { path = "../azalea-auth", version = "0.9.0" } azalea-block = { path = "../azalea-block", default-features = false, version = "0.9.0" } @@ -25,7 +26,6 @@ azalea-core = { path = "../azalea-core", optional = true, version = "0.9.0", fea azalea-crypto = { path = "../azalea-crypto", version = "0.9.0" } azalea-entity = { version = "0.9.0", path = "../azalea-entity" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } -simdnbt = "0.3" azalea-protocol-macros = { path = "./azalea-protocol-macros", version = "0.9.0" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } azalea-world = { path = "../azalea-world", version = "0.9.0" } diff --git a/azalea-protocol/src/packets/game/clientbound_block_entity_data_packet.rs b/azalea-protocol/src/packets/game/clientbound_block_entity_data_packet.rs index 95e9c6c38..3406a75fe 100755 --- a/azalea-protocol/src/packets/game/clientbound_block_entity_data_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_block_entity_data_packet.rs @@ -1,11 +1,11 @@ use azalea_buf::McBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -use simdnbt::owned::NbtTag; +use simdnbt::owned::Nbt; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundBlockEntityDataPacket { pub pos: BlockPos, pub block_entity_type: azalea_registry::BlockEntityKind, - pub tag: NbtTag, + pub tag: Nbt, } diff --git a/azalea-registry/Cargo.toml b/azalea-registry/Cargo.toml index 6f21935f3..5a86d30bd 100644 --- a/azalea-registry/Cargo.toml +++ b/azalea-registry/Cargo.toml @@ -9,11 +9,11 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } + azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-registry-macros = { path = "./azalea-registry-macros", version = "0.9.0" } once_cell = "1.18.0" -simdnbt = "0.3" - [features] serde = ["azalea-registry-macros/serde"] default = ["serde"] diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index 3acb477db..81a7839d1 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -9,13 +9,13 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } azalea-block = { path = "../azalea-block", default-features = false, version = "0.9.0" } azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-core = { path = "../azalea-core", version = "0.9.0", features = [ "bevy_ecs", ] } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } -simdnbt = "0.3" azalea-registry = { path = "../azalea-registry", version = "0.9.0" } bevy_ecs = "0.12.1" derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } From 13e6421cf5aeeddc035f42141da776d09d177e33 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 28 Dec 2023 18:36:23 -0600 Subject: [PATCH 03/37] fix FormattedText when 'extra' isn't a list of compounds --- Cargo.lock | 267 ++++++++---------- azalea-chat/src/component.rs | 6 +- .../game/clientbound_player_chat_packet.rs | 30 ++ .../clientbound_player_info_update_packet.rs | 2 - 4 files changed, 155 insertions(+), 150 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68fedc619..680c9dd77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,9 +76,9 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "c9d19de80eff169429ac1e9f48fffb163916b448a44e8e046186232046d9e1f9" [[package]] name = "async-channel" @@ -107,11 +107,11 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.1.2" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea8b3453dd7cc96711834b75400d671b73e3656975fa68d9f277163b7f7e316" +checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.1", "event-listener-strategy", "pin-project-lite", ] @@ -124,24 +124,24 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] name = "async-task" -version = "4.5.0" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" +checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -227,7 +227,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -258,7 +258,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -388,7 +388,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -464,7 +464,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -483,7 +483,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -562,7 +562,7 @@ checksum = "f484318350462c58ba3942a45a656c1fd6b6e484a6b6b7abc3a787ad1a51e500" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -595,7 +595,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -623,7 +623,7 @@ dependencies = [ "proc-macro2", "quote", "rustc-hash", - "syn 2.0.39", + "syn 2.0.43", "toml_edit", ] @@ -671,7 +671,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", "uuid", ] @@ -729,7 +729,7 @@ checksum = "7aafecc952b6b8eb1a93c12590bd867d25df2f4ae1033a01dfdfc3c35ebccfff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -856,18 +856,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.10" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" +checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.9" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstyle", "clap_lex", @@ -881,9 +881,9 @@ checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -900,9 +900,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "convert_case" @@ -982,9 +982,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" dependencies = [ "cfg-if", "crossbeam-utils", @@ -992,9 +992,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -1003,22 +1003,20 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] @@ -1104,7 +1102,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -1153,9 +1151,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712" dependencies = [ "concurrent-queue", "parking", @@ -1168,7 +1166,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.1", "pin-project-lite", ] @@ -1220,9 +1218,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1235,9 +1233,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1245,15 +1243,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1262,9 +1260,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -1296,32 +1294,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1441,9 +1439,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -1470,9 +1468,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -1485,7 +1483,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -1575,13 +1573,13 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1595,9 +1593,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" @@ -1619,9 +1617,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.150" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libm" @@ -1687,18 +1685,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" @@ -1708,9 +1697,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minecraft_folder_path" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b886139d261301cf5f8c1c41b915ce66fe1de5d601e05d02ccaac079b48375" +checksum = "d60a6352e005f1f86008644a9fe336a66f74c94428182162cc69eb8c6fff458d" [[package]] name = "miniz_oxide" @@ -1723,9 +1712,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -1860,18 +1849,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -2021,9 +2010,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" dependencies = [ "unicode-ident", ] @@ -2142,9 +2131,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64", "bytes", @@ -2197,9 +2186,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", @@ -2264,9 +2253,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.26" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", @@ -2277,9 +2266,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring", @@ -2308,9 +2297,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -2360,7 +2349,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -2439,7 +2428,7 @@ dependencies = [ [[package]] name = "simdnbt" version = "0.3.0" -source = "git+https://github.com/azalea-rs/simdnbt#922701104ab432eea6185a1a5e96211eaeba5bda" +source = "git+https://github.com/azalea-rs/simdnbt#c255ab673a7439c52dd299eac53ea59566cdda9d" dependencies = [ "byteorder", "flate2", @@ -2451,11 +2440,11 @@ dependencies = [ [[package]] name = "simdnbt-derive" version = "0.3.0" -source = "git+https://github.com/azalea-rs/simdnbt#922701104ab432eea6185a1a5e96211eaeba5bda" +source = "git+https://github.com/azalea-rs/simdnbt#c255ab673a7439c52dd299eac53ea59566cdda9d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -2497,16 +2486,6 @@ dependencies = [ "serde", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -2558,9 +2537,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" dependencies = [ "proc-macro2", "quote", @@ -2599,22 +2578,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -2664,9 +2643,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -2676,7 +2655,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -2689,7 +2668,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -2758,7 +2737,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -2868,9 +2847,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -2880,9 +2859,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" @@ -2991,7 +2970,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", "wasm-bindgen-shared", ] @@ -3025,7 +3004,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3217,9 +3196,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" dependencies = [ "memchr", ] @@ -3236,22 +3215,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.28" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6f15f7ade05d2a4935e34a457b936c23dc70a05cc1d97133dc99e7a3fe0f0e" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.28" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbbad221e3f78500350ecbd7dfa4e63ef945c05f4c61cb7f4d3f84cd0bba649b" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index bd9b72694..807d0b1aa 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -373,15 +373,13 @@ impl simdnbt::FromNbtTag for FormattedText { return None; } if let Some(extra) = compound.get("extra") { - let extra = extra.list()?.compounds()?; + let extra = extra.list()?.as_nbt_tags(); if extra.is_empty() { // Unexpected empty array of components return None; } for extra_component in extra { - let sibling = FormattedText::from_nbt_tag( - &simdnbt::borrow::NbtTag::Compound(extra_component.clone()), - )?; + let sibling = FormattedText::from_nbt_tag(&extra_component)?; component.append(sibling); } } diff --git a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs index 41a21def6..31f18dde2 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs @@ -169,3 +169,33 @@ impl McBufWritable for PackedMessageSignature { Ok(()) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_read_player_chat_packet() { + let mut bytes = Cursor::new( + &[ + 55, 186, 28, 76, 92, 167, 177, 75, 188, 158, 200, 179, 191, 227, 16, 171, 145, 0, + 0, 4, 116, 101, 115, 116, 0, 0, 1, 140, 178, 225, 89, 103, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 10, 0, 10, 104, 111, 118, 101, 114, 69, 118, 101, 110, 116, 10, 0, + 8, 99, 111, 110, 116, 101, 110, 116, 115, 8, 0, 4, 110, 97, 109, 101, 0, 12, 75, + 97, 115, 117, 109, 105, 77, 97, 114, 105, 115, 97, 11, 0, 2, 105, 100, 0, 0, 0, 4, + 186, 28, 76, 92, 167, 177, 75, 188, 158, 200, 179, 191, 227, 16, 171, 145, 8, 0, 4, + 116, 121, 112, 101, 0, 16, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 112, 108, + 97, 121, 101, 114, 0, 8, 0, 6, 97, 99, 116, 105, 111, 110, 0, 11, 115, 104, 111, + 119, 95, 101, 110, 116, 105, 116, 121, 0, 10, 0, 10, 99, 108, 105, 99, 107, 69, + 118, 101, 110, 116, 8, 0, 6, 97, 99, 116, 105, 111, 110, 0, 15, 115, 117, 103, 103, + 101, 115, 116, 95, 99, 111, 109, 109, 97, 110, 100, 8, 0, 5, 118, 97, 108, 117, + 101, 0, 19, 47, 116, 101, 108, 108, 32, 75, 97, 115, 117, 109, 105, 77, 97, 114, + 105, 115, 97, 32, 0, 9, 0, 5, 101, 120, 116, 114, 97, 8, 0, 0, 0, 3, 0, 0, 0, 12, + 75, 97, 115, 117, 109, 105, 77, 97, 114, 105, 115, 97, 0, 0, 8, 0, 9, 105, 110, + 115, 101, 114, 116, 105, 111, 110, 0, 12, 75, 97, 115, 117, 109, 105, 77, 97, 114, + 105, 115, 97, 8, 0, 4, 116, 101, 120, 116, 0, 0, 0, 0, + ][..], + ); + let _packet = ClientboundPlayerChatPacket::read_from(&mut bytes).unwrap(); + } +} diff --git a/azalea-protocol/src/packets/game/clientbound_player_info_update_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_info_update_packet.rs index 7eb1abcfa..345c22f20 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_info_update_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_info_update_packet.rs @@ -224,8 +224,6 @@ mod tests { #[test] fn read_player_info_update_packet() { - tracing_subscriber::fmt::init(); - // from wynncraft let mut bytes = Cursor::new( &[ From 1347f3549282397be6a46b8b7cb76a7900d0690a Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 4 Jan 2024 01:55:00 -0600 Subject: [PATCH 04/37] rename open_container to open_container_at and add get_open_container --- azalea-client/src/inventory.rs | 6 + azalea-core/src/game_type.rs | 6 +- azalea/examples/steal.rs | 2 +- azalea/examples/testbot.rs | 2 +- .../examples/todo/craft_dig_straight_down.rs | 2 +- azalea/src/container.rs | 116 ++++++++++++++---- 6 files changed, 101 insertions(+), 33 deletions(-) diff --git a/azalea-client/src/inventory.rs b/azalea-client/src/inventory.rs index 527feae78..bf421bf4d 100644 --- a/azalea-client/src/inventory.rs +++ b/azalea-client/src/inventory.rs @@ -90,6 +90,9 @@ pub struct InventoryComponent { /// The current container menu that the player has open. If no container is /// open, this will be `None`. pub container_menu: Option, + /// The custom name of the menu that's currently open. This is Some when + /// `container_menu` is Some. + pub container_menu_title: Option, /// The item that is currently held by the cursor. `Slot::Empty` if nothing /// is currently being held. /// @@ -566,6 +569,7 @@ impl Default for InventoryComponent { inventory_menu: Menu::Player(azalea_inventory::Player::default()), id: 0, container_menu: None, + container_menu_title: None, carried: ItemSlot::Empty, state_id: 0, quick_craft_status: QuickCraftStatusKind::Start, @@ -593,6 +597,7 @@ fn handle_menu_opened_event( let mut inventory = query.get_mut(event.entity).unwrap(); inventory.id = event.window_id as u8; inventory.container_menu = Some(Menu::from_kind(event.menu_type)); + inventory.container_menu_title = Some(event.title.clone()); } } @@ -651,6 +656,7 @@ pub fn handle_client_side_close_container_event( let mut inventory = query.get_mut(event.entity).unwrap(); inventory.container_menu = None; inventory.id = 0; + inventory.container_menu_title = None; } } diff --git a/azalea-core/src/game_type.rs b/azalea-core/src/game_type.rs index 99f0c0fea..7c7a43a82 100644 --- a/azalea-core/src/game_type.rs +++ b/azalea-core/src/game_type.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBufReadable, McBufVarReadable, McBufWritable}; use std::io::{Cursor, Write}; -use tracing::warn; +use tracing::debug; /// A Minecraft gamemode, like survival or creative. #[derive(Hash, Copy, Clone, Debug, Default, Eq, PartialEq)] @@ -96,11 +96,11 @@ impl McBufReadable for GameMode { fn read_from(buf: &mut Cursor<&[u8]>) -> Result { let id = u32::var_read_from(buf)?; let id = id.try_into().unwrap_or_else(|_| { - warn!("Unknown game mode id {id}, defaulting to survival"); + debug!("Unknown game mode id {id}, defaulting to survival"); 0 }); Ok(GameMode::from_id(id).unwrap_or_else(|| { - warn!("Unknown game mode id {id}, defaulting to survival"); + debug!("Unknown game mode id {id}, defaulting to survival"); GameMode::Survival })) } diff --git a/azalea/examples/steal.rs b/azalea/examples/steal.rs index 408d7b9b4..c6ab46397 100644 --- a/azalea/examples/steal.rs +++ b/azalea/examples/steal.rs @@ -45,7 +45,7 @@ async fn handle(mut bot: Client, event: Event, state: State) -> anyhow::Result<( return Ok(()); }; // bot.goto(BlockPosGoal(chest_block)); - let Some(chest) = bot.open_container(chest_block).await else { + let Some(chest) = bot.open_container_at(chest_block).await else { println!("Couldn't open chest"); return Ok(()); }; diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs index 7e7b2ca08..c9e64ef95 100644 --- a/azalea/examples/testbot.rs +++ b/azalea/examples/testbot.rs @@ -216,7 +216,7 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result< return Ok(()); }; bot.look_at(target_pos.center()); - let container = bot.open_container(target_pos).await; + let container = bot.open_container_at(target_pos).await; println!("container: {container:?}"); if let Some(container) = container { if let Some(contents) = container.contents() { diff --git a/azalea/examples/todo/craft_dig_straight_down.rs b/azalea/examples/todo/craft_dig_straight_down.rs index 6672eaa49..7b75d2db9 100644 --- a/azalea/examples/todo/craft_dig_straight_down.rs +++ b/azalea/examples/todo/craft_dig_straight_down.rs @@ -38,7 +38,7 @@ async fn handle(bot: Client, event: Event, state: State) -> anyhow::Result<()> { bot.goto(pathfinder::Goals::NearXZ(5, azalea::BlockXZ(0, 0))) .await; let chest = bot - .open_container(&bot.world().find_block(azalea::Block::Chest)) + .open_container_at(&bot.world().find_block(azalea::Block::Chest)) .await .unwrap(); bot.take_amount_from_container(&chest, 5, |i| i.id == "#minecraft:planks") diff --git a/azalea/src/container.rs b/azalea/src/container.rs index 0f4170613..c354390ea 100644 --- a/azalea/src/container.rs +++ b/azalea/src/container.rs @@ -23,11 +23,12 @@ impl Plugin for ContainerPlugin { } pub trait ContainerClientExt { - fn open_container( + fn open_container_at( &mut self, pos: BlockPos, ) -> impl Future> + Send; fn open_inventory(&mut self) -> Option; + fn get_open_container(&self) -> Option; } impl ContainerClientExt for Client { @@ -45,10 +46,10 @@ impl ContainerClientExt for Client { /// bot.chat("no chest found"); /// return; /// }; - /// let container = bot.open_container(target_pos).await; + /// let container = bot.open_container_at(target_pos).await; /// # } /// ``` - async fn open_container(&mut self, pos: BlockPos) -> Option { + async fn open_container_at(&mut self, pos: BlockPos) -> Option { self.ecs .lock() .entity_mut(self.entity) @@ -70,10 +71,7 @@ impl ContainerClientExt for Client { if inventory.id == 0 { None } else { - Some(ContainerHandle { - id: inventory.id, - client: self.clone(), - }) + Some(ContainerHandle::new(inventory.id, self.clone())) } } @@ -94,40 +92,55 @@ impl ContainerClientExt for Client { .expect("no inventory"); if inventory.id == 0 { - Some(ContainerHandle { - id: 0, - client: self.clone(), - }) + Some(ContainerHandle::new(0, self.clone())) } else { None } } + + /// Get a handle to the open container. This will return None if no + /// container is open. This will not close the container when it's dropped. + /// + /// See [`Client::open_inventory`] or [`Client::menu`] if you want to open + /// your own inventory. + fn get_open_container(&self) -> Option { + let ecs = self.ecs.lock(); + let inventory = ecs + .get::(self.entity) + .expect("no inventory"); + + if inventory.id == 0 { + None + } else { + Some(ContainerHandleRef { + id: inventory.id, + client: self.clone(), + }) + } + } } -/// A handle to the open container. The container will be closed once this is -/// dropped. -pub struct ContainerHandle { - /// The id of the container. If this is 0, that means it's the player's - /// inventory. +/// A handle to a container that may be open. This does not close the container +/// when it's dropped. See [`ContainerHandle`] if that behavior is desired. +pub struct ContainerHandleRef { id: u8, client: Client, } -impl Drop for ContainerHandle { - fn drop(&mut self) { - self.client.ecs.lock().send_event(CloseContainerEvent { - entity: self.client.entity, - id: self.id, - }); - } -} -impl Debug for ContainerHandle { +impl Debug for ContainerHandleRef { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { f.debug_struct("ContainerHandle") - .field("id", &self.id) + .field("id", &self.id()) .finish() } } -impl ContainerHandle { +impl ContainerHandleRef { + pub fn close(&self) { + self.client.ecs.lock().send_event(CloseContainerEvent { + entity: self.client.entity, + id: self.id, + }); + } + /// Get the id of the container. If this is 0, that means it's the player's /// inventory. Otherwise, the number isn't really meaningful since only one /// container can be open at a time. @@ -175,6 +188,55 @@ impl ContainerHandle { } } +/// A handle to the open container. The container will be closed once this is +/// dropped. +pub struct ContainerHandle(ContainerHandleRef); + +impl Drop for ContainerHandle { + fn drop(&mut self) { + self.0.close(); + } +} +impl Debug for ContainerHandle { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ContainerHandle") + .field("id", &self.id()) + .finish() + } +} +impl ContainerHandle { + fn new(id: u8, client: Client) -> Self { + Self(ContainerHandleRef { id, client }) + } + + /// Get the id of the container. If this is 0, that means it's the player's + /// inventory. Otherwise, the number isn't really meaningful since only one + /// container can be open at a time. + pub fn id(&self) -> u8 { + self.0.id() + } + + /// Returns the menu of the container. If the container is closed, this + /// will return `None`. + /// + /// Note that any modifications you make to the `Menu` you're given will not + /// actually cause any packets to be sent. If you're trying to modify your + /// inventory, use [`ContainerHandle::click`] instead + pub fn menu(&self) -> Option { + self.0.menu() + } + + /// Returns the item slots in the container, not including the player's + /// inventory. If the container is closed, this will return `None`. + pub fn contents(&self) -> Option> { + self.0.contents() + } + + pub fn click(&self, operation: impl Into) { + self.0.click(operation); + } +} + #[derive(Component, Debug)] pub struct WaitingForInventoryOpen; From 5ea127114582e3320381d09e880f6a433ccb8710 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 6 Jan 2024 18:16:11 -0600 Subject: [PATCH 05/37] add doc comment about d= --- azalea-auth/src/auth.rs | 9 ++++++--- azalea-block/src/generated.rs | 1 - azalea-inventory/src/slot.rs | 8 ++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs index 67a45aa3c..7b5846c42 100755 --- a/azalea-auth/src/auth.rs +++ b/azalea-auth/src/auth.rs @@ -140,6 +140,9 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result /// /// If you don't have a Microsoft auth token, you can get it from /// [`get_ms_link_code`] and then [`get_ms_auth_token`]. +/// +/// If you got the MSA token from your own app (as opposed to the default +/// Nintendo Switch one), you may have to prepend "d=" to the token. pub async fn get_minecraft_token( client: &reqwest::Client, msa: &str, @@ -418,9 +421,9 @@ async fn auth_with_xbox_live( "Properties": { "AuthMethod": "RPS", "SiteName": "user.auth.xboxlive.com", - // i thought this was supposed to be d={} but it doesn't work for - // me when i add it ?????? - "RpsTicket": format!("{access_token}") + // this value should have "d=" prepended if you're using your own app (as opposed to + // the default nintendo switch one) + "RpsTicket": access_token }, "RelyingParty": "http://auth.xboxlive.com", "TokenType": "JWT" diff --git a/azalea-block/src/generated.rs b/azalea-block/src/generated.rs index 97236b4ba..5267c9a18 100755 --- a/azalea-block/src/generated.rs +++ b/azalea-block/src/generated.rs @@ -5380,4 +5380,3 @@ make_block_states! { }, } } - diff --git a/azalea-inventory/src/slot.rs b/azalea-inventory/src/slot.rs index 814b6c37a..c4f8da056 100644 --- a/azalea-inventory/src/slot.rs +++ b/azalea-inventory/src/slot.rs @@ -71,6 +71,14 @@ impl ItemSlot { } } } + + /// Convert this slot into an [`ItemSlotData`], if it's present. + pub fn as_present(&self) -> Option<&ItemSlotData> { + match self { + ItemSlot::Empty => None, + ItemSlot::Present(i) => Some(i), + } + } } /// An item in an inventory, with a count and NBT. Usually you want [`ItemSlot`] From 0aa439d5caa8028b6d310de45258cbcef16ca2eb Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 7 Jan 2024 21:50:38 -0600 Subject: [PATCH 06/37] rewrite testbot to use brigadier --- azalea/README.md | 2 +- azalea/examples/testbot.rs | 424 ------------------- azalea/examples/testbot/commands.rs | 46 ++ azalea/examples/testbot/commands/combat.rs | 26 ++ azalea/examples/testbot/commands/debug.rs | 105 +++++ azalea/examples/testbot/commands/movement.rs | 191 +++++++++ azalea/examples/testbot/killaura.rs | 48 +++ azalea/examples/testbot/main.rs | 198 +++++++++ 8 files changed, 615 insertions(+), 425 deletions(-) delete mode 100644 azalea/examples/testbot.rs create mode 100644 azalea/examples/testbot/commands.rs create mode 100644 azalea/examples/testbot/commands/combat.rs create mode 100644 azalea/examples/testbot/commands/debug.rs create mode 100644 azalea/examples/testbot/commands/movement.rs create mode 100644 azalea/examples/testbot/killaura.rs create mode 100644 azalea/examples/testbot/main.rs diff --git a/azalea/README.md b/azalea/README.md index 339c57a2e..f40951919 100755 --- a/azalea/README.md +++ b/azalea/README.md @@ -53,7 +53,7 @@ async fn main() { ClientBuilder::new() .set_handler(handle) - .start(account.clone(), "localhost") + .start(account, "localhost") .await .unwrap(); } diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs deleted file mode 100644 index c9e64ef95..000000000 --- a/azalea/examples/testbot.rs +++ /dev/null @@ -1,424 +0,0 @@ -//! a bot for testing new azalea features - -use azalea::ecs::query::With; -use azalea::entity::{metadata::Player, EyeHeight, Position}; -use azalea::interact::HitResultComponent; -use azalea::inventory::ItemSlot; -use azalea::pathfinder::goals::BlockPosGoal; -use azalea::{prelude::*, swarm::prelude::*, BlockPos, GameProfileComponent, WalkDirection}; -use azalea::{Account, Client, Event}; -use azalea_client::{InstanceHolder, SprintDirection}; -use azalea_core::position::{ChunkBlockPos, ChunkPos, Vec3}; -use azalea_protocol::packets::game::ClientboundGamePacket; -use azalea_world::heightmap::HeightmapKind; -use azalea_world::{InstanceName, MinecraftEntityId}; -use std::time::Duration; - -#[derive(Default, Clone, Component)] -struct State {} - -#[derive(Default, Clone, Resource)] -struct SwarmState {} - -#[tokio::main] -async fn main() { - { - use parking_lot::deadlock; - use std::thread; - use std::time::Duration; - // Create a background thread which checks for deadlocks every 10s - thread::spawn(move || loop { - thread::sleep(Duration::from_secs(10)); - let deadlocks = deadlock::check_deadlock(); - if deadlocks.is_empty() { - continue; - } - - println!("{} deadlocks detected", deadlocks.len()); - for (i, threads) in deadlocks.iter().enumerate() { - println!("Deadlock #{i}"); - for t in threads { - println!("Thread Id {:#?}", t.thread_id()); - println!("{:#?}", t.backtrace()); - } - } - }); - } - - let mut accounts = Vec::new(); - - for i in 0..1 { - accounts.push(Account::offline(&format!("bot{i}"))); - } - - SwarmBuilder::new() - .add_accounts(accounts.clone()) - .set_handler(handle) - .set_swarm_handler(swarm_handle) - .join_delay(Duration::from_millis(100)) - .start("localhost") - .await - .unwrap(); -} - -async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<()> { - match event { - Event::Init => { - // bot.set_client_information(azalea_client::ClientInformation { - // view_distance: 2, - // ..Default::default() - // }) - // .await?; - } - Event::Login => { - bot.chat("Hello world"); - } - Event::Chat(m) => { - // println!("client chat message: {}", m.content()); - if m.content() == bot.profile.name { - bot.chat("Bye"); - tokio::time::sleep(Duration::from_millis(50)).await; - bot.disconnect(); - } - let Some(sender) = m.username() else { - return Ok(()); - }; - // let mut ecs = bot.ecs.lock(); - // let entity = bot - // .ecs - // .lock() - // .query::<&Player>() - // .iter(&mut ecs) - // .find(|e| e.name() == Some(sender)); - // let entity = bot.entity_by::>(|name: &Name| name == sender); - let entity = bot.entity_by::, (&GameProfileComponent,)>( - |(profile,): &(&GameProfileComponent,)| profile.name == sender, - ); - match m.content().as_str() { - "whereami" => { - let Some(entity) = entity else { - bot.chat("I can't see you"); - return Ok(()); - }; - let pos = bot.entity_component::(entity); - bot.chat(&format!("You're at {pos:?}")); - } - "whereareyou" => { - let pos = bot.position(); - bot.chat(&format!("I'm at {pos:?}")); - } - "goto" => { - let Some(entity) = entity else { - bot.chat("I can't see you"); - return Ok(()); - }; - let entity_pos = bot.entity_component::(entity); - let target_pos: BlockPos = entity_pos.into(); - println!("going to {target_pos:?}"); - bot.goto(BlockPosGoal(target_pos)); - } - "worldborder" => { - bot.goto(BlockPosGoal(BlockPos::new(30_000_000, 70, 0))); - } - "look" => { - let Some(entity) = entity else { - bot.chat("I can't see you"); - return Ok(()); - }; - let entity_pos = bot - .entity_component::(entity) - .up(bot.entity_component::(entity).into()); - println!("entity_pos: {entity_pos:?}"); - bot.look_at(entity_pos); - } - "jump" => { - bot.set_jumping(true); - } - "walk" => { - bot.walk(WalkDirection::Forward); - } - "sprint" => { - bot.sprint(SprintDirection::Forward); - } - "stop" => { - bot.set_jumping(false); - bot.walk(WalkDirection::None); - } - "lag" => { - std::thread::sleep(Duration::from_millis(1000)); - } - "quit" => { - bot.disconnect(); - tokio::time::sleep(Duration::from_millis(1000)).await; - std::process::exit(0); - } - "inventory" => { - println!("inventory: {:?}", bot.menu()); - } - "findblock" => { - let target_pos = bot.world().read().find_block( - bot.position(), - &azalea::registry::Block::DiamondBlock.into(), - ); - bot.chat(&format!("target_pos: {target_pos:?}",)); - } - "gotoblock" => { - let target_pos = bot.world().read().find_block( - bot.position(), - &azalea::registry::Block::DiamondBlock.into(), - ); - if let Some(target_pos) = target_pos { - // +1 to stand on top of the block - bot.goto(BlockPosGoal(target_pos.up(1))); - } else { - bot.chat("no diamond block found"); - } - } - "mineblock" => { - let target_pos = bot.world().read().find_block( - bot.position(), - &azalea::registry::Block::DiamondBlock.into(), - ); - if let Some(target_pos) = target_pos { - // +1 to stand on top of the block - bot.chat("ok mining diamond block"); - bot.look_at(target_pos.center()); - bot.mine(target_pos).await; - bot.chat("finished mining"); - } else { - bot.chat("no diamond block found"); - } - } - "lever" => { - let target_pos = bot - .world() - .read() - .find_block(bot.position(), &azalea::registry::Block::Lever.into()); - let Some(target_pos) = target_pos else { - bot.chat("no lever found"); - return Ok(()); - }; - bot.goto(BlockPosGoal(target_pos)); - bot.look_at(target_pos.center()); - bot.block_interact(target_pos); - } - "hitresult" => { - let hit_result = bot.get_component::(); - bot.chat(&format!("hit_result: {hit_result:?}",)); - } - "chest" => { - let target_pos = bot - .world() - .read() - .find_block(bot.position(), &azalea::registry::Block::Chest.into()); - let Some(target_pos) = target_pos else { - bot.chat("no chest found"); - return Ok(()); - }; - bot.look_at(target_pos.center()); - let container = bot.open_container_at(target_pos).await; - println!("container: {container:?}"); - if let Some(container) = container { - if let Some(contents) = container.contents() { - for item in contents { - if let ItemSlot::Present(item) = item { - println!("item: {item:?}"); - } - } - } else { - println!("container was immediately closed"); - } - } else { - println!("no container found"); - } - } - "attack" => { - let mut nearest_entity = None; - let mut nearest_distance = f64::INFINITY; - let mut nearest_pos = Vec3::default(); - let bot_position = bot.position(); - let bot_entity = bot.entity; - let bot_instance_name = bot.component::(); - { - let mut ecs = bot.ecs.lock(); - let mut query = ecs.query_filtered::<( - azalea::ecs::entity::Entity, - &MinecraftEntityId, - &Position, - &InstanceName, - &EyeHeight, - ), With>(); - for (entity, &entity_id, position, instance_name, eye_height) in - query.iter(&ecs) - { - if entity == bot_entity { - continue; - } - if instance_name != &bot_instance_name { - continue; - } - - let distance = bot_position.distance_to(position); - if distance < 4.0 && distance < nearest_distance { - nearest_entity = Some(entity_id); - nearest_distance = distance; - nearest_pos = position.up(**eye_height as f64); - } - } - } - if let Some(nearest_entity) = nearest_entity { - bot.look_at(nearest_pos); - bot.attack(nearest_entity); - bot.chat("attacking"); - let mut ticks = bot.get_tick_broadcaster(); - while ticks.recv().await.is_ok() { - if !bot.has_attack_cooldown() { - break; - } - } - bot.chat("finished attacking"); - } else { - bot.chat("no entities found"); - } - } - "heightmap" => { - let position = bot.position(); - let chunk_pos = ChunkPos::from(position); - let chunk_block_pos = ChunkBlockPos::from(position); - let chunk = bot.world().read().chunks.get(&chunk_pos); - if let Some(chunk) = chunk { - let heightmaps = &chunk.read().heightmaps; - let Some(world_surface_heightmap) = - heightmaps.get(&HeightmapKind::WorldSurface) - else { - bot.chat("no world surface heightmap"); - return Ok(()); - }; - let highest_y = world_surface_heightmap - .get_highest_taken(chunk_block_pos.x, chunk_block_pos.z); - bot.chat(&format!("highest_y: {highest_y}",)); - } else { - bot.chat("no chunk found"); - } - } - "debugblock" => { - // send the block that we're standing on - let block_pos = BlockPos::from(bot.position().down(0.1)); - let block = bot.world().read().get_block_state(&block_pos); - bot.chat(&format!("block: {block:?}")); - } - "debugchunks" => { - { - println!("shared:"); - - let mut ecs = bot.ecs.lock(); - - let instance_holder = bot.query::<&InstanceHolder>(&mut ecs).clone(); - drop(ecs); - let local_chunk_storage = &instance_holder.partial_instance.read().chunks; - let shared_chunk_storage = instance_holder.instance.read(); - - let mut total_loaded_chunks_count = 0; - for (chunk_pos, chunk) in &shared_chunk_storage.chunks.map { - if let Some(chunk) = chunk.upgrade() { - let in_range = local_chunk_storage.in_range(chunk_pos); - println!( - "{chunk_pos:?} has {} references{}", - std::sync::Arc::strong_count(&chunk) - 1, - if in_range { "" } else { " (out of range)" } - ); - total_loaded_chunks_count += 1; - } - } - - println!("local:"); - println!("view range: {}", local_chunk_storage.view_range()); - println!("view center: {:?}", local_chunk_storage.view_center()); - - let mut local_loaded_chunks_count = 0; - for (i, chunk) in local_chunk_storage.chunks().enumerate() { - if let Some(chunk) = chunk { - let chunk_pos = local_chunk_storage.chunk_pos_from_index(i); - println!( - "{chunk_pos:?} (#{i}) has {} references", - std::sync::Arc::strong_count(&chunk) - ); - local_loaded_chunks_count += 1; - } - } - - println!("total loaded chunks: {total_loaded_chunks_count}"); - println!( - "local loaded chunks: {local_loaded_chunks_count}/{}", - local_chunk_storage.chunks().collect::>().len() - ); - } - { - let local_chunk_storage_lock = bot.partial_world(); - let local_chunk_storage = local_chunk_storage_lock.read(); - let current_chunk_loaded = local_chunk_storage - .chunks - .limited_get(&ChunkPos::from(bot.position())); - - bot.chat(&format!( - "current chunk loaded: {}", - current_chunk_loaded.is_some() - )); - } - } - _ => {} - } - } - Event::Packet(packet) => { - if let ClientboundGamePacket::Login(_) = *packet { - println!("login packet"); - } - } - Event::Disconnect(reason) => { - if let Some(reason) = reason { - println!("bot got kicked for reason: {}", reason.to_ansi()); - } else { - println!("bot got kicked"); - } - } - _ => {} - } - - Ok(()) -} - -async fn swarm_handle( - mut swarm: Swarm, - event: SwarmEvent, - _state: SwarmState, -) -> anyhow::Result<()> { - match &event { - SwarmEvent::Disconnect(account) => { - println!("bot got kicked! {}", account.username); - tokio::time::sleep(Duration::from_secs(5)).await; - swarm.add_and_retry_forever(account, State::default()).await; - } - SwarmEvent::Chat(m) => { - println!("swarm chat message: {}", m.message().to_ansi()); - if m.message().to_string() == " world" { - for (name, world) in &swarm.instance_container.read().instances { - println!("world name: {name}"); - if let Some(w) = world.upgrade() { - for chunk_pos in w.read().chunks.map.values() { - println!("chunk: {chunk_pos:?}"); - } - } else { - println!("nvm world is gone"); - } - } - } - if m.message().to_string() == " hi" { - for bot in swarm { - bot.chat("hello"); - } - } - } - _ => {} - } - Ok(()) -} diff --git a/azalea/examples/testbot/commands.rs b/azalea/examples/testbot/commands.rs new file mode 100644 index 000000000..db606aa63 --- /dev/null +++ b/azalea/examples/testbot/commands.rs @@ -0,0 +1,46 @@ +pub mod combat; +pub mod debug; +pub mod movement; + +use azalea::brigadier::prelude::*; +use azalea::chat::ChatPacket; +use azalea::ecs::prelude::Entity; +use azalea::ecs::prelude::*; +use azalea::entity::metadata::Player; +use azalea::Client; +use azalea::GameProfileComponent; +use parking_lot::Mutex; + +use crate::State; + +pub type Ctx = CommandContext>; + +pub struct CommandSource { + pub bot: Client, + pub state: State, + pub chat: ChatPacket, +} + +impl CommandSource { + pub fn reply(&self, message: &str) { + if self.chat.is_whisper() { + self.bot + .chat(&format!("/w {} {}", self.chat.username().unwrap(), message)); + } else { + self.bot.chat(message); + } + } + + pub fn entity(&mut self) -> Option { + let username = self.chat.username()?; + self.bot.entity_by::, &GameProfileComponent>( + |profile: &&GameProfileComponent| profile.name == username, + ) + } +} + +pub fn register_commands(commands: &mut CommandDispatcher>) { + combat::register(commands); + debug::register(commands); + movement::register(commands); +} diff --git a/azalea/examples/testbot/commands/combat.rs b/azalea/examples/testbot/commands/combat.rs new file mode 100644 index 000000000..b440b3ace --- /dev/null +++ b/azalea/examples/testbot/commands/combat.rs @@ -0,0 +1,26 @@ +use azalea::brigadier::prelude::*; +use parking_lot::Mutex; + +use super::{CommandSource, Ctx}; + +pub fn register(commands: &mut CommandDispatcher>) { + commands.register( + literal("killaura").then(argument("enabled", bool()).executes(|ctx: &Ctx| { + let enabled = get_bool(ctx, "enabled").unwrap(); + let source = ctx.source.lock(); + let bot = source.bot.clone(); + { + let mut ecs = bot.ecs.lock(); + let mut entity = ecs.entity_mut(bot.entity); + let mut state = entity.get_mut::().unwrap(); + state.killaura = enabled + } + source.reply(if enabled { + "Enabled killaura" + } else { + "Disabled killaura" + }); + 1 + })), + ); +} diff --git a/azalea/examples/testbot/commands/debug.rs b/azalea/examples/testbot/commands/debug.rs new file mode 100644 index 000000000..ae0808cb0 --- /dev/null +++ b/azalea/examples/testbot/commands/debug.rs @@ -0,0 +1,105 @@ +//! Commands for debugging and getting the current state of the bot. + +use azalea::{ + brigadier::prelude::*, + entity::{LookDirection, Position}, + interact::HitResultComponent, + world::MinecraftEntityId, +}; +use parking_lot::Mutex; + +use super::{CommandSource, Ctx}; + +pub fn register(commands: &mut CommandDispatcher>) { + commands.register(literal("ping").executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + source.reply("pong!"); + 1 + })); + + commands.register(literal("whereami").executes(|ctx: &Ctx| { + let mut source = ctx.source.lock(); + let Some(entity) = source.entity() else { + source.reply("You aren't in render distance!"); + return 0; + }; + let position = source.bot.entity_component::(entity); + source.reply(&format!( + "You are at {}, {}, {}", + position.x, position.y, position.z + )); + 1 + })); + + commands.register(literal("entityid").executes(|ctx: &Ctx| { + let mut source = ctx.source.lock(); + let Some(entity) = source.entity() else { + source.reply("You aren't in render distance!"); + return 0; + }; + let entity_id = source.bot.entity_component::(entity); + source.reply(&format!( + "Your Minecraft ID is {} and your ECS id is {entity:?}", + *entity_id + )); + 1 + })); + + let whereareyou = |ctx: &Ctx| { + let source = ctx.source.lock(); + let position = source.bot.position(); + source.reply(&format!( + "I'm at {}, {}, {}", + position.x, position.y, position.z + )); + 1 + }; + commands.register(literal("whereareyou").executes(whereareyou)); + commands.register(literal("pos").executes(whereareyou)); + + commands.register(literal("whoareyou").executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + source.reply(&format!( + "I am {} ({})", + source.bot.username(), + source.bot.uuid() + )); + 1 + })); + + commands.register(literal("getdirection").executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + let direction = source.bot.component::(); + source.reply(&format!( + "I'm looking at {}, {}", + direction.y_rot, direction.x_rot + )); + 1 + })); + + commands.register(literal("health").executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + + let health = source.bot.health(); + source.reply(&format!("I have {health} health")); + 1 + })); + + commands.register(literal("lookingat").executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + + let hit_result = *source.bot.component::(); + + if hit_result.miss { + source.reply("I'm not looking at anything"); + return 1; + } + + let block_pos = hit_result.block_pos; + let block = source.bot.world().read().get_block_state(&block_pos); + + source.reply(&format!("I'm looking at {block:?} at {block_pos:?}")); + + 1 + })); +} diff --git a/azalea/examples/testbot/commands/movement.rs b/azalea/examples/testbot/commands/movement.rs new file mode 100644 index 000000000..4957533f2 --- /dev/null +++ b/azalea/examples/testbot/commands/movement.rs @@ -0,0 +1,191 @@ +use std::time::Duration; + +use azalea::{ + brigadier::prelude::*, + entity::{EyeHeight, Position}, + pathfinder::goals::{BlockPosGoal, XZGoal}, + prelude::*, + BlockPos, SprintDirection, WalkDirection, +}; +use parking_lot::Mutex; + +use crate::BotTask; + +use super::{CommandSource, Ctx}; + +pub fn register(commands: &mut CommandDispatcher>) { + commands.register( + literal("goto") + .executes(|ctx: &Ctx| { + let mut source = ctx.source.lock(); + println!("got goto"); + // look for the sender + let Some(entity) = source.entity() else { + source.reply("I can't see you!"); + return 0; + }; + let Some(position) = source.bot.get_entity_component::(entity) else { + source.reply("I can't see you!"); + return 0; + }; + source.reply("ok"); + source.bot.goto(BlockPosGoal(BlockPos::from(position))); + 1 + }) + .then(literal("xz").then(argument("x", integer()).then( + argument("z", integer()).executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + let x = get_integer(ctx, "x").unwrap(); + let z = get_integer(ctx, "z").unwrap(); + println!("goto xz {x} {z}"); + source.reply("ok"); + source.bot.goto(XZGoal { x, z }); + 1 + }), + ))) + .then(argument("x", integer()).then(argument("y", integer()).then( + argument("z", integer()).executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + let x = get_integer(ctx, "x").unwrap(); + let y = get_integer(ctx, "y").unwrap(); + let z = get_integer(ctx, "z").unwrap(); + println!("goto xyz {x} {y} {z}"); + source.reply("ok"); + source.bot.goto(BlockPosGoal(BlockPos::new(x, y, z))); + 1 + }), + ))), + ); + + commands.register(literal("down").executes(|ctx: &Ctx| { + let source = ctx.source.clone(); + tokio::spawn(async move { + let mut bot = source.lock().bot.clone(); + let position = BlockPos::from(bot.position()); + source.lock().reply("mining..."); + bot.mine(position.down(1)).await; + source.lock().reply("done"); + }); + 1 + })); + + commands.register( + literal("look") + .executes(|ctx: &Ctx| { + // look for the sender + let mut source = ctx.source.lock(); + let Some(entity) = source.entity() else { + source.reply("I can't see you!"); + return 0; + }; + let Some(position) = source.bot.get_entity_component::(entity) else { + source.reply("I can't see you!"); + return 0; + }; + let eye_height = source + .bot + .get_entity_component::(entity) + .map(|h| *h) + .unwrap_or_default(); + source.bot.look_at(position.up(eye_height as f64)); + 1 + }) + .then(argument("x", integer()).then(argument("y", integer()).then( + argument("z", integer()).executes(|ctx: &Ctx| { + let pos = BlockPos::new( + get_integer(ctx, "x").unwrap(), + get_integer(ctx, "y").unwrap(), + get_integer(ctx, "z").unwrap(), + ); + println!("{:?}", pos); + let mut source = ctx.source.lock(); + source.bot.look_at(pos.center()); + 1 + }), + ))), + ); + + commands.register( + literal("walk").then(argument("seconds", float()).executes(|ctx: &Ctx| { + let mut seconds = get_float(ctx, "seconds").unwrap(); + let source = ctx.source.lock(); + let mut bot = source.bot.clone(); + + if seconds < 0. { + bot.walk(WalkDirection::Backward); + seconds = -seconds; + } else { + bot.walk(WalkDirection::Forward); + } + + tokio::spawn(async move { + tokio::time::sleep(Duration::from_secs_f32(seconds)).await; + bot.walk(WalkDirection::None); + }); + source.reply(&format!("ok, walking for {seconds} seconds")); + 1 + })), + ); + commands.register( + literal("sprint").then(argument("seconds", float()).executes(|ctx: &Ctx| { + let seconds = get_float(ctx, "seconds").unwrap(); + let source = ctx.source.lock(); + let mut bot = source.bot.clone(); + bot.sprint(SprintDirection::Forward); + tokio::spawn(async move { + tokio::time::sleep(Duration::from_secs_f32(seconds)).await; + bot.walk(WalkDirection::None); + }); + source.reply(&format!("ok, spriting for {seconds} seconds")); + 1 + })), + ); + + commands.register(literal("north").executes(|ctx: &Ctx| { + let mut source = ctx.source.lock(); + source.bot.set_direction(180., 0.); + source.reply("ok"); + 1 + })); + commands.register(literal("south").executes(|ctx: &Ctx| { + let mut source = ctx.source.lock(); + source.bot.set_direction(0., 0.); + source.reply("ok"); + 1 + })); + commands.register(literal("east").executes(|ctx: &Ctx| { + let mut source = ctx.source.lock(); + source.bot.set_direction(-90., 0.); + source.reply("ok"); + 1 + })); + commands.register(literal("west").executes(|ctx: &Ctx| { + let mut source = ctx.source.lock(); + source.bot.set_direction(90., 0.); + source.reply("ok"); + 1 + })); + commands.register( + literal("jump") + .executes(|ctx: &Ctx| { + let mut source = ctx.source.lock(); + source.bot.jump(); + source.reply("ok"); + 1 + }) + .then(argument("enabled", bool()).executes(|ctx: &Ctx| { + let jumping = get_bool(ctx, "enabled").unwrap(); + let mut source = ctx.source.lock(); + source.bot.set_jumping(jumping); + 1 + })), + ); + + commands.register(literal("stop").executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + source.bot.stop_pathfinding(); + source.reply("ok"); + *source.state.task.lock() = BotTask::None; + 1 + })); +} diff --git a/azalea/examples/testbot/killaura.rs b/azalea/examples/testbot/killaura.rs new file mode 100644 index 000000000..d86356fe2 --- /dev/null +++ b/azalea/examples/testbot/killaura.rs @@ -0,0 +1,48 @@ +use azalea::{ + ecs::prelude::*, + entity::{metadata::AbstractMonster, Dead, LocalEntity, Position}, + prelude::*, + world::{InstanceName, MinecraftEntityId}, +}; + +use crate::State; + +pub fn tick(mut bot: Client, state: State) -> anyhow::Result<()> { + if !state.killaura { + return Ok(()); + } + if bot.has_attack_cooldown() { + return Ok(()); + } + let mut nearest_entity = None; + let mut nearest_distance = f64::INFINITY; + let bot_position = bot.eye_position(); + let bot_instance_name = bot.component::(); + { + let mut ecs = bot.ecs.lock(); + let mut query = ecs + .query_filtered::<(&MinecraftEntityId, &Position, &InstanceName), ( + With, + Without, + Without, + )>(); + for (&entity_id, position, instance_name) in query.iter(&ecs) { + if instance_name != &bot_instance_name { + continue; + } + + let distance = bot_position.distance_to(position); + if distance < 4. && distance < nearest_distance { + nearest_entity = Some(entity_id); + nearest_distance = distance; + } + } + } + if let Some(nearest_entity) = nearest_entity { + println!("attacking {:?}", nearest_entity); + println!("distance {:?}", nearest_distance); + bot.attack(nearest_entity); + } + + Ok(()) +} diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs new file mode 100644 index 000000000..9a3bd4f8c --- /dev/null +++ b/azalea/examples/testbot/main.rs @@ -0,0 +1,198 @@ +//! A relatively simple bot for demonstrating some of Azalea's capabilities. +//! +//! Usage: +//! - Modify the consts below if necessary. +//! - Run `cargo r --example testbot` +//! - Commands are prefixed with `!` in chat. You can send them either in public +//! chat or as a /msg. +//! - Some commands to try are `!goto`, `!killaura`, `!down`. Check the +//! `commands` directory to see all of them. + +#![feature(async_closure)] +#![feature(trivial_bounds)] + +mod commands; +pub mod killaura; + +use azalea::pathfinder::PathfinderDebugParticles; +use azalea::{Account, ClientInformation}; + +use azalea::brigadier::command_dispatcher::CommandDispatcher; +use azalea::ecs::prelude::*; +use azalea::prelude::*; +use azalea::swarm::prelude::*; +use commands::{register_commands, CommandSource}; +use parking_lot::Mutex; +use std::sync::Arc; +use std::time::Duration; + +const USERNAME: &str = "azalea"; +const ADDRESS: &str = "localhost"; +/// Whether the bot should run /particle a ton of times to show where it's +/// pathfinding to. You should only have this on if the bot has operator +/// permissions, otherwise it'll just spam the server console unnecessarily. +const PATHFINDER_DEBUG_PARTICLES: bool = true; + +#[tokio::main] +async fn main() { + { + use parking_lot::deadlock; + use std::thread; + use std::time::Duration; + + // Create a background thread which checks for deadlocks every 10s + thread::spawn(move || loop { + thread::sleep(Duration::from_secs(10)); + let deadlocks = deadlock::check_deadlock(); + if deadlocks.is_empty() { + continue; + } + + println!("{} deadlocks detected", deadlocks.len()); + for (i, threads) in deadlocks.iter().enumerate() { + println!("Deadlock #{i}"); + for t in threads { + println!("Thread Id {:#?}", t.thread_id()); + println!("{:#?}", t.backtrace()); + } + } + }); + } + + let account = Account::offline(USERNAME); + + let mut commands = CommandDispatcher::new(); + register_commands(&mut commands); + let commands = Arc::new(commands); + + let builder = SwarmBuilder::new(); + builder + .set_handler(handle) + .set_swarm_handler(swarm_handle) + .add_account_with_state( + account, + State { + commands: commands.clone(), + ..Default::default() + }, + ) + .join_delay(Duration::from_millis(100)) + .start(ADDRESS) + .await + .unwrap(); +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)] +pub enum BotTask { + #[default] + None, +} + +#[derive(Component, Clone)] +pub struct State { + pub commands: Arc>>, + pub killaura: bool, + pub task: Arc>, +} + +impl Default for State { + fn default() -> Self { + Self { + commands: Arc::new(CommandDispatcher::new()), + killaura: true, + task: Arc::new(Mutex::new(BotTask::None)), + } + } +} + +#[derive(Resource, Default, Clone)] +struct SwarmState; + +async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Result<()> { + match event { + azalea::Event::Init => { + bot.set_client_information(ClientInformation { + view_distance: 32, + ..Default::default() + }) + .await?; + if PATHFINDER_DEBUG_PARTICLES { + bot.ecs + .lock() + .entity_mut(bot.entity) + .insert(PathfinderDebugParticles); + } + } + azalea::Event::Login => {} + azalea::Event::Chat(chat) => { + let (Some(username), content) = chat.split_sender_and_content() else { + return Ok(()); + }; + if username != "py5" { + return Ok(()); + } + + println!("{:?}", chat.message()); + + let command = if chat.is_whisper() { + Some(content) + } else { + content.strip_prefix("!").map(|s| s.to_owned()) + }; + if let Some(command) = command { + match state.commands.execute( + command, + Mutex::new(CommandSource { + bot: bot.clone(), + chat: chat.clone(), + state: state.clone(), + }), + ) { + Ok(_) => {} + Err(err) => { + eprintln!("{err:?}"); + let command_source = CommandSource { + bot, + chat: chat.clone(), + state: state.clone(), + }; + command_source.reply(&format!("{err:?}")); + } + } + } + } + azalea::Event::Tick => { + killaura::tick(bot.clone(), state.clone())?; + + let task = state.task.lock().clone(); + match task { + BotTask::None => {} + } + } + _ => {} + } + + Ok(()) +} +async fn swarm_handle( + mut swarm: Swarm, + event: SwarmEvent, + _state: SwarmState, +) -> anyhow::Result<()> { + match &event { + SwarmEvent::Disconnect(account) => { + println!("bot got kicked! {}", account.username); + tokio::time::sleep(Duration::from_secs(5)).await; + swarm.add_and_retry_forever(account, State::default()).await; + } + SwarmEvent::Chat(chat) => { + if chat.message().to_string() == "The particle was not visible for anybody" { + return Ok(()); + } + println!("{}", chat.message().to_ansi()); + } + _ => {} + } + + Ok(()) +} From cfbfdd77b4a400ef3bace378ff413aa2ff3bf57c Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 8 Jan 2024 00:12:54 -0600 Subject: [PATCH 07/37] fix ping packet, explosion packet, and panic less --- azalea-physics/src/lib.rs | 6 +++--- .../game/clientbound_explode_packet.rs | 21 +++++++++++++++---- .../packets/game/clientbound_ping_packet.rs | 1 - azalea/examples/testbot/main.rs | 4 ++-- azalea/src/pathfinder/mod.rs | 8 ++++--- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index a69c1bcf2..55f54ccd3 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -74,9 +74,9 @@ fn travel( jumping, ) in &mut query { - let world_lock = instance_container - .get(world_name) - .expect("All entities should be in a valid world"); + let Some(world_lock) = instance_container.get(world_name) else { + continue; + }; let world = world_lock.read(); // if !self.is_effective_ai() && !self.is_controlled_by_local_instance() { // // this.calculateEntityAnimation(this, this instanceof FlyingAnimal); diff --git a/azalea-protocol/src/packets/game/clientbound_explode_packet.rs b/azalea-protocol/src/packets/game/clientbound_explode_packet.rs index ae39135a9..58e61e2ee 100755 --- a/azalea-protocol/src/packets/game/clientbound_explode_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_explode_packet.rs @@ -1,9 +1,12 @@ -use std::io::{Cursor, Write}; +use std::{ + io::{Cursor, Write}, + str::FromStr, +}; use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; -use azalea_core::position::BlockPos; +use azalea_core::{position::BlockPos, resource_location::ResourceLocation}; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::{ParticleKind, SoundEvent}; @@ -59,7 +62,14 @@ impl McBufReadable for ClientboundExplodePacket { let block_interaction = BlockInteraction::read_from(buf)?; let small_explosion_particles = ParticleKind::read_from(buf)?; let large_explosion_particles = ParticleKind::read_from(buf)?; - let explosion_sound = SoundEvent::read_from(buf)?; + + let sound_event_resource_location = ResourceLocation::read_from(buf)?.to_string(); + let explosion_sound = + SoundEvent::from_str(&sound_event_resource_location).map_err(|_| { + BufReadError::UnexpectedStringEnumVariant { + id: sound_event_resource_location, + } + })?; Ok(Self { x, @@ -108,7 +118,10 @@ impl McBufWritable for ClientboundExplodePacket { self.block_interaction.write_into(buf)?; self.small_explosion_particles.write_into(buf)?; self.large_explosion_particles.write_into(buf)?; - self.explosion_sound.write_into(buf)?; + + let sound_event_resource_location = + ResourceLocation::new(&self.explosion_sound.to_string()); + sound_event_resource_location.write_into(buf)?; Ok(()) } diff --git a/azalea-protocol/src/packets/game/clientbound_ping_packet.rs b/azalea-protocol/src/packets/game/clientbound_ping_packet.rs index 82de4fab9..0bd2c8c3a 100755 --- a/azalea-protocol/src/packets/game/clientbound_ping_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_ping_packet.rs @@ -3,6 +3,5 @@ use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundPingPacket { - #[var] pub id: u32, } diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index 9a3bd4f8c..baa078d7b 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -5,7 +5,7 @@ //! - Run `cargo r --example testbot` //! - Commands are prefixed with `!` in chat. You can send them either in public //! chat or as a /msg. -//! - Some commands to try are `!goto`, `!killaura`, `!down`. Check the +//! - Some commands to try are `!goto`, `!killaura true`, `!down`. Check the //! `commands` directory to see all of them. #![feature(async_closure)] @@ -31,7 +31,7 @@ const ADDRESS: &str = "localhost"; /// Whether the bot should run /particle a ton of times to show where it's /// pathfinding to. You should only have this on if the bot has operator /// permissions, otherwise it'll just spam the server console unnecessarily. -const PATHFINDER_DEBUG_PARTICLES: bool = true; +const PATHFINDER_DEBUG_PARTICLES: bool = false; #[tokio::main] async fn main() { diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index 9fd769e64..360c4df51 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -208,9 +208,11 @@ fn goto_listener( let thread_pool = AsyncComputeTaskPool::get(); for event in events.read() { - let (mut pathfinder, executing_path, position, instance_name, inventory) = query - .get_mut(event.entity) - .expect("Called goto on an entity that's not in the world"); + let Ok((mut pathfinder, executing_path, position, instance_name, inventory)) = + query.get_mut(event.entity) + else { + continue; + }; if event.goal.success(BlockPos::from(position)) { // we're already at the goal, nothing to do From 42f49c58edc0782622e15d738b90db771e44a142 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 8 Jan 2024 00:15:05 -0600 Subject: [PATCH 08/37] update links to testbot in docs --- azalea/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azalea/README.md b/azalea/README.md index f40951919..e7f52cd6b 100755 --- a/azalea/README.md +++ b/azalea/README.md @@ -75,7 +75,7 @@ async fn handle(bot: Client, event: Event, state: State) -> anyhow::Result<()> { # Swarms -Azalea lets you create "swarms", which are a group of bots in the same world that can perform actions together. See [testbot](https://github.com/azalea-rs/azalea/blob/main/azalea/examples/testbot.rs) for an example. Also, if you're using swarms, you should also `use` both `azalea::prelude::*` and `azalea::swarm::prelude::*`. +Azalea lets you create "swarms", which are a group of bots in the same world that can perform actions together. See [testbot](https://github.com/azalea-rs/azalea/blob/main/azalea/examples/testbot/main.rs) for an example. Also, if you're using swarms, you should also `use` both `azalea::prelude::*` and `azalea::swarm::prelude::*`. # Plugins @@ -99,7 +99,7 @@ Note: If you get a `SetLoggerError`, it's because you have multiple loggers. Aza ## Deadlocks -If your code is simply hanging, it might be a deadlock. Copy the deadlock block in [`azalea/examples/testbot.rs`](https://github.com/azalea-rs/azalea/blob/main/azalea/examples/testbot.rs) to the beginning of your code and it'll print a long backtrace if a deadlock is detected. +If your code is simply hanging, it might be a deadlock. Copy the deadlock block in [`azalea/examples/testbot.rs`](https://github.com/azalea-rs/azalea/blob/main/azalea/examples/testbot/main.rs) to the beginning of your code and it'll print a long backtrace if a deadlock is detected. ## Backtraces From fd1c99e74a8a89278522d1d9f9e4493e7a0c0193 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 8 Jan 2024 21:15:12 -0600 Subject: [PATCH 09/37] upgrade deps --- Cargo.lock | 98 +++++++++---------- azalea-auth/Cargo.toml | 14 +-- azalea-block/azalea-block-macros/Cargo.toml | 6 +- azalea-buf/Cargo.toml | 2 +- azalea-buf/azalea-buf-macros/Cargo.toml | 6 +- azalea-chat/Cargo.toml | 4 +- azalea-client/Cargo.toml | 20 ++-- azalea-core/Cargo.toml | 2 +- azalea-entity/Cargo.toml | 2 +- .../azalea-inventory-macros/Cargo.toml | 6 +- azalea-language/Cargo.toml | 4 +- azalea-physics/Cargo.toml | 2 +- azalea-protocol/Cargo.toml | 16 +-- .../azalea-protocol-macros/Cargo.toml | 6 +- azalea-registry/Cargo.toml | 2 +- .../azalea-registry-macros/Cargo.toml | 6 +- azalea-world/Cargo.toml | 8 +- azalea/Cargo.toml | 12 +-- azalea/examples/testbot/main.rs | 1 - 19 files changed, 108 insertions(+), 109 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 680c9dd77..980188251 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "getrandom", @@ -76,9 +76,9 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anyhow" -version = "1.0.77" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d19de80eff169429ac1e9f48fffb163916b448a44e8e046186232046d9e1f9" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "async-channel" @@ -101,7 +101,7 @@ dependencies = [ "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "slab", ] @@ -124,7 +124,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -135,13 +135,13 @@ checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" [[package]] name = "async-trait" -version = "0.1.75" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -177,7 +177,7 @@ dependencies = [ "criterion", "derive_more", "futures", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "nohash-hasher", "num-traits", "parking_lot", @@ -227,7 +227,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -258,7 +258,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -388,7 +388,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -442,7 +442,7 @@ dependencies = [ "bytes", "flate2", "futures", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "futures-util", "log", "once_cell", @@ -464,7 +464,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -483,7 +483,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -562,7 +562,7 @@ checksum = "f484318350462c58ba3942a45a656c1fd6b6e484a6b6b7abc3a787ad1a51e500" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -595,7 +595,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -623,7 +623,7 @@ dependencies = [ "proc-macro2", "quote", "rustc-hash", - "syn 2.0.43", + "syn 2.0.48", "toml_edit", ] @@ -671,7 +671,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", "uuid", ] @@ -729,7 +729,7 @@ checksum = "7aafecc952b6b8eb1a93c12590bd867d25df2f4ae1033a01dfdfc3c35ebccfff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -1102,7 +1102,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -1281,9 +1281,9 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ "fastrand 2.0.1", "futures-core", @@ -1300,7 +1300,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2010,18 +2010,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.71" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2334,29 +2334,29 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -2444,7 +2444,7 @@ source = "git+https://github.com/azalea-rs/simdnbt#c255ab673a7439c52dd299eac53ea dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2537,9 +2537,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.43" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -2578,22 +2578,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2668,7 +2668,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2737,7 +2737,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2970,7 +2970,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -3004,7 +3004,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3230,7 +3230,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] diff --git a/azalea-auth/Cargo.toml b/azalea-auth/Cargo.toml index 82420abea..cf98544bc 100644 --- a/azalea-auth/Cargo.toml +++ b/azalea-auth/Cargo.toml @@ -15,19 +15,19 @@ base64 = "0.21.5" chrono = { version = "0.4.31", default-features = false, features = ["serde"] } tracing = "0.1.40" num-bigint = "0.4.4" -once_cell = "1.18.0" -reqwest = { version = "0.11.22", default-features = false, features = [ +once_cell = "1.19.0" +reqwest = { version = "0.11.23", default-features = false, features = [ "json", "rustls-tls", ] } rsa = "0.9.6" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -thiserror = "1.0.50" -tokio = { version = "1.34.0", features = ["fs"] } +serde = { version = "1.0.195", features = ["derive"] } +serde_json = "1.0.111" +thiserror = "1.0.56" +tokio = { version = "1.35.1", features = ["fs"] } uuid = { version = "1.6.1", features = ["serde", "v3"] } md-5 = "0.10.6" [dev-dependencies] env_logger = "0.10.1" -tokio = { version = "1.34.0", features = ["full"] } +tokio = { version = "1.35.1", features = ["full"] } diff --git a/azalea-block/azalea-block-macros/Cargo.toml b/azalea-block/azalea-block-macros/Cargo.toml index 720e44804..5fa1ce486 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.70" -quote = "1.0.33" -syn = "2.0.39" +proc-macro2 = "1.0.76" +quote = "1.0.35" +syn = "2.0.48" diff --git a/azalea-buf/Cargo.toml b/azalea-buf/Cargo.toml index f15525b7a..60f97f2b3 100644 --- a/azalea-buf/Cargo.toml +++ b/azalea-buf/Cargo.toml @@ -14,7 +14,7 @@ azalea-buf-macros = { path = "./azalea-buf-macros", version = "0.9.0" } byteorder = "^1.5.0" tracing = "0.1.40" serde_json = { version = "^1.0", optional = true } -thiserror = "1.0.50" +thiserror = "1.0.56" uuid = "^1.6.1" [features] diff --git a/azalea-buf/azalea-buf-macros/Cargo.toml b/azalea-buf/azalea-buf-macros/Cargo.toml index facc04b1e..f684ae2e7 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.70" -quote = "^1.0.33" -syn = { version = "^2.0.39", features = ["extra-traits"] } +proc-macro2 = "^1.0.76" +quote = "^1.0.35" +syn = { version = "^2.0.48", features = ["extra-traits"] } diff --git a/azalea-chat/Cargo.toml b/azalea-chat/Cargo.toml index 247285c51..7f66aa7d3 100644 --- a/azalea-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -21,7 +21,7 @@ azalea-buf = { path = "../azalea-buf", features = [ azalea-language = { path = "../azalea-language", version = "0.9.0" } simdnbt = { version = "0.3", optional = true, git = "https://github.com/azalea-rs/simdnbt" } tracing = "0.1.40" -once_cell = "1.18.0" +once_cell = "1.19.0" serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0.108" +serde_json = "^1.0.111" azalea-registry = { path = "../azalea-registry", version = "0.9.0", optional = true } diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index 117911015..70ab22cf0 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -10,9 +10,9 @@ version = "0.9.0" [dependencies] simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } -reqwest = { version = "0.11.22", default-features = false } -anyhow = "1.0.75" -async-trait = "0.1.74" +reqwest = { version = "0.11.23", default-features = false } +anyhow = "1.0.79" +async-trait = "0.1.77" azalea-auth = { path = "../azalea-auth", version = "0.9.0" } azalea-block = { path = "../azalea-block", version = "0.9.0" } azalea-chat = { path = "../azalea-chat", version = "0.9.0" } @@ -30,19 +30,19 @@ bevy_tasks = "0.12.1" bevy_time = "0.12.1" azalea-inventory = { path = "../azalea-inventory", version = "0.9.0" } derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } -futures = "0.3.29" +futures = "0.3.30" tracing = "0.1.40" nohash-hasher = "0.2.0" -once_cell = "1.18.0" +once_cell = "1.19.0" parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } regex = "1.10.2" -thiserror = "^1.0.50" -tokio = { version = "^1.34.0", features = ["sync"] } +thiserror = "^1.0.56" +tokio = { version = "^1.35.1", features = ["sync"] } uuid = "^1.6.1" azalea-entity = { version = "0.9.0", path = "../azalea-entity" } -serde_json = "1.0.108" -serde = "1.0.193" -minecraft_folder_path = "0.1.1" +serde_json = "1.0.111" +serde = "1.0.195" +minecraft_folder_path = "0.1.2" [features] default = ["log"] diff --git a/azalea-core/Cargo.toml b/azalea-core/Cargo.toml index 2b862d3ce..c130aa789 100644 --- a/azalea-core/Cargo.toml +++ b/azalea-core/Cargo.toml @@ -18,7 +18,7 @@ nohash-hasher = "0.2.0" num-traits = "0.2.17" serde = { version = "^1.0", optional = true } uuid = "^1.6.1" -serde_json = "^1.0.108" +serde_json = "^1.0.111" tracing = "0.1.40" [features] diff --git a/azalea-entity/Cargo.toml b/azalea-entity/Cargo.toml index b3762da83..fe4671c75 100644 --- a/azalea-entity/Cargo.toml +++ b/azalea-entity/Cargo.toml @@ -26,5 +26,5 @@ enum-as-inner = "0.6.0" tracing = "0.1.40" nohash-hasher = "0.2.0" parking_lot = "0.12.1" -thiserror = "1.0.50" +thiserror = "1.0.56" uuid = "1.6.1" diff --git a/azalea-inventory/azalea-inventory-macros/Cargo.toml b/azalea-inventory/azalea-inventory-macros/Cargo.toml index a18e2769c..337afc1d6 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.70" -quote = "1.0.33" -syn = "2.0.39" +proc-macro2 = "1.0.76" +quote = "1.0.35" +syn = "2.0.48" diff --git a/azalea-language/Cargo.toml b/azalea-language/Cargo.toml index 57bfe1453..c2a363ddc 100644 --- a/azalea-language/Cargo.toml +++ b/azalea-language/Cargo.toml @@ -9,7 +9,7 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -once_cell = "1.18.0" +once_cell = "1.19.0" serde = "^1.0" -serde_json = "^1.0.108" +serde_json = "^1.0.111" # tokio = {version = "^1.21.2", features = ["fs"]} diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index 9652fdb22..6a4f7f209 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -18,7 +18,7 @@ azalea-world = { path = "../azalea-world", version = "0.9.0" } bevy_app = "0.12.1" bevy_ecs = "0.12.1" tracing = "0.1.40" -once_cell = "1.18.0" +once_cell = "1.19.0" parking_lot = "^0.12.1" [dev-dependencies] diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 3928af41a..945bf6c2d 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -33,14 +33,14 @@ bevy_ecs = { version = "0.12.1", default-features = false } byteorder = "^1.5.0" bytes = "^1.5.0" flate2 = "1.0.28" -futures = "0.3.29" -futures-lite = "2.1.0" -futures-util = "0.3.29" +futures = "0.3.30" +futures-lite = "2.2.0" +futures-util = "0.3.30" tracing = "0.1.40" serde = { version = "^1.0", features = ["serde_derive"] } -serde_json = "^1.0.108" -thiserror = "1.0.50" -tokio = { version = "^1.34.0", features = ["io-util", "net", "macros"] } +serde_json = "^1.0.111" +thiserror = "1.0.56" +tokio = { version = "^1.35.1", features = ["io-util", "net", "macros"] } tokio-util = { version = "0.7.10", features = ["codec"] } trust-dns-resolver = { version = "^0.23.2", default-features = false, features = [ "tokio-runtime", @@ -55,7 +55,7 @@ packets = ["connecting", "dep:azalea-core"] strict_registry = ["packets"] [dev-dependencies] -anyhow = "^1.0.75" +anyhow = "^1.0.79" tracing = "^0.1.40" tracing-subscriber = "^0.3.18" -once_cell = "1.18.0" +once_cell = "1.19.0" diff --git a/azalea-protocol/azalea-protocol-macros/Cargo.toml b/azalea-protocol/azalea-protocol-macros/Cargo.toml index b20ac4da1..00e794a06 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.70" -quote = "^1.0.33" -syn = "^2.0.39" +proc-macro2 = "^1.0.76" +quote = "^1.0.35" +syn = "^2.0.48" diff --git a/azalea-registry/Cargo.toml b/azalea-registry/Cargo.toml index 5a86d30bd..25dd09073 100644 --- a/azalea-registry/Cargo.toml +++ b/azalea-registry/Cargo.toml @@ -13,7 +13,7 @@ simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-registry-macros = { path = "./azalea-registry-macros", version = "0.9.0" } -once_cell = "1.18.0" +once_cell = "1.19.0" [features] serde = ["azalea-registry-macros/serde"] default = ["serde"] diff --git a/azalea-registry/azalea-registry-macros/Cargo.toml b/azalea-registry/azalea-registry-macros/Cargo.toml index 5941f0404..c15fc11ac 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.70" -quote = "1.0.33" -syn = "2.0.39" +proc-macro2 = "1.0.76" +quote = "1.0.35" +syn = "2.0.48" [features] serde = [] diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index 81a7839d1..23c730b1d 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -22,12 +22,12 @@ derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } enum-as-inner = "0.6.0" tracing = "0.1.40" nohash-hasher = "0.2.0" -once_cell = "1.18.0" +once_cell = "1.19.0" parking_lot = "^0.12.1" -thiserror = "1.0.50" +thiserror = "1.0.56" uuid = "1.6.1" -serde_json = "1.0.108" -serde = "1.0.193" +serde_json = "1.0.111" +serde = "1.0.195" [dev-dependencies] azalea-client = { path = "../azalea-client" } diff --git a/azalea/Cargo.toml b/azalea/Cargo.toml index affbeab6d..e61433882 100644 --- a/azalea/Cargo.toml +++ b/azalea/Cargo.toml @@ -12,8 +12,8 @@ pre-release-replacements = [ ] [dependencies] -anyhow = "^1.0.75" -async-trait = "0.1.74" +anyhow = "^1.0.79" +async-trait = "0.1.77" azalea-block = { version = "0.9.0", path = "../azalea-block" } azalea-chat = { version = "0.9.0", path = "../azalea-chat" } azalea-client = { version = "0.9.0", path = "../azalea-client", default-features = false } @@ -30,15 +30,15 @@ bevy_app = "0.12.1" bevy_ecs = "0.12.1" bevy_tasks = { version = "0.12.1", features = ["multi-threaded"] } derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } -futures = "0.3.29" -futures-lite = "2.1.0" +futures = "0.3.30" +futures-lite = "2.2.0" tracing = "0.1.40" nohash-hasher = "0.2.0" num-traits = "0.2.17" parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } priority-queue = "1.3.2" -thiserror = "^1.0.50" -tokio = "^1.34.0" +thiserror = "^1.0.56" +tokio = "^1.35.1" uuid = "1.6.1" bevy_log = "0.12.1" azalea-entity = { version = "0.9.0", path = "../azalea-entity" } diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index baa078d7b..c3bc93f76 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -123,7 +123,6 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Resu .insert(PathfinderDebugParticles); } } - azalea::Event::Login => {} azalea::Event::Chat(chat) => { let (Some(username), content) = chat.split_sender_and_content() else { return Ok(()); From 73be589e7ffa826a32e7b88dad17b6b73d7aba3c Mon Sep 17 00:00:00 2001 From: 1zuna Date: Sun, 21 Jan 2024 00:34:54 +0100 Subject: [PATCH 10/37] fixes unwrap on write_raw_packet(...) (#128) --- azalea-client/src/raw_connection.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/azalea-client/src/raw_connection.rs b/azalea-client/src/raw_connection.rs index bcb1ada04..53abd8810 100644 --- a/azalea-client/src/raw_connection.rs +++ b/azalea-client/src/raw_connection.rs @@ -10,7 +10,7 @@ use azalea_protocol::{ use bevy_ecs::prelude::*; use parking_lot::Mutex; use thiserror::Error; -use tokio::sync::mpsc; +use tokio::sync::mpsc::{self, error::SendError}; use tracing::error; /// A component for clients that can read and write packets to the server. This @@ -51,6 +51,12 @@ pub enum WritePacketError { }, #[error(transparent)] Encoding(#[from] azalea_protocol::write::PacketEncodeError), + #[error(transparent)] + SendError { + #[from] + #[backtrace] + source: SendError>, + }, } impl RawConnection { @@ -88,11 +94,12 @@ impl RawConnection { } } - pub fn write_raw_packet(&self, raw_packet: Vec) { + pub fn write_raw_packet(&self, raw_packet: Vec) -> Result<(), WritePacketError> { self.writer .outgoing_packets_sender .send(raw_packet) - .unwrap(); + .map_err(WritePacketError::from)?; + Ok(()) } /// Write the packet with the given state to the server. @@ -106,7 +113,8 @@ impl RawConnection { packet: P, ) -> Result<(), WritePacketError> { let raw_packet = serialize_packet(&packet)?; - self.write_raw_packet(raw_packet); + self.write_raw_packet(raw_packet)?; + Ok(()) } From 7feee2954d14ecd42e1b0a5143d4540ef79a941d Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 20 Jan 2024 17:35:54 -0600 Subject: [PATCH 11/37] remove unnecessary map_err --- azalea-client/src/raw_connection.rs | 9 +++------ .../src/packets/game/clientbound_explode_packet.rs | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/azalea-client/src/raw_connection.rs b/azalea-client/src/raw_connection.rs index 53abd8810..9f7a85f12 100644 --- a/azalea-client/src/raw_connection.rs +++ b/azalea-client/src/raw_connection.rs @@ -94,11 +94,8 @@ impl RawConnection { } } - pub fn write_raw_packet(&self, raw_packet: Vec) -> Result<(), WritePacketError> { - self.writer - .outgoing_packets_sender - .send(raw_packet) - .map_err(WritePacketError::from)?; + pub fn write_raw_packet(&self, raw_packet: Vec) -> Result<(), WritePacketError> { + self.writer.outgoing_packets_sender.send(raw_packet)?; Ok(()) } @@ -114,7 +111,7 @@ impl RawConnection { ) -> Result<(), WritePacketError> { let raw_packet = serialize_packet(&packet)?; self.write_raw_packet(raw_packet)?; - + Ok(()) } diff --git a/azalea-protocol/src/packets/game/clientbound_explode_packet.rs b/azalea-protocol/src/packets/game/clientbound_explode_packet.rs index 58e61e2ee..23c416d1b 100755 --- a/azalea-protocol/src/packets/game/clientbound_explode_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_explode_packet.rs @@ -121,7 +121,7 @@ impl McBufWritable for ClientboundExplodePacket { let sound_event_resource_location = ResourceLocation::new(&self.explosion_sound.to_string()); - sound_event_resource_location.write_into(buf)?; + sound_event_resource_location.write_into(buf)?; Ok(()) } From 64d48897afe5bcb40931f8ef8b3594fe275751e8 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 25 Jan 2024 00:44:20 -0600 Subject: [PATCH 12/37] update deps --- Cargo.lock | 149 ++++++++++++------ azalea-auth/Cargo.toml | 8 +- azalea-block/azalea-block-macros/Cargo.toml | 2 +- azalea-block/src/lib.rs | 1 + azalea-buf/Cargo.toml | 4 +- azalea-buf/azalea-buf-macros/Cargo.toml | 2 +- azalea-chat/Cargo.toml | 2 +- azalea-client/Cargo.toml | 6 +- azalea-core/Cargo.toml | 4 +- azalea-crypto/Cargo.toml | 2 +- azalea-entity/Cargo.toml | 4 +- azalea-inventory/Cargo.toml | 2 +- .../azalea-inventory-macros/Cargo.toml | 2 +- azalea-physics/Cargo.toml | 2 +- azalea-protocol/Cargo.toml | 4 +- .../azalea-protocol-macros/Cargo.toml | 2 +- azalea-registry/Cargo.toml | 3 +- .../azalea-registry-macros/Cargo.toml | 2 +- azalea-world/Cargo.toml | 4 +- azalea/Cargo.toml | 2 +- 20 files changed, 131 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 980188251..57417f862 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,12 +68,54 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "anstream" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + [[package]] name = "anstyle" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.79" @@ -528,9 +570,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -809,9 +851,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" dependencies = [ "num-traits", "serde", @@ -879,6 +921,12 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "concurrent-queue" version = "2.4.0" @@ -1105,17 +1153,27 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "9eeb342678d785662fd2514be38c459bb925f02b68dd2a3e0f21d7ef82d979dd" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] [[package]] @@ -1345,9 +1403,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -1599,9 +1657,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -1617,9 +1675,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.151" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libm" @@ -2010,9 +2068,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -2087,13 +2145,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.4", "regex-syntax 0.8.2", ] @@ -2108,9 +2166,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ "aho-corasick", "memchr", @@ -2427,8 +2485,8 @@ dependencies = [ [[package]] name = "simdnbt" -version = "0.3.0" -source = "git+https://github.com/azalea-rs/simdnbt#c255ab673a7439c52dd299eac53ea59566cdda9d" +version = "0.4.0" +source = "git+https://github.com/azalea-rs/simdnbt#4594562ef0146431fd8c4405c753b32d1bb89c6a" dependencies = [ "byteorder", "flate2", @@ -2439,8 +2497,8 @@ dependencies = [ [[package]] name = "simdnbt-derive" -version = "0.3.0" -source = "git+https://github.com/azalea-rs/simdnbt#c255ab673a7439c52dd299eac53ea59566cdda9d" +version = "0.4.0" +source = "git+https://github.com/azalea-rs/simdnbt#4594562ef0146431fd8c4405c753b32d1bb89c6a" dependencies = [ "proc-macro2", "quote", @@ -2567,15 +2625,6 @@ dependencies = [ "libc", ] -[[package]] -name = "termcolor" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" version = "1.0.56" @@ -2895,11 +2944,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom", "md-5", @@ -2951,9 +3006,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2961,9 +3016,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -2988,9 +3043,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2998,9 +3053,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -3011,9 +3066,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" diff --git a/azalea-auth/Cargo.toml b/azalea-auth/Cargo.toml index cf98544bc..0d65b7e02 100644 --- a/azalea-auth/Cargo.toml +++ b/azalea-auth/Cargo.toml @@ -11,8 +11,8 @@ version = "0.9.0" [dependencies] azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-crypto = { path = "../azalea-crypto", version = "0.9.0" } -base64 = "0.21.5" -chrono = { version = "0.4.31", default-features = false, features = ["serde"] } +base64 = "0.21.7" +chrono = { version = "0.4.32", default-features = false, features = ["serde"] } tracing = "0.1.40" num-bigint = "0.4.4" once_cell = "1.19.0" @@ -25,9 +25,9 @@ serde = { version = "1.0.195", features = ["derive"] } serde_json = "1.0.111" thiserror = "1.0.56" tokio = { version = "1.35.1", features = ["fs"] } -uuid = { version = "1.6.1", features = ["serde", "v3"] } +uuid = { version = "1.7.0", features = ["serde", "v3"] } md-5 = "0.10.6" [dev-dependencies] -env_logger = "0.10.1" +env_logger = "0.11.0" tokio = { version = "1.35.1", features = ["full"] } diff --git a/azalea-block/azalea-block-macros/Cargo.toml b/azalea-block/azalea-block-macros/Cargo.toml index 5fa1ce486..97f1767f0 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.76" +proc-macro2 = "1.0.78" quote = "1.0.35" syn = "2.0.48" diff --git a/azalea-block/src/lib.rs b/azalea-block/src/lib.rs index 983de5791..dc41b4055 100755 --- a/azalea-block/src/lib.rs +++ b/azalea-block/src/lib.rs @@ -1,4 +1,5 @@ #![doc = include_str!("../README.md")] +#![feature(trait_upcasting)] mod behavior; mod generated; diff --git a/azalea-buf/Cargo.toml b/azalea-buf/Cargo.toml index 60f97f2b3..31a1b4643 100644 --- a/azalea-buf/Cargo.toml +++ b/azalea-buf/Cargo.toml @@ -9,13 +9,13 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } +simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf-macros = { path = "./azalea-buf-macros", version = "0.9.0" } byteorder = "^1.5.0" tracing = "0.1.40" serde_json = { version = "^1.0", optional = true } thiserror = "1.0.56" -uuid = "^1.6.1" +uuid = "^1.7.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 f684ae2e7..1fc322941 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.76" +proc-macro2 = "^1.0.78" quote = "^1.0.35" syn = { version = "^2.0.48", features = ["extra-traits"] } diff --git a/azalea-chat/Cargo.toml b/azalea-chat/Cargo.toml index 7f66aa7d3..b9e8f697b 100644 --- a/azalea-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -19,7 +19,7 @@ azalea-buf = { path = "../azalea-buf", features = [ "serde_json", ], version = "0.9.0", optional = true } azalea-language = { path = "../azalea-language", version = "0.9.0" } -simdnbt = { version = "0.3", optional = true, git = "https://github.com/azalea-rs/simdnbt" } +simdnbt = { version = "0.4", optional = true, git = "https://github.com/azalea-rs/simdnbt" } tracing = "0.1.40" once_cell = "1.19.0" serde = { version = "^1.0", features = ["derive"] } diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index 70ab22cf0..37e450acf 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -9,7 +9,7 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } +simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } reqwest = { version = "0.11.23", default-features = false } anyhow = "1.0.79" async-trait = "0.1.77" @@ -35,10 +35,10 @@ tracing = "0.1.40" nohash-hasher = "0.2.0" once_cell = "1.19.0" parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } -regex = "1.10.2" +regex = "1.10.3" thiserror = "^1.0.56" tokio = { version = "^1.35.1", features = ["sync"] } -uuid = "^1.6.1" +uuid = "^1.7.0" azalea-entity = { version = "0.9.0", path = "../azalea-entity" } serde_json = "1.0.111" serde = "1.0.195" diff --git a/azalea-core/Cargo.toml b/azalea-core/Cargo.toml index c130aa789..e82c14703 100644 --- a/azalea-core/Cargo.toml +++ b/azalea-core/Cargo.toml @@ -9,7 +9,7 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } +simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } @@ -17,7 +17,7 @@ bevy_ecs = { version = "0.12.1", default-features = false, optional = true } nohash-hasher = "0.2.0" num-traits = "0.2.17" serde = { version = "^1.0", optional = true } -uuid = "^1.6.1" +uuid = "^1.7.0" serde_json = "^1.0.111" tracing = "0.1.40" diff --git a/azalea-crypto/Cargo.toml b/azalea-crypto/Cargo.toml index e15374f97..a2b2834b3 100644 --- a/azalea-crypto/Cargo.toml +++ b/azalea-crypto/Cargo.toml @@ -18,7 +18,7 @@ rsa = { version = "0.9.6", features = ["sha2"] } rsa_public_encrypt_pkcs1 = "0.4.0" sha-1 = "^0.10.1" sha2 = "0.10.8" -uuid = "^1.6.1" +uuid = "^1.7.0" [dev-dependencies] criterion = { version = "^0.5.1", features = ["html_reports"] } diff --git a/azalea-entity/Cargo.toml b/azalea-entity/Cargo.toml index fe4671c75..fde1cbf34 100644 --- a/azalea-entity/Cargo.toml +++ b/azalea-entity/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } +simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } azalea-block = { version = "0.9.0", path = "../azalea-block" } azalea-buf = { version = "0.9.0", path = "../azalea-buf" } azalea-chat = { version = "0.9.0", path = "../azalea-chat", features = [ @@ -27,4 +27,4 @@ tracing = "0.1.40" nohash-hasher = "0.2.0" parking_lot = "0.12.1" thiserror = "1.0.56" -uuid = "1.6.1" +uuid = "1.7.0" diff --git a/azalea-inventory/Cargo.toml b/azalea-inventory/Cargo.toml index b3c66eceb..aacbd4340 100644 --- a/azalea-inventory/Cargo.toml +++ b/azalea-inventory/Cargo.toml @@ -9,7 +9,7 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } +simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf = { version = "0.9.0", path = "../azalea-buf" } azalea-inventory-macros = { version = "0.9.0", path = "./azalea-inventory-macros" } azalea-registry = { version = "0.9.0", path = "../azalea-registry" } diff --git a/azalea-inventory/azalea-inventory-macros/Cargo.toml b/azalea-inventory/azalea-inventory-macros/Cargo.toml index 337afc1d6..afdfe3979 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.76" +proc-macro2 = "1.0.78" quote = "1.0.35" syn = "2.0.48" diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index 6a4f7f209..dfadc9c53 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -23,4 +23,4 @@ parking_lot = "^0.12.1" [dev-dependencies] bevy_time = "0.12.1" -uuid = "^1.6.1" +uuid = "^1.7.0" diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 945bf6c2d..080740b2e 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -9,7 +9,7 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } +simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } async-recursion = "1.0.5" azalea-auth = { path = "../azalea-auth", version = "0.9.0" } azalea-block = { path = "../azalea-block", default-features = false, version = "0.9.0" } @@ -45,7 +45,7 @@ tokio-util = { version = "0.7.10", features = ["codec"] } trust-dns-resolver = { version = "^0.23.2", default-features = false, features = [ "tokio-runtime", ] } -uuid = "1.6.1" +uuid = "1.7.0" log = "0.4.20" [features] diff --git a/azalea-protocol/azalea-protocol-macros/Cargo.toml b/azalea-protocol/azalea-protocol-macros/Cargo.toml index 00e794a06..7d4bb3e26 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.76" +proc-macro2 = "^1.0.78" quote = "^1.0.35" syn = "^2.0.48" diff --git a/azalea-registry/Cargo.toml b/azalea-registry/Cargo.toml index 25dd09073..e1bae3afd 100644 --- a/azalea-registry/Cargo.toml +++ b/azalea-registry/Cargo.toml @@ -9,8 +9,7 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } - +simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-registry-macros = { path = "./azalea-registry-macros", version = "0.9.0" } once_cell = "1.19.0" diff --git a/azalea-registry/azalea-registry-macros/Cargo.toml b/azalea-registry/azalea-registry-macros/Cargo.toml index c15fc11ac..56d63bf96 100644 --- a/azalea-registry/azalea-registry-macros/Cargo.toml +++ b/azalea-registry/azalea-registry-macros/Cargo.toml @@ -12,7 +12,7 @@ proc-macro = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -proc-macro2 = "1.0.76" +proc-macro2 = "1.0.78" quote = "1.0.35" syn = "2.0.48" diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index 23c730b1d..e69b4b971 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -9,7 +9,7 @@ version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -simdnbt = { version = "0.3", git = "https://github.com/azalea-rs/simdnbt" } +simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } azalea-block = { path = "../azalea-block", default-features = false, version = "0.9.0" } azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-core = { path = "../azalea-core", version = "0.9.0", features = [ @@ -25,7 +25,7 @@ nohash-hasher = "0.2.0" once_cell = "1.19.0" parking_lot = "^0.12.1" thiserror = "1.0.56" -uuid = "1.6.1" +uuid = "1.7.0" serde_json = "1.0.111" serde = "1.0.195" diff --git a/azalea/Cargo.toml b/azalea/Cargo.toml index e61433882..41803928a 100644 --- a/azalea/Cargo.toml +++ b/azalea/Cargo.toml @@ -39,7 +39,7 @@ parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } priority-queue = "1.3.2" thiserror = "^1.0.56" tokio = "^1.35.1" -uuid = "1.6.1" +uuid = "1.7.0" bevy_log = "0.12.1" azalea-entity = { version = "0.9.0", path = "../azalea-entity" } bevy_time = "0.12.1" From be4f13c36c281f086602092098522b3f25fc0680 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 17 Feb 2024 14:43:42 -0600 Subject: [PATCH 13/37] upgrade deps, bevy 0.13 --- Cargo.lock | 371 +++++++++--------- azalea-auth/Cargo.toml | 16 +- azalea-block/azalea-block-macros/Cargo.toml | 2 +- azalea-buf/Cargo.toml | 2 +- azalea-buf/azalea-buf-macros/Cargo.toml | 2 +- azalea-chat/Cargo.toml | 2 +- azalea-client/Cargo.toml | 20 +- azalea-client/src/entity_query.rs | 21 +- azalea-client/src/interact.rs | 2 +- azalea-client/src/inventory.rs | 2 +- azalea-client/src/mining.rs | 4 +- azalea-client/src/packet_handling/game.rs | 4 +- azalea-core/Cargo.toml | 6 +- azalea-crypto/Cargo.toml | 2 +- azalea-entity/Cargo.toml | 6 +- .../azalea-inventory-macros/Cargo.toml | 2 +- azalea-language/Cargo.toml | 2 +- azalea-physics/Cargo.toml | 6 +- azalea-protocol/Cargo.toml | 8 +- .../azalea-protocol-macros/Cargo.toml | 2 +- .../azalea-registry-macros/Cargo.toml | 2 +- azalea-world/Cargo.toml | 8 +- azalea/Cargo.toml | 18 +- azalea/src/nearest_entity.rs | 6 +- azalea/src/pathfinder/world.rs | 4 +- 25 files changed, 253 insertions(+), 267 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57417f862..6f61f0c1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ "cfg-if", "getrandom", @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -124,13 +124,15 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "async-channel" -version = "1.9.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener 2.5.3", + "event-listener 5.0.0", + "event-listener-strategy 0.5.0", "futures-core", + "pin-project-lite", ] [[package]] @@ -142,8 +144,8 @@ dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.2.0", + "fastrand", + "futures-lite", "slab", ] @@ -153,8 +155,8 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" dependencies = [ - "event-listener 4.0.1", - "event-listener-strategy", + "event-listener 4.0.2", + "event-listener-strategy 0.4.0", "pin-project-lite", ] @@ -166,14 +168,14 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] name = "async-task" -version = "4.6.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" @@ -183,7 +185,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -219,7 +221,7 @@ dependencies = [ "criterion", "derive_more", "futures", - "futures-lite 2.2.0", + "futures-lite", "nohash-hasher", "num-traits", "parking_lot", @@ -269,7 +271,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -300,7 +302,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -430,7 +432,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -484,7 +486,7 @@ dependencies = [ "bytes", "flate2", "futures", - "futures-lite 2.2.0", + "futures-lite", "futures-util", "log", "once_cell", @@ -506,7 +508,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -525,7 +527,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -582,9 +584,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bevy_app" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41731817993f92e4363dd3335558e779e290bc71eefc0b5547052b85810907e" +checksum = "8bce3544afc010ffed39c136f6d5a9322d20d38df1394d468ba9106caa0434cb" dependencies = [ "bevy_derive", "bevy_ecs", @@ -598,20 +600,20 @@ dependencies = [ [[package]] name = "bevy_derive" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f484318350462c58ba3942a45a656c1fd6b6e484a6b6b7abc3a787ad1a51e500" +checksum = "028ae2a34678055185d7f1beebb1ebe6a8dcf3733e139e4ee1383a7f29ae8ba6" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] name = "bevy_ecs" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709fbd22f81fb681534cd913c41e1cd18b17143368743281195d7f024b61aea" +checksum = "b85406d5febbbdbcac4444ef61cd9a816f2f025ed692a3fc5439a32153070304" dependencies = [ "async-channel", "bevy_ecs_macros", @@ -620,7 +622,6 @@ dependencies = [ "bevy_tasks", "bevy_utils", "downcast-rs", - "event-listener 2.5.3", "fixedbitset", "rustc-hash", "serde", @@ -630,21 +631,21 @@ dependencies = [ [[package]] name = "bevy_ecs_macros" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8843aa489f159f25cdcd9fee75cd7d221a7098a71eaa72cb2d6b40ac4e3f1ba" +checksum = "9a3ce4b65d7c5f1990e729df75cec2ea6e2241b4a0c37b31c281a04c59c11b7b" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] name = "bevy_log" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc10ba1d225a8477b9e80a1bf797d8a8b8274e83c9b24fb4d9351aec9229755" +checksum = "cfd5bcc3531f8008897fb03cc8751b86d0d29ef94f8fd38b422f9603b7ae80d0" dependencies = [ "android_log-sys", "bevy_app", @@ -658,22 +659,22 @@ dependencies = [ [[package]] name = "bevy_macro_utils" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e566640c6b6dced73d2006c764c2cffebe1a82be4809486c4a5d7b4b50efed4d" +checksum = "ac4401c25b197e7c1455a4875a90b61bba047a9e8d290ce029082c818ab1a21c" dependencies = [ "proc-macro2", "quote", "rustc-hash", - "syn 2.0.48", + "syn 2.0.49", "toml_edit", ] [[package]] name = "bevy_math" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ddc2b76783939c530178f88e5711a1b01044d7b02db4033e2eb8b43b6cf4ec" +checksum = "6f312b1b8aa6d3965b65040b08e33efac030db3071f20b44f9da9c4c3dfcaf76" dependencies = [ "glam", "serde", @@ -681,15 +682,15 @@ dependencies = [ [[package]] name = "bevy_ptr" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ec20c8fafcdc196508ef5ccb4f0400a8d193cb61f7b14a36ed9a25ad423cf" +checksum = "86afa4a88ee06b10fe1e6f28a796ba2eedd16804717cbbb911df0cbb0cd6677b" [[package]] name = "bevy_reflect" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7921f15fc944c9c8ad01d7dbcea6505b8909c6655cd9382bab1407181556038" +checksum = "133dfab8d403d0575eeed9084e85780bbb449dcf75dd687448439117789b40a2" dependencies = [ "bevy_math", "bevy_ptr", @@ -699,43 +700,42 @@ dependencies = [ "erased-serde", "glam", "serde", - "smallvec", "smol_str", "thiserror", ] [[package]] name = "bevy_reflect_derive" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a8c5475f216e751ef4452a1306b00711f33d2d04d9f149e4c845dfeb6753a0" +checksum = "ce1679a4dfdb2c9ff24ca590914c3cec119d7c9e1b56fa637776913acc030386" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "uuid", ] [[package]] name = "bevy_tasks" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fefa7fe0da8923525f7500e274f1bd60dbd79918a25cf7d0dfa0a6ba15c1cf" +checksum = "b20f243f6fc4c4ba10c2dbff891e947ddae947bb20b263f43e023558b35294bd" dependencies = [ "async-channel", "async-executor", "async-task", "concurrent-queue", - "futures-lite 1.13.0", + "futures-lite", "wasm-bindgen-futures", ] [[package]] name = "bevy_time" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6250d76eed3077128b6a3d004f9f198b01107800b9824051e32bb658054e837" +checksum = "9738901b6b251d2c9250542af7002d6f671401fc3b74504682697c5ec822f210" dependencies = [ "bevy_app", "bevy_ecs", @@ -747,31 +747,32 @@ dependencies = [ [[package]] name = "bevy_utils" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7915222f4a08ccc782e08d10b751b42e5f9d786e697d0cb3fd09333cb7e8b6ea" +checksum = "94a06aca1c1863606416b892f4c79e300dbc6211b6690953269051a431c2cca0" dependencies = [ "ahash", "bevy_utils_proc_macros", "getrandom", "hashbrown 0.14.3", - "instant", "nonmax", "petgraph", + "smallvec", "thiserror", "tracing", "uuid", + "web-time", ] [[package]] name = "bevy_utils_proc_macros" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aafecc952b6b8eb1a93c12590bd867d25df2f4ae1033a01dfdfc3c35ebccfff" +checksum = "31ae98e9c0c08b0f5c90e22cd713201f759b98d4fd570b99867a695f8641859a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -803,9 +804,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" [[package]] name = "byteorder" @@ -851,9 +852,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.32" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "num-traits", "serde", @@ -976,9 +977,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -1030,11 +1031,10 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] @@ -1062,12 +1062,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -1150,7 +1147,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1165,9 +1162,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eeb342678d785662fd2514be38c459bb925f02b68dd2a3e0f21d7ef82d979dd" +checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" dependencies = [ "anstream", "anstyle", @@ -1184,9 +1181,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.3.31" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" +checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" dependencies = [ "serde", ] @@ -1203,15 +1200,20 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.3" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "218a870470cce1469024e9fb66b901aa983929d81304a1cdb299f28118e550d5" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] [[package]] name = "event-listener" -version = "4.0.1" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712" +checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" dependencies = [ "concurrent-queue", "parking", @@ -1224,17 +1226,18 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.1", + "event-listener 4.0.2", "pin-project-lite", ] [[package]] -name = "fastrand" -version = "1.9.0" +name = "event-listener-strategy" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" dependencies = [ - "instant", + "event-listener 5.0.0", + "pin-project-lite", ] [[package]] @@ -1322,28 +1325,13 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-lite" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ - "fastrand 2.0.1", + "fastrand", "futures-core", "futures-io", "parking", @@ -1358,7 +1346,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1422,9 +1410,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glam" -version = "0.24.2" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5418c17512bdf42730f9032c74e1ae39afc408745ebb2acf72fbc4691c17945" +checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" dependencies = [ "bytemuck", "serde", @@ -1432,9 +1420,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.22" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -1442,7 +1430,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.1.0", + "indexmap 2.2.3", "slab", "tokio", "tokio-util", @@ -1480,9 +1468,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "http" @@ -1594,9 +1582,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -1611,18 +1599,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "ipnet" version = "2.9.0" @@ -1657,9 +1633,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -1675,9 +1651,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -1887,9 +1863,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -1986,7 +1962,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap 2.2.3", ] [[package]] @@ -2058,9 +2034,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "priority-queue" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff39edfcaec0d64e8d0da38564fad195d2d51b680940295fcc307366e101e61" +checksum = "a0bda9164fe05bc9225752d54aae413343c36f684380005398a6a8fde95fe785" dependencies = [ "autocfg", "indexmap 1.9.3", @@ -2151,7 +2127,7 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.4", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -2166,9 +2142,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -2189,9 +2165,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "base64", "bytes", @@ -2215,6 +2191,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls", @@ -2392,29 +2369,29 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -2502,7 +2479,7 @@ source = "git+https://github.com/azalea-rs/simdnbt#4594562ef0146431fd8c4405c753b dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2528,9 +2505,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" dependencies = [ "serde", ] @@ -2595,15 +2572,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -2627,22 +2610,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2692,9 +2675,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -2717,7 +2700,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2752,11 +2735,11 @@ checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" -version = "0.20.7" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.3", "toml_datetime", "winnow", ] @@ -2786,7 +2769,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2908,9 +2891,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -2973,12 +2956,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - [[package]] name = "walkdir" version = "2.4.0" @@ -3006,9 +2983,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3016,24 +2993,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -3043,9 +3020,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3053,28 +3030,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" dependencies = [ "js-sys", "wasm-bindgen", @@ -3251,9 +3238,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.31" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] @@ -3285,7 +3272,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] diff --git a/azalea-auth/Cargo.toml b/azalea-auth/Cargo.toml index 0d65b7e02..72612454f 100644 --- a/azalea-auth/Cargo.toml +++ b/azalea-auth/Cargo.toml @@ -12,22 +12,22 @@ version = "0.9.0" azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-crypto = { path = "../azalea-crypto", version = "0.9.0" } base64 = "0.21.7" -chrono = { version = "0.4.32", default-features = false, features = ["serde"] } +chrono = { version = "0.4.34", default-features = false, features = ["serde"] } tracing = "0.1.40" num-bigint = "0.4.4" once_cell = "1.19.0" -reqwest = { version = "0.11.23", default-features = false, features = [ +reqwest = { version = "0.11.24", default-features = false, features = [ "json", "rustls-tls", ] } rsa = "0.9.6" -serde = { version = "1.0.195", features = ["derive"] } -serde_json = "1.0.111" -thiserror = "1.0.56" -tokio = { version = "1.35.1", features = ["fs"] } +serde = { version = "1.0.196", features = ["derive"] } +serde_json = "1.0.113" +thiserror = "1.0.57" +tokio = { version = "1.36.0", features = ["fs"] } uuid = { version = "1.7.0", features = ["serde", "v3"] } md-5 = "0.10.6" [dev-dependencies] -env_logger = "0.11.0" -tokio = { version = "1.35.1", features = ["full"] } +env_logger = "0.11.2" +tokio = { version = "1.36.0", features = ["full"] } diff --git a/azalea-block/azalea-block-macros/Cargo.toml b/azalea-block/azalea-block-macros/Cargo.toml index 97f1767f0..7489a93ea 100644 --- a/azalea-block/azalea-block-macros/Cargo.toml +++ b/azalea-block/azalea-block-macros/Cargo.toml @@ -14,4 +14,4 @@ proc-macro = true [dependencies] proc-macro2 = "1.0.78" quote = "1.0.35" -syn = "2.0.48" +syn = "2.0.49" diff --git a/azalea-buf/Cargo.toml b/azalea-buf/Cargo.toml index 31a1b4643..eb4325802 100644 --- a/azalea-buf/Cargo.toml +++ b/azalea-buf/Cargo.toml @@ -14,7 +14,7 @@ azalea-buf-macros = { path = "./azalea-buf-macros", version = "0.9.0" } byteorder = "^1.5.0" tracing = "0.1.40" serde_json = { version = "^1.0", optional = true } -thiserror = "1.0.56" +thiserror = "1.0.57" uuid = "^1.7.0" [features] diff --git a/azalea-buf/azalea-buf-macros/Cargo.toml b/azalea-buf/azalea-buf-macros/Cargo.toml index 1fc322941..0bef0aca2 100644 --- a/azalea-buf/azalea-buf-macros/Cargo.toml +++ b/azalea-buf/azalea-buf-macros/Cargo.toml @@ -13,4 +13,4 @@ proc-macro = true [dependencies] proc-macro2 = "^1.0.78" quote = "^1.0.35" -syn = { version = "^2.0.48", features = ["extra-traits"] } +syn = { version = "^2.0.49", features = ["extra-traits"] } diff --git a/azalea-chat/Cargo.toml b/azalea-chat/Cargo.toml index b9e8f697b..2536bfaa7 100644 --- a/azalea-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -23,5 +23,5 @@ simdnbt = { version = "0.4", optional = true, git = "https://github.com/azalea-r tracing = "0.1.40" once_cell = "1.19.0" serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0.111" +serde_json = "^1.0.113" azalea-registry = { path = "../azalea-registry", version = "0.9.0", optional = true } diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index 37e450acf..cbf2b1deb 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -10,7 +10,7 @@ version = "0.9.0" [dependencies] simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } -reqwest = { version = "0.11.23", default-features = false } +reqwest = { version = "0.11.24", default-features = false } anyhow = "1.0.79" async-trait = "0.1.77" azalea-auth = { path = "../azalea-auth", version = "0.9.0" } @@ -23,11 +23,11 @@ azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-protocol = { path = "../azalea-protocol", version = "0.9.0" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } azalea-world = { path = "../azalea-world", version = "0.9.0" } -bevy_app = "0.12.1" -bevy_ecs = "0.12.1" -bevy_log = { version = "0.12.1", optional = true } -bevy_tasks = "0.12.1" -bevy_time = "0.12.1" +bevy_app = "0.13.0" +bevy_ecs = "0.13.0" +bevy_log = { version = "0.13.0", optional = true } +bevy_tasks = "0.13.0" +bevy_time = "0.13.0" azalea-inventory = { path = "../azalea-inventory", version = "0.9.0" } derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } futures = "0.3.30" @@ -36,12 +36,12 @@ nohash-hasher = "0.2.0" once_cell = "1.19.0" parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } regex = "1.10.3" -thiserror = "^1.0.56" -tokio = { version = "^1.35.1", features = ["sync"] } +thiserror = "^1.0.57" +tokio = { version = "^1.36.0", features = ["sync"] } uuid = "^1.7.0" azalea-entity = { version = "0.9.0", path = "../azalea-entity" } -serde_json = "1.0.111" -serde = "1.0.195" +serde_json = "1.0.113" +serde = "1.0.196" minecraft_folder_path = "0.1.2" [features] diff --git a/azalea-client/src/entity_query.rs b/azalea-client/src/entity_query.rs index 42b7b0cac..be892ee56 100644 --- a/azalea-client/src/entity_query.rs +++ b/azalea-client/src/entity_query.rs @@ -3,7 +3,8 @@ use std::sync::Arc; use bevy_ecs::{ component::Component, entity::Entity, - query::{ROQueryItem, ReadOnlyWorldQuery, WorldQuery}, + query::QueryData, + query::{QueryFilter, ROQueryItem}, world::World, }; use parking_lot::Mutex; @@ -22,13 +23,13 @@ impl Client { /// .is_some(); /// # } /// ``` - pub fn query<'w, Q: WorldQuery>(&self, ecs: &'w mut World) -> ::Item<'w> { - ecs.query::() + pub fn query<'w, D: QueryData>(&self, ecs: &'w mut World) -> D::Item<'w> { + ecs.query::() .get_mut(ecs, self.entity) .unwrap_or_else(|_| { panic!( "Our client is missing a required component {:?}", - std::any::type_name::() + std::any::type_name::() ) }) } @@ -58,7 +59,7 @@ impl Client { /// ``` /// /// [`Entity`]: bevy_ecs::entity::Entity - pub fn entity_by( + pub fn entity_by( &mut self, predicate: impl EntityPredicate, ) -> Option { @@ -93,14 +94,14 @@ impl Client { } } -pub trait EntityPredicate { +pub trait EntityPredicate { fn find(&self, ecs_lock: Arc>) -> Option; } impl EntityPredicate for F where F: Fn(&ROQueryItem) -> bool, - Q: ReadOnlyWorldQuery, - Filter: ReadOnlyWorldQuery, + Q: QueryData, + Filter: QueryFilter, { fn find(&self, ecs_lock: Arc>) -> Option { let mut ecs = ecs_lock.lock(); @@ -114,8 +115,8 @@ where // impl<'a, F, Q1, Q2> EntityPredicate<'a, (Q1, Q2)> for F // where // F: Fn(&::Item<'_>, &::Item<'_>) -> -// bool, Q1: ReadOnlyWorldQuery, -// Q2: ReadOnlyWorldQuery, +// bool, Q1: QueryFilter, +// Q2: QueryFilter, // { // fn find(&self, ecs: &mut Ecs) -> Option { // // (self)(query) diff --git a/azalea-client/src/interact.rs b/azalea-client/src/interact.rs index 026e94caa..8a3aa49b5 100644 --- a/azalea-client/src/interact.rs +++ b/azalea-client/src/interact.rs @@ -156,7 +156,7 @@ pub fn handle_block_interact_event( sequence: sequence_number.0, } .get(), - }) + }); } } diff --git a/azalea-client/src/inventory.rs b/azalea-client/src/inventory.rs index bf421bf4d..4bfed69f2 100644 --- a/azalea-client/src/inventory.rs +++ b/azalea-client/src/inventory.rs @@ -708,7 +708,7 @@ pub fn handle_container_click_event( carried_item: inventory.carried.clone(), } .get(), - }) + }); } } diff --git a/azalea-client/src/mining.rs b/azalea-client/src/mining.rs index d2e66ca84..f0b86db19 100644 --- a/azalea-client/src/mining.rs +++ b/azalea-client/src/mining.rs @@ -253,7 +253,7 @@ fn handle_start_mining_block_with_direction_event( entity: event.entity, position: event.position, destroy_stage: mine_progress.destroy_stage(), - }) + }); } send_packet_events.send(SendPacketEvent { @@ -572,7 +572,7 @@ fn continue_mining_block( entity, position: mining.pos, direction: mining.dir, - }) + }); } swing_arm_events.send(SwingArmEvent { entity }); diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index 91a3c835e..080ef2701 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -1176,7 +1176,7 @@ pub fn process_packet_events(ecs: &mut World) { let mut client_side_close_container_events = system_state.get_mut(ecs); client_side_close_container_events.send(ClientSideCloseContainerEvent { entity: player_entity, - }) + }); } ClientboundGamePacket::Cooldown(_) => {} ClientboundGamePacket::CustomChatCompletions(_) => {} @@ -1225,7 +1225,7 @@ pub fn process_packet_events(ecs: &mut World) { window_id: p.container_id, menu_type: p.menu_type, title: p.title.to_owned(), - }) + }); } ClientboundGamePacket::OpenSignEditor(_) => {} ClientboundGamePacket::Ping(p) => { diff --git a/azalea-core/Cargo.toml b/azalea-core/Cargo.toml index e82c14703..d294b755b 100644 --- a/azalea-core/Cargo.toml +++ b/azalea-core/Cargo.toml @@ -13,12 +13,12 @@ simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } -bevy_ecs = { version = "0.12.1", default-features = false, optional = true } +bevy_ecs = { version = "0.13.0", default-features = false, optional = true } nohash-hasher = "0.2.0" -num-traits = "0.2.17" +num-traits = "0.2.18" serde = { version = "^1.0", optional = true } uuid = "^1.7.0" -serde_json = "^1.0.111" +serde_json = "^1.0.113" tracing = "0.1.40" [features] diff --git a/azalea-crypto/Cargo.toml b/azalea-crypto/Cargo.toml index a2b2834b3..04423f2a6 100644 --- a/azalea-crypto/Cargo.toml +++ b/azalea-crypto/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/azalea-rs/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.3" +aes = "0.8.4" azalea-buf = { path = "../azalea-buf", version = "0.9.0" } cfb8 = "0.8.1" num-bigint = "^0.4.4" diff --git a/azalea-entity/Cargo.toml b/azalea-entity/Cargo.toml index fde1cbf34..c35323bbf 100644 --- a/azalea-entity/Cargo.toml +++ b/azalea-entity/Cargo.toml @@ -19,12 +19,12 @@ azalea-core = { version = "0.9.0", path = "../azalea-core" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { version = "0.9.0", path = "../azalea-registry" } azalea-world = { version = "0.9.0", path = "../azalea-world" } -bevy_app = "0.12.1" -bevy_ecs = "0.12.1" +bevy_app = "0.13.0" +bevy_ecs = "0.13.0" derive_more = "0.99.17" enum-as-inner = "0.6.0" tracing = "0.1.40" nohash-hasher = "0.2.0" parking_lot = "0.12.1" -thiserror = "1.0.56" +thiserror = "1.0.57" uuid = "1.7.0" diff --git a/azalea-inventory/azalea-inventory-macros/Cargo.toml b/azalea-inventory/azalea-inventory-macros/Cargo.toml index afdfe3979..f3c406909 100644 --- a/azalea-inventory/azalea-inventory-macros/Cargo.toml +++ b/azalea-inventory/azalea-inventory-macros/Cargo.toml @@ -14,4 +14,4 @@ proc-macro = true [dependencies] proc-macro2 = "1.0.78" quote = "1.0.35" -syn = "2.0.48" +syn = "2.0.49" diff --git a/azalea-language/Cargo.toml b/azalea-language/Cargo.toml index c2a363ddc..3ffa1f1c8 100644 --- a/azalea-language/Cargo.toml +++ b/azalea-language/Cargo.toml @@ -11,5 +11,5 @@ version = "0.9.0" [dependencies] once_cell = "1.19.0" serde = "^1.0" -serde_json = "^1.0.111" +serde_json = "^1.0.113" # tokio = {version = "^1.21.2", features = ["fs"]} diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index dfadc9c53..340dc096e 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -15,12 +15,12 @@ azalea-entity = { version = "0.9.0", path = "../azalea-entity" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } azalea-world = { path = "../azalea-world", version = "0.9.0" } -bevy_app = "0.12.1" -bevy_ecs = "0.12.1" +bevy_app = "0.13.0" +bevy_ecs = "0.13.0" tracing = "0.1.40" once_cell = "1.19.0" parking_lot = "^0.12.1" [dev-dependencies] -bevy_time = "0.12.1" +bevy_time = "0.13.0" uuid = "^1.7.0" diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 080740b2e..d80255898 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -29,7 +29,7 @@ azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-protocol-macros = { path = "./azalea-protocol-macros", version = "0.9.0" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } azalea-world = { path = "../azalea-world", version = "0.9.0" } -bevy_ecs = { version = "0.12.1", default-features = false } +bevy_ecs = { version = "0.13.0", default-features = false } byteorder = "^1.5.0" bytes = "^1.5.0" flate2 = "1.0.28" @@ -38,9 +38,9 @@ futures-lite = "2.2.0" futures-util = "0.3.30" tracing = "0.1.40" serde = { version = "^1.0", features = ["serde_derive"] } -serde_json = "^1.0.111" -thiserror = "1.0.56" -tokio = { version = "^1.35.1", features = ["io-util", "net", "macros"] } +serde_json = "^1.0.113" +thiserror = "1.0.57" +tokio = { version = "^1.36.0", features = ["io-util", "net", "macros"] } tokio-util = { version = "0.7.10", features = ["codec"] } trust-dns-resolver = { version = "^0.23.2", default-features = false, features = [ "tokio-runtime", diff --git a/azalea-protocol/azalea-protocol-macros/Cargo.toml b/azalea-protocol/azalea-protocol-macros/Cargo.toml index 7d4bb3e26..f37ca2ab1 100644 --- a/azalea-protocol/azalea-protocol-macros/Cargo.toml +++ b/azalea-protocol/azalea-protocol-macros/Cargo.toml @@ -13,4 +13,4 @@ proc-macro = true [dependencies] proc-macro2 = "^1.0.78" quote = "^1.0.35" -syn = "^2.0.48" +syn = "^2.0.49" diff --git a/azalea-registry/azalea-registry-macros/Cargo.toml b/azalea-registry/azalea-registry-macros/Cargo.toml index 56d63bf96..cb07e2f70 100644 --- a/azalea-registry/azalea-registry-macros/Cargo.toml +++ b/azalea-registry/azalea-registry-macros/Cargo.toml @@ -14,7 +14,7 @@ proc-macro = true [dependencies] proc-macro2 = "1.0.78" quote = "1.0.35" -syn = "2.0.48" +syn = "2.0.49" [features] serde = [] diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index e69b4b971..b2d9b9df8 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -17,17 +17,17 @@ azalea-core = { path = "../azalea-core", version = "0.9.0", features = [ ] } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } -bevy_ecs = "0.12.1" +bevy_ecs = "0.13.0" derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } enum-as-inner = "0.6.0" tracing = "0.1.40" nohash-hasher = "0.2.0" once_cell = "1.19.0" parking_lot = "^0.12.1" -thiserror = "1.0.56" +thiserror = "1.0.57" uuid = "1.7.0" -serde_json = "1.0.111" -serde = "1.0.195" +serde_json = "1.0.113" +serde = "1.0.196" [dev-dependencies] azalea-client = { path = "../azalea-client" } diff --git a/azalea/Cargo.toml b/azalea/Cargo.toml index 41803928a..8a11fc463 100644 --- a/azalea/Cargo.toml +++ b/azalea/Cargo.toml @@ -26,23 +26,23 @@ azalea-world = { version = "0.9.0", path = "../azalea-world" } azalea-auth = { version = "0.9.0", path = "../azalea-auth" } azalea-brigadier = { version = "0.9.0", path = "../azalea-brigadier" } azalea-buf = { version = "0.9.0", path = "../azalea-buf" } -bevy_app = "0.12.1" -bevy_ecs = "0.12.1" -bevy_tasks = { version = "0.12.1", features = ["multi-threaded"] } +bevy_app = "0.13.0" +bevy_ecs = "0.13.0" +bevy_tasks = { version = "0.13.0", features = ["multi-threaded"] } derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } futures = "0.3.30" futures-lite = "2.2.0" tracing = "0.1.40" nohash-hasher = "0.2.0" -num-traits = "0.2.17" +num-traits = "0.2.18" parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } -priority-queue = "1.3.2" -thiserror = "^1.0.56" -tokio = "^1.35.1" +priority-queue = "1.4.0" +thiserror = "^1.0.57" +tokio = "^1.36.0" uuid = "1.7.0" -bevy_log = "0.12.1" +bevy_log = "0.13.0" azalea-entity = { version = "0.9.0", path = "../azalea-entity" } -bevy_time = "0.12.1" +bevy_time = "0.13.0" rustc-hash = "1.1.0" [dev-dependencies] diff --git a/azalea/src/nearest_entity.rs b/azalea/src/nearest_entity.rs index 38c9886ea..363c8fb08 100644 --- a/azalea/src/nearest_entity.rs +++ b/azalea/src/nearest_entity.rs @@ -2,7 +2,7 @@ use azalea_entity::Position; use azalea_world::{InstanceName, MinecraftEntityId}; use bevy_ecs::{ prelude::Entity, - query::{ReadOnlyWorldQuery, With}, + query::{QueryFilter, With}, system::{Query, SystemParam}, }; @@ -44,7 +44,7 @@ use bevy_ecs::{ #[derive(SystemParam)] pub struct EntityFinder<'w, 's, F = ()> where - F: ReadOnlyWorldQuery + 'static, + F: QueryFilter + 'static, { all_entities: Query<'w, 's, (&'static Position, &'static InstanceName), With>, @@ -59,7 +59,7 @@ where impl<'w, 's, 'a, F> EntityFinder<'w, 's, F> where - F: ReadOnlyWorldQuery + 'static, + F: QueryFilter + 'static, { /// Gets the nearest entity to the given position and world instance name. /// This method will return `None` if there are no entities within range. If diff --git a/azalea/src/pathfinder/world.rs b/azalea/src/pathfinder/world.rs index a5a273fb2..d3c94a52c 100644 --- a/azalea/src/pathfinder/world.rs +++ b/azalea/src/pathfinder/world.rs @@ -157,9 +157,7 @@ impl CachedWorld { } let world = self.world_lock.read(); - let Some(chunk) = world.chunks.get(&chunk_pos) else { - return None; - }; + let chunk = world.chunks.get(&chunk_pos)?; let chunk = chunk.read(); let sections: Vec = chunk From e08f2d842b7e4aad4e63a83bb9b30e53330d6139 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sun, 18 Feb 2024 01:28:46 -0600 Subject: [PATCH 14/37] fix image in readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a110e76e7..70fa2b18c 100755 --- a/README.md +++ b/README.md @@ -5,9 +5,10 @@ A collection of Rust crates for making Minecraft bots, clients, and tools.

- Azalea + Azalea

+ _Currently supported Minecraft version: `1.20.4`._ From 69f7eebcb300bbefdc8b10c191a09db250bde630 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 18 Feb 2024 02:25:20 -0600 Subject: [PATCH 15/37] fix for hypixel (wasn't sending ClientInformation on configuration) --- azalea-client/src/client.rs | 27 +++------- azalea-client/src/configuration.rs | 53 +++++++++++++++++++ azalea-client/src/lib.rs | 1 + .../src/packet_handling/configuration.rs | 26 ++++++++- azalea-client/src/packet_handling/mod.rs | 14 ++++- 5 files changed, 98 insertions(+), 23 deletions(-) create mode 100644 azalea-client/src/configuration.rs diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 2dec635d3..af5354159 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -2,6 +2,7 @@ use crate::{ attack::{self, AttackPlugin}, chat::ChatPlugin, chunks::{ChunkBatchInfo, ChunkPlugin}, + configuration::ConfigurationPlugin, disconnect::{DisconnectEvent, DisconnectPlugin}, events::{Event, EventPlugin, LocalPlayerEvents}, interact::{CurrentSequenceNumber, InteractPlugin}, @@ -13,7 +14,6 @@ use crate::{ mining::{self, MinePlugin}, movement::{LastSentLookDirection, PhysicsState, PlayerMovePlugin}, packet_handling::{ - game::{handle_send_packet_event, SendPacketEvent}, login::{self, LoginSendPacketQueue}, PacketHandlerPlugin, }, @@ -25,9 +25,8 @@ use crate::{ }; use azalea_auth::{game_profile::GameProfile, sessionserver::ClientSessionServerError}; -use azalea_buf::McBufWritable; use azalea_chat::FormattedText; -use azalea_core::{position::Vec3, resource_location::ResourceLocation, tick::GameTick}; +use azalea_core::{position::Vec3, tick::GameTick}; use azalea_entity::{ indexing::{EntityIdIndex, EntityUuidIndex}, metadata::Health, @@ -39,7 +38,6 @@ use azalea_protocol::{ packets::{ configuration::{ serverbound_client_information_packet::ClientInformation, - serverbound_custom_payload_packet::ServerboundCustomPayloadPacket, ClientboundConfigurationPacket, ServerboundConfigurationPacket, }, game::ServerboundGamePacket, @@ -242,23 +240,11 @@ impl Client { }; let conn = Connection::new(resolved_address).await?; - let (mut conn, game_profile) = + let (conn, game_profile) = Self::handshake(ecs_lock.clone(), entity, conn, account, address).await?; - { - // quickly send the brand here - let mut brand_data = Vec::new(); - // they don't have to know :) - "vanilla".write_into(&mut brand_data).unwrap(); - conn.write( - ServerboundCustomPayloadPacket { - identifier: ResourceLocation::new("brand"), - data: brand_data.into(), - } - .get(), - ) - .await?; - } + // note that we send the proper packets in + // crate::configuration::handle_in_configuration_state let (read_conn, write_conn) = conn.into_split(); let (read_conn, write_conn) = (read_conn.raw, write_conn.raw); @@ -678,10 +664,8 @@ impl Plugin for AzaleaPlugin { 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::() .init_resource::(); } @@ -838,6 +822,7 @@ impl PluginGroup for DefaultPlugins { .add(MinePlugin) .add(AttackPlugin) .add(ChunkPlugin) + .add(ConfigurationPlugin) .add(TickBroadcastPlugin); #[cfg(feature = "log")] { diff --git a/azalea-client/src/configuration.rs b/azalea-client/src/configuration.rs new file mode 100644 index 000000000..21e31b24b --- /dev/null +++ b/azalea-client/src/configuration.rs @@ -0,0 +1,53 @@ +use azalea_buf::McBufWritable; +use azalea_core::resource_location::ResourceLocation; +use azalea_protocol::packets::configuration::{ + serverbound_client_information_packet::{ + ClientInformation, ServerboundClientInformationPacket, + }, + serverbound_custom_payload_packet::ServerboundCustomPayloadPacket, +}; +use bevy_app::prelude::*; +use bevy_ecs::prelude::*; + +use crate::{ + client::InConfigurationState, packet_handling::configuration::SendConfigurationPacketEvent, +}; + +pub struct ConfigurationPlugin; +impl Plugin for ConfigurationPlugin { + fn build(&self, app: &mut App) { + app.add_systems( + Update, + handle_in_configuration_state + .after(crate::packet_handling::configuration::handle_send_packet_event), + ); + } +} + +fn handle_in_configuration_state( + query: Query<(Entity, &ClientInformation), Added>, + mut send_packet_events: EventWriter, +) { + for (entity, client_information) in query.iter() { + // quickly send the brand here + let mut brand_data = Vec::new(); + // they don't have to know :) + "vanilla".write_into(&mut brand_data).unwrap(); + send_packet_events.send(SendConfigurationPacketEvent { + entity, + packet: ServerboundCustomPayloadPacket { + identifier: ResourceLocation::new("brand"), + data: brand_data.into(), + } + .get(), + }); + + send_packet_events.send(SendConfigurationPacketEvent { + entity, + packet: ServerboundClientInformationPacket { + information: client_information.clone(), + } + .get(), + }); + } +} diff --git a/azalea-client/src/lib.rs b/azalea-client/src/lib.rs index 1eaf46057..41399ce97 100644 --- a/azalea-client/src/lib.rs +++ b/azalea-client/src/lib.rs @@ -13,6 +13,7 @@ pub mod attack; pub mod chat; pub mod chunks; mod client; +pub mod configuration; pub mod disconnect; mod entity_query; mod events; diff --git a/azalea-client/src/packet_handling/configuration.rs b/azalea-client/src/packet_handling/configuration.rs index ddf77a52f..da5ce57fe 100644 --- a/azalea-client/src/packet_handling/configuration.rs +++ b/azalea-client/src/packet_handling/configuration.rs @@ -6,7 +6,9 @@ use azalea_protocol::packets::configuration::serverbound_finish_configuration_pa use azalea_protocol::packets::configuration::serverbound_keep_alive_packet::ServerboundKeepAlivePacket; use azalea_protocol::packets::configuration::serverbound_pong_packet::ServerboundPongPacket; use azalea_protocol::packets::configuration::serverbound_resource_pack_packet::ServerboundResourcePackPacket; -use azalea_protocol::packets::configuration::ClientboundConfigurationPacket; +use azalea_protocol::packets::configuration::{ + ClientboundConfigurationPacket, ServerboundConfigurationPacket, +}; use azalea_protocol::packets::ConnectionProtocol; use azalea_protocol::read::deserialize_packet; use azalea_world::Instance; @@ -201,3 +203,25 @@ pub fn process_packet_events(ecs: &mut World) { } } } + +/// An event for sending a packet to the server while we're in the +/// `configuration` state. +#[derive(Event)] +pub struct SendConfigurationPacketEvent { + pub entity: Entity, + pub packet: ServerboundConfigurationPacket, +} + +pub fn handle_send_packet_event( + mut send_packet_events: EventReader, + mut query: Query<&mut RawConnection>, +) { + for event in send_packet_events.read() { + if let Ok(raw_connection) = query.get_mut(event.entity) { + // debug!("Sending packet: {:?}", event.packet); + if let Err(e) = raw_connection.write_packet(event.packet.clone()) { + error!("Failed to send packet: {e}"); + } + } + } +} diff --git a/azalea-client/src/packet_handling/mod.rs b/azalea-client/src/packet_handling/mod.rs index 9823035d3..19de27eb5 100644 --- a/azalea-client/src/packet_handling/mod.rs +++ b/azalea-client/src/packet_handling/mod.rs @@ -49,10 +49,22 @@ impl Plugin for PacketHandlerPlugin { login::process_packet_events, ), ) - .add_systems(Update, death_event_on_0_health.before(death_listener)) + .add_systems( + Update, + ( + ( + configuration::handle_send_packet_event, + game::handle_send_packet_event, + ) + .chain(), + death_event_on_0_health.before(death_listener), + ), + ) // we do this instead of add_event so we can handle the events ourselves .init_resource::>() .init_resource::>() + .add_event::() + .add_event::() .add_event::() .add_event::() .add_event::() From 038807e607c55757b3d9a9d51f0b9e65a781772b Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 22 Feb 2024 22:41:54 -0600 Subject: [PATCH 16/37] fix for hypixel limbo --- azalea-block/azalea-block-macros/src/lib.rs | 2 +- azalea-buf/azalea-buf-macros/src/lib.rs | 2 +- azalea-buf/azalea-buf-macros/src/read.rs | 2 +- azalea-buf/azalea-buf-macros/src/write.rs | 2 +- azalea-client/src/configuration.rs | 1 - azalea-client/src/local_player.rs | 2 +- .../azalea-inventory-macros/src/lib.rs | 2 +- .../src/parse_macro.rs | 2 +- azalea-physics/src/collision/mergers.rs | 2 +- azalea-physics/src/lib.rs | 3 +- .../azalea-protocol-macros/src/lib.rs | 2 +- azalea-protocol/examples/handshake_proxy.rs | 2 +- ...ientbound_level_chunk_with_light_packet.rs | 66 ++++++++++--------- .../clientbound_update_advancements_packet.rs | 2 - azalea-protocol/src/read.rs | 7 +- .../azalea-registry-macros/src/lib.rs | 2 +- azalea-world/src/bit_storage.rs | 3 +- azalea-world/src/chunk_storage.rs | 5 +- azalea-world/src/palette.rs | 32 +++++++-- azalea/benches/pathfinder.rs | 3 +- azalea/examples/testbot/commands.rs | 1 - azalea/examples/testbot/main.rs | 6 +- azalea/src/pathfinder/world.rs | 4 -- 23 files changed, 89 insertions(+), 66 deletions(-) diff --git a/azalea-block/azalea-block-macros/src/lib.rs b/azalea-block/azalea-block-macros/src/lib.rs index 3b983fb43..427da03b4 100755 --- a/azalea-block/azalea-block-macros/src/lib.rs +++ b/azalea-block/azalea-block-macros/src/lib.rs @@ -8,7 +8,7 @@ use quote::quote; use std::collections::HashMap; use std::fmt::Write; use syn::{ - self, braced, + braced, ext::IdentExt, parenthesized, parse::{Parse, ParseStream, Result}, diff --git a/azalea-buf/azalea-buf-macros/src/lib.rs b/azalea-buf/azalea-buf-macros/src/lib.rs index 4089b4b7a..4d17daa6d 100755 --- a/azalea-buf/azalea-buf-macros/src/lib.rs +++ b/azalea-buf/azalea-buf-macros/src/lib.rs @@ -3,7 +3,7 @@ mod write; use proc_macro::TokenStream; use quote::quote; -use syn::{self, parse_macro_input, DeriveInput}; +use syn::{parse_macro_input, DeriveInput}; #[proc_macro_derive(McBufReadable, attributes(var))] pub fn derive_mcbufreadable(input: TokenStream) -> TokenStream { diff --git a/azalea-buf/azalea-buf-macros/src/read.rs b/azalea-buf/azalea-buf-macros/src/read.rs index 010c7f57f..c3e9595c7 100644 --- a/azalea-buf/azalea-buf-macros/src/read.rs +++ b/azalea-buf/azalea-buf-macros/src/read.rs @@ -1,5 +1,5 @@ use quote::{quote, ToTokens}; -use syn::{self, punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident}; +use syn::{punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident}; fn read_named_fields( named: &Punctuated, diff --git a/azalea-buf/azalea-buf-macros/src/write.rs b/azalea-buf/azalea-buf-macros/src/write.rs index bc493f382..35c2d49a1 100644 --- a/azalea-buf/azalea-buf-macros/src/write.rs +++ b/azalea-buf/azalea-buf-macros/src/write.rs @@ -1,6 +1,6 @@ use proc_macro2::Span; use quote::{quote, ToTokens}; -use syn::{self, punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident}; +use syn::{punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident}; fn write_named_fields( named: &Punctuated, diff --git a/azalea-client/src/configuration.rs b/azalea-client/src/configuration.rs index 21e31b24b..99b97f60d 100644 --- a/azalea-client/src/configuration.rs +++ b/azalea-client/src/configuration.rs @@ -29,7 +29,6 @@ fn handle_in_configuration_state( mut send_packet_events: EventWriter, ) { for (entity, client_information) in query.iter() { - // quickly send the brand here let mut brand_data = Vec::new(); // they don't have to know :) "vanilla".write_into(&mut brand_data).unwrap(); diff --git a/azalea-client/src/local_player.rs b/azalea-client/src/local_player.rs index 3b3ae89b3..b0582d8ba 100644 --- a/azalea-client/src/local_player.rs +++ b/azalea-client/src/local_player.rs @@ -5,7 +5,7 @@ use azalea_core::game_type::GameMode; use azalea_entity::Dead; use azalea_protocol::packets::game::clientbound_player_abilities_packet::ClientboundPlayerAbilitiesPacket; use azalea_world::{Instance, PartialInstance}; -use bevy_ecs::{component::Component, entity::Entity, prelude::*, query::Added, system::Query}; +use bevy_ecs::{component::Component, prelude::*}; use derive_more::{Deref, DerefMut}; use parking_lot::RwLock; use thiserror::Error; diff --git a/azalea-inventory/azalea-inventory-macros/src/lib.rs b/azalea-inventory/azalea-inventory-macros/src/lib.rs index d3faa0917..e39f1bc67 100644 --- a/azalea-inventory/azalea-inventory-macros/src/lib.rs +++ b/azalea-inventory/azalea-inventory-macros/src/lib.rs @@ -8,7 +8,7 @@ use parse_macro::{DeclareMenus, Field}; use proc_macro::TokenStream; use proc_macro2::Span; use quote::quote; -use syn::{self, parse_macro_input, Ident}; +use syn::{parse_macro_input, Ident}; #[proc_macro] pub fn declare_menus(input: TokenStream) -> TokenStream { diff --git a/azalea-inventory/azalea-inventory-macros/src/parse_macro.rs b/azalea-inventory/azalea-inventory-macros/src/parse_macro.rs index 6aafe16f9..20c2ddc30 100644 --- a/azalea-inventory/azalea-inventory-macros/src/parse_macro.rs +++ b/azalea-inventory/azalea-inventory-macros/src/parse_macro.rs @@ -1,5 +1,5 @@ use syn::{ - self, braced, + braced, parse::{Parse, ParseStream, Result}, Ident, LitInt, Token, }; diff --git a/azalea-physics/src/collision/mergers.rs b/azalea-physics/src/collision/mergers.rs index 5744084e6..69ae2ab57 100755 --- a/azalea-physics/src/collision/mergers.rs +++ b/azalea-physics/src/collision/mergers.rs @@ -1,4 +1,4 @@ -use std::{cmp::Ordering, convert::TryInto}; +use std::cmp::Ordering; use super::CubePointRange; use azalea_core::math::{gcd, lcm, EPSILON}; diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index 55f54ccd3..ed813b569 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -424,10 +424,9 @@ fn jump_boost_power() -> f64 { mod tests { use super::*; - use azalea_core::{position::ChunkPos, resource_location::ResourceLocation, tick::GameTick}; + use azalea_core::{position::ChunkPos, resource_location::ResourceLocation}; use azalea_entity::{EntityBundle, EntityPlugin}; use azalea_world::{Chunk, MinecraftEntityId, PartialInstance}; - use bevy_app::App; use uuid::Uuid; /// You need an app to spawn entities in the world and do updates. diff --git a/azalea-protocol/azalea-protocol-macros/src/lib.rs b/azalea-protocol/azalea-protocol-macros/src/lib.rs index ffecc13a7..0c072b849 100755 --- a/azalea-protocol/azalea-protocol-macros/src/lib.rs +++ b/azalea-protocol/azalea-protocol-macros/src/lib.rs @@ -1,7 +1,7 @@ use proc_macro::TokenStream; use quote::quote; use syn::{ - self, braced, + braced, parse::{Parse, ParseStream, Result}, parse_macro_input, DeriveInput, Ident, LitInt, Token, }; diff --git a/azalea-protocol/examples/handshake_proxy.rs b/azalea-protocol/examples/handshake_proxy.rs index e63e8197c..a7ac67c74 100644 --- a/azalea-protocol/examples/handshake_proxy.rs +++ b/azalea-protocol/examples/handshake_proxy.rs @@ -40,7 +40,7 @@ static PROXY_FAVICON: Lazy> = Lazy::new(|| None); static PROXY_VERSION: Lazy = Lazy::new(|| Version { name: "1.19.3".to_string(), - protocol: PROTOCOL_VERSION as i32, + protocol: PROTOCOL_VERSION, }); const PROXY_PLAYERS: Players = Players { diff --git a/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs b/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs index f8927ca42..f7212ba7c 100755 --- a/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs @@ -28,33 +28,39 @@ pub struct BlockEntity { pub data: Nbt, } -// Compound(NbtCompound { -// inner: [("", Compound(NbtCompound { -// inner: [ -// ("MOTION_BLOCKING", LongArray([2310355422147575936, -// 2292305770412047999, 2310355422147575423, 2292305770412310656, -// 2310355422013095551, 2292305839266005120, 2310320168921529983, -// 2310355422147575936, 2292305770412048512, 2310355422147575935, -// 2292305839266005120, 2310355422147313279, 2292305770546528384, -// 2310355353293618815, 2292305839266005120, 2292305770412047999, -// 2310355422147575936, 2292305770412047999, 2310355422147575423, -// 2292305770412048512, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 17079008895])), -// ("WORLD_SURFACE", LongArray([2310355422147575936, -// 2292340954784136831, 2310355422147575423, 2292305770412310656, -// 2310355422013095551, 2292305839266005120, 2310320168921529983, -// 2310355422147575936, 2292305770412048512, 2310355422147575935, -// 2292305839266005120, 2310355422147313279, 2292305770546528384, -// 2310355353293618815, 2292305839266005120, 2292305770412047999, -// 2310355422147575936, 2292305770412047999, 2310355422147575423, -// 2292305770412048512, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 2292305770412047999, -// 2292305770412047999, 2292305770412047999, 17079008895]))] }))] -// }) +#[cfg(test)] +mod tests { + use std::{io::Cursor, ops::Deref}; + + use azalea_buf::McBufReadable; + use azalea_world::Chunk; + use simdnbt::owned::BaseNbt; + + use super::*; + + #[test] + fn test_clientbound_level_chunk_with_light_packet() { + #[rustfmt::skip] + let bytes = [ + 255, 255, 255, 253, 0, 0, 0, 1, 10, 12, 0, 15, 77, 79, 84, 73, 79, 78, 95, 66, 76, 79, 67, 75, 73, 78, 71, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 240, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 195, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,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 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 16, 50, 84, 118, 152, 186, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 16, 50, 84, 118, 152, 186, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 16, 50, 84, 118, 152, 186, 0, 0, 33, 67, 101, 135, 169, 203, 0, 0, 16, 50, 84, 118, 152, 186, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 16, 50, 84, 118, 152, 186, 0, 0, 33, 67, 101, 135, 169, 203, 0, 0, 16, 50, 84, 118, 152, 186, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 16, 50, 84, 118, 152, 186, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 16, 50, 84, 118, 152, 186, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 33, 67, 101, 135, 169, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 16, 50, 84, 118, 152, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 33, 67, 101, 135, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 16, 50, 84, 118, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 16, 50, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0, 0, 33, 67, 101, 0, 0, 0, 0, 0, 16, 50, 84, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ]; + + let packet = + ClientboundLevelChunkWithLightPacket::read_from(&mut Cursor::new(&bytes)).unwrap(); + + let heightmaps_nbt = &packet.chunk_data.heightmaps; + // necessary to make the unwrap_or work + let empty_nbt = BaseNbt::default(); + let heightmaps = heightmaps_nbt.unwrap_or(&empty_nbt).deref(); + + let chunk = Chunk::read_with_dimension_height( + &mut Cursor::new(&packet.chunk_data.data), + 256, + 0, + heightmaps, + ) + .unwrap(); + + assert_eq!(chunk.sections.len(), 16); + } +} 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 efd557618..00a846e8f 100755 --- a/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs @@ -119,8 +119,6 @@ pub struct AdvancementHolder { mod tests { use super::*; use azalea_buf::{McBufReadable, McBufWritable}; - use azalea_core::resource_location::ResourceLocation; - use std::io::Cursor; #[test] fn test() { diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs index 7c641c761..e93378988 100755 --- a/azalea-protocol/src/read.rs +++ b/azalea-protocol/src/read.rs @@ -17,6 +17,7 @@ use std::{ use thiserror::Error; use tokio::io::AsyncRead; use tokio_util::codec::{BytesCodec, FramedRead}; +use tracing::trace; #[derive(Error, Debug)] pub enum ReadPacketError { @@ -348,15 +349,17 @@ where } if log::log_enabled!(log::Level::Trace) { + const EXTRA_LARGE_LOGS: bool = false; + let buf_string: String = { - if buf.len() > 500 { + if !EXTRA_LARGE_LOGS && buf.len() > 500 { let cut_off_buf = &buf[..500]; format!("{cut_off_buf:?}...") } else { format!("{buf:?}") } }; - tracing::trace!("Reading packet with bytes: {buf_string}"); + trace!("Reading packet with bytes: {buf_string}"); }; Ok(Some(buf)) diff --git a/azalea-registry/azalea-registry-macros/src/lib.rs b/azalea-registry/azalea-registry-macros/src/lib.rs index f3289d961..460ff06af 100755 --- a/azalea-registry/azalea-registry-macros/src/lib.rs +++ b/azalea-registry/azalea-registry-macros/src/lib.rs @@ -1,7 +1,7 @@ use proc_macro::TokenStream; use quote::quote; use syn::{ - self, braced, + braced, parse::{Parse, ParseStream, Result}, parse_macro_input, punctuated::Punctuated, diff --git a/azalea-world/src/bit_storage.rs b/azalea-world/src/bit_storage.rs index 58ff28c4a..0456d7275 100755 --- a/azalea-world/src/bit_storage.rs +++ b/azalea-world/src/bit_storage.rs @@ -114,8 +114,7 @@ impl BitStorage { } } - // vanilla has this assert but it's not always true for some reason?? - // assert!(bits >= 1 && bits <= 32); + debug_assert!((1..=32).contains(&bits)); let values_per_long = 64 / bits; let magic_index = values_per_long - 1; diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index 8bc0b32cb..512f231b3 100755 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -450,9 +450,8 @@ impl McBufReadable for Section { for i in 0..states.storage.size() { if !BlockState::is_valid_state(states.storage.get(i) as u32) { return Err(BufReadError::Custom(format!( - "Invalid block state {} (index {}) found in section.", - states.storage.get(i), - i + "Invalid block state {} (index {i}) found in section.", + states.storage.get(i) ))); } } diff --git a/azalea-world/src/palette.rs b/azalea-world/src/palette.rs index 5e57989c7..278524ca6 100755 --- a/azalea-world/src/palette.rs +++ b/azalea-world/src/palette.rs @@ -1,5 +1,7 @@ use azalea_buf::{BufReadError, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; +use azalea_core::math; use std::io::{Cursor, Write}; +use tracing::warn; use crate::BitStorage; @@ -41,17 +43,39 @@ impl PalettedContainer { buf: &mut Cursor<&[u8]>, container_type: &'static PalettedContainerKind, ) -> Result { - let bits_per_entry = u8::read_from(buf)?; - let palette_type = PaletteKind::from_bits_and_type(bits_per_entry, container_type); + let server_bits_per_entry = u8::read_from(buf)?; + let palette_type = PaletteKind::from_bits_and_type(server_bits_per_entry, container_type); let palette = palette_type.read(buf)?; let size = container_type.size(); - let data = Vec::::read_from(buf)?; + + // if there's too much data that the bits per entry would be global, we have to + // figure out the bits per entry ourselves by checking the number of bits in the + // length of the data. + // this almost never matters, except on some custom servers like hypixel limbo + let calculated_bits_per_entry = math::ceil_log2(data.len() as u32) as u8; + let calculated_bits_per_entry_palette_kind = + PaletteKind::from_bits_and_type(calculated_bits_per_entry, container_type); + let bits_per_entry = if calculated_bits_per_entry_palette_kind == PaletteKind::Global { + server_bits_per_entry + } else { + calculated_bits_per_entry + }; + debug_assert!( bits_per_entry != 0 || data.is_empty(), "Bits per entry is 0 but data is not empty." ); - let storage = BitStorage::new(bits_per_entry.into(), size, Some(data)).unwrap(); + + let storage = match BitStorage::new(bits_per_entry.into(), size, Some(data)) { + Ok(storage) => storage, + Err(e) => { + warn!("Failed to create bit storage: {:?}", e); + return Err(BufReadError::Custom( + "Failed to create bit storage".to_string(), + )); + } + }; Ok(PalettedContainer { bits_per_entry, diff --git a/azalea/benches/pathfinder.rs b/azalea/benches/pathfinder.rs index 842c6b5e2..4e42c63a1 100644 --- a/azalea/benches/pathfinder.rs +++ b/azalea/benches/pathfinder.rs @@ -16,6 +16,7 @@ use criterion::{criterion_group, criterion_main, Bencher, Criterion}; use parking_lot::RwLock; use rand::{rngs::StdRng, Rng, SeedableRng}; +#[allow(dead_code)] fn generate_bedrock_world( partial_chunks: &mut PartialChunkStorage, size: u32, @@ -87,7 +88,7 @@ fn generate_mining_world( } } - let mut rng = StdRng::seed_from_u64(0); + // let mut rng = StdRng::seed_from_u64(0); for chunk_x in -size..size { for chunk_z in -size..size { diff --git a/azalea/examples/testbot/commands.rs b/azalea/examples/testbot/commands.rs index db606aa63..9cdb3cb79 100644 --- a/azalea/examples/testbot/commands.rs +++ b/azalea/examples/testbot/commands.rs @@ -4,7 +4,6 @@ pub mod movement; use azalea::brigadier::prelude::*; use azalea::chat::ChatPacket; -use azalea::ecs::prelude::Entity; use azalea::ecs::prelude::*; use azalea::entity::metadata::Player; use azalea::Client; diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index c3bc93f76..43e6b1792 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -15,7 +15,7 @@ mod commands; pub mod killaura; use azalea::pathfinder::PathfinderDebugParticles; -use azalea::{Account, ClientInformation}; +use azalea::ClientInformation; use azalea::brigadier::command_dispatcher::CommandDispatcher; use azalea::ecs::prelude::*; @@ -136,7 +136,7 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Resu let command = if chat.is_whisper() { Some(content) } else { - content.strip_prefix("!").map(|s| s.to_owned()) + content.strip_prefix('!').map(|s| s.to_owned()) }; if let Some(command) = command { match state.commands.execute( @@ -163,7 +163,7 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Resu azalea::Event::Tick => { killaura::tick(bot.clone(), state.clone())?; - let task = state.task.lock().clone(); + let task = *state.task.lock(); match task { BotTask::None => {} } diff --git a/azalea/src/pathfinder/world.rs b/azalea/src/pathfinder/world.rs index d3c94a52c..2d8590266 100644 --- a/azalea/src/pathfinder/world.rs +++ b/azalea/src/pathfinder/world.rs @@ -489,13 +489,9 @@ pub fn is_block_state_solid(block: BlockState) -> bool { #[cfg(test)] mod tests { - use std::sync::Arc; use super::*; - use azalea_block::BlockState; - use azalea_core::position::ChunkPos; use azalea_world::{Chunk, ChunkStorage, PartialInstance}; - use parking_lot::RwLock; #[test] fn test_is_passable() { From 87658ac4869f1fe458bc87009bc159f8e3362b69 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 22 Feb 2024 22:44:05 -0600 Subject: [PATCH 17/37] add OWNER_USERNAME to testbot --- azalea/examples/testbot/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index 43e6b1792..86395b7e6 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -28,6 +28,8 @@ use std::time::Duration; const USERNAME: &str = "azalea"; const ADDRESS: &str = "localhost"; +/// The bot will only listen to commands sent by the player with this username. +const OWNER_USERNAME: &str = "py5"; /// Whether the bot should run /particle a ton of times to show where it's /// pathfinding to. You should only have this on if the bot has operator /// permissions, otherwise it'll just spam the server console unnecessarily. @@ -127,7 +129,7 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Resu let (Some(username), content) = chat.split_sender_and_content() else { return Ok(()); }; - if username != "py5" { + if username != OWNER_USERNAME { return Ok(()); } From ad33d06e5fa4498e9c37d88308e4077af94c9381 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 23 Feb 2024 10:15:45 -0600 Subject: [PATCH 18/37] reword comment for calculated_bits_per_entry --- azalea-world/src/palette.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azalea-world/src/palette.rs b/azalea-world/src/palette.rs index 278524ca6..2b3cdc536 100755 --- a/azalea-world/src/palette.rs +++ b/azalea-world/src/palette.rs @@ -49,9 +49,9 @@ impl PalettedContainer { let size = container_type.size(); let data = Vec::::read_from(buf)?; - // if there's too much data that the bits per entry would be global, we have to - // figure out the bits per entry ourselves by checking the number of bits in the - // length of the data. + // we can only trust the bits per entry that we're sent if there's enough data + // that it'd be global. if it's not global, then we have to calculate it + // ourselves. // this almost never matters, except on some custom servers like hypixel limbo let calculated_bits_per_entry = math::ceil_log2(data.len() as u32) as u8; let calculated_bits_per_entry_palette_kind = From 28de14f9843e4ae26ed16e938f4d179b58122d76 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 23 Feb 2024 20:48:26 -0600 Subject: [PATCH 19/37] fix pathfinder A* using slightly suboptimal paths sometimes --- azalea/src/pathfinder/astar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azalea/src/pathfinder/astar.rs b/azalea/src/pathfinder/astar.rs index cc1e2242d..9e48ba2df 100644 --- a/azalea/src/pathfinder/astar.rs +++ b/azalea/src/pathfinder/astar.rs @@ -78,7 +78,7 @@ where .get(&neighbor.movement.target) .map(|n| n.g_score) .unwrap_or(f32::INFINITY); - if tentative_g_score - neighbor_g_score < MIN_IMPROVEMENT { + if neighbor_g_score - tentative_g_score > MIN_IMPROVEMENT { let heuristic = heuristic(neighbor.movement.target); let f_score = tentative_g_score + heuristic; nodes.insert( From 5c85158e7ca6bbd357be520029326c08d456a107 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 23 Feb 2024 23:43:41 -0600 Subject: [PATCH 20/37] fix 'CommandQueue has un-applied commands being dropped.' spam --- azalea-client/src/packet_handling/game.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index 080ef2701..bd88258ae 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -748,6 +748,7 @@ pub fn process_packet_events(ecs: &mut World) { { warn!("{e}"); } + commands_system_state.apply(world); }); }), }); From 64fceff1cc65ee1dd1c72f08004e40179be9f9a4 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 24 Feb 2024 00:39:38 -0600 Subject: [PATCH 21/37] track entity rotations --- azalea-client/src/packet_handling/game.rs | 53 +++++++++++++++++++++-- azalea-entity/src/lib.rs | 2 +- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index bd88258ae..30b736c08 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -419,7 +419,6 @@ pub fn process_packet_events(ecs: &mut World) { debug!("Got recipe packet"); } ClientboundGamePacket::PlayerPosition(p) => { - // TODO: reply with teleport confirm debug!("Got player position packet {p:?}"); #[allow(clippy::type_complexity)] @@ -839,6 +838,10 @@ pub fn process_packet_events(ecs: &mut World) { if let Some(entity) = entity { let new_pos = p.position; + let new_look_direction = LookDirection { + x_rot: (p.x_rot as i32 * 360) as f32 / 256., + y_rot: (p.y_rot as i32 * 360) as f32 / 256., + }; commands.entity(entity).add(RelativeEntityUpdate { partial_world: instance_holder.partial_instance.clone(), update: Box::new(move |entity| { @@ -846,6 +849,10 @@ pub fn process_packet_events(ecs: &mut World) { if new_pos != **position { **position = new_pos; } + let mut look_direction = entity.get_mut::().unwrap(); + if new_look_direction != *look_direction { + *look_direction = new_look_direction; + } }), }); } else { @@ -903,6 +910,11 @@ pub fn process_packet_events(ecs: &mut World) { if let Some(entity) = entity { let delta = p.delta.clone(); + let new_look_direction = LookDirection { + x_rot: (p.x_rot as i32 * 360) as f32 / 256., + y_rot: (p.y_rot as i32 * 360) as f32 / 256., + }; + commands.entity(entity).add(RelativeEntityUpdate { partial_world: instance_holder.partial_instance.clone(), update: Box::new(move |entity_mut| { @@ -911,6 +923,10 @@ pub fn process_packet_events(ecs: &mut World) { if new_pos != **position { **position = new_pos; } + let mut look_direction = entity_mut.get_mut::().unwrap(); + if new_look_direction != *look_direction { + *look_direction = new_look_direction; + } }), }); } else { @@ -923,8 +939,39 @@ pub fn process_packet_events(ecs: &mut World) { system_state.apply(ecs); } - ClientboundGamePacket::MoveEntityRot(_p) => { - // debug!("Got move entity rot packet {p:?}"); + ClientboundGamePacket::MoveEntityRot(p) => { + let mut system_state: SystemState<( + Commands, + Query<(&EntityIdIndex, &InstanceHolder)>, + )> = SystemState::new(ecs); + let (mut commands, mut query) = system_state.get_mut(ecs); + let (entity_id_index, instance_holder) = query.get_mut(player_entity).unwrap(); + + let entity = entity_id_index.get(&MinecraftEntityId(p.entity_id)); + + if let Some(entity) = entity { + let new_look_direction = LookDirection { + x_rot: (p.x_rot as i32 * 360) as f32 / 256., + y_rot: (p.y_rot as i32 * 360) as f32 / 256., + }; + + commands.entity(entity).add(RelativeEntityUpdate { + partial_world: instance_holder.partial_instance.clone(), + update: Box::new(move |entity_mut| { + let mut look_direction = entity_mut.get_mut::().unwrap(); + if new_look_direction != *look_direction { + *look_direction = new_look_direction; + } + }), + }); + } else { + warn!( + "Got move entity rot packet for unknown entity id {}", + p.entity_id + ); + } + + system_state.apply(ecs); } ClientboundGamePacket::KeepAlive(p) => { debug!("Got keep alive packet {p:?} for {player_entity:?}"); diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index eb5b5b252..f39a6e4f9 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -203,7 +203,7 @@ impl From<&LastSentPosition> for BlockPos { pub struct Jumping(bool); /// A component that contains the direction an entity is looking. -#[derive(Debug, Component, Clone, Default)] +#[derive(Debug, Component, Clone, Default, PartialEq)] pub struct LookDirection { pub x_rot: f32, pub y_rot: f32, From 4eeda83ba4bdb5e20c765a46e43227f4f9b39b69 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 24 Feb 2024 06:02:11 -0600 Subject: [PATCH 22/37] add some more convenience functions --- azalea-client/src/movement.rs | 12 ++++++++--- azalea-core/src/position.rs | 19 ++++++++++++++++++ azalea-entity/src/lib.rs | 38 +++++++++++++++++++++++++++++++---- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/azalea-client/src/movement.rs b/azalea-client/src/movement.rs index 2f70a40ee..ba47b7c84 100644 --- a/azalea-client/src/movement.rs +++ b/azalea-client/src/movement.rs @@ -86,9 +86,7 @@ impl Client { /// Returns whether the player will try to jump next tick. pub fn jumping(&self) -> bool { - let mut ecs = self.ecs.lock(); - let jumping_ref = self.query::<&Jumping>(&mut ecs); - **jumping_ref + *self.component::() } /// Sets the direction the client is looking. `y_rot` is yaw (looking to the @@ -101,6 +99,14 @@ impl Client { (look_direction.y_rot, look_direction.x_rot) = (y_rot, x_rot); } + + /// Returns the direction the client is looking. The first value is the y + /// rotation (ie. yaw, looking to the side) and the second value is the x + /// rotation (ie. pitch, looking up and down). + pub fn direction(&self) -> (f32, f32) { + let look_direction = self.component::(); + (look_direction.y_rot, look_direction.x_rot) + } } /// A component that contains the look direction that was last sent over the diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index e98640357..369607c5c 100755 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -186,6 +186,25 @@ macro_rules! vec3_impl { } } } + + impl From<($type, $type, $type)> for $name { + #[inline] + fn from(pos: ($type, $type, $type)) -> Self { + Self::new(pos.0, pos.1, pos.2) + } + } + impl From<&($type, $type, $type)> for $name { + #[inline] + fn from(pos: &($type, $type, $type)) -> Self { + Self::new(pos.0, pos.1, pos.2) + } + } + impl From<$name> for ($type, $type, $type) { + #[inline] + fn from(pos: $name) -> Self { + (pos.x, pos.y, pos.z) + } + } }; } diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index f39a6e4f9..e08284a92 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -23,7 +23,10 @@ use bevy_ecs::{bundle::Bundle, component::Component}; pub use data::*; use derive_more::{Deref, DerefMut}; pub use dimensions::EntityDimensions; -use std::fmt::Debug; +use std::{ + fmt::Debug, + hash::{Hash, Hasher}, +}; use uuid::Uuid; pub use crate::plugin::*; @@ -199,15 +202,42 @@ impl From<&LastSentPosition> for BlockPos { /// /// If this is true, the entity will try to jump every tick. (It's equivalent to /// the space key being held in vanilla.) -#[derive(Debug, Component, Clone, Deref, DerefMut, Default)] +#[derive(Debug, Component, Copy, Clone, Deref, DerefMut, Default)] pub struct Jumping(bool); /// A component that contains the direction an entity is looking. -#[derive(Debug, Component, Clone, Default, PartialEq)] +#[derive(Debug, Component, Copy, Clone, Default, PartialEq)] pub struct LookDirection { - pub x_rot: f32, + /// Left and right. Aka yaw. pub y_rot: f32, + /// Up and down. Aka pitch. + pub x_rot: f32, +} + +impl LookDirection { + pub fn new(y_rot: f32, x_rot: f32) -> Self { + Self { y_rot, x_rot } + } +} + +impl From for (f32, f32) { + fn from(value: LookDirection) -> Self { + (value.y_rot, value.x_rot) + } +} +impl From<(f32, f32)> for LookDirection { + fn from((y_rot, x_rot): (f32, f32)) -> Self { + Self { y_rot, x_rot } + } +} + +impl Hash for LookDirection { + fn hash(&self, state: &mut H) { + self.y_rot.to_bits().hash(state); + self.x_rot.to_bits().hash(state); + } } +impl Eq for LookDirection {} /// The physics data relating to the entity, such as position, velocity, and /// bounding box. From c38957374c288eb41b7dbd905071a469c7bbb2b1 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 24 Feb 2024 14:00:09 -0600 Subject: [PATCH 23/37] fix parsing textcomponents failing when it's translatable and has a primitive as an argument --- azalea-chat/src/component.rs | 74 ++++++++++++++----- .../game/clientbound_system_chat_packet.rs | 23 ++++++ azalea-protocol/src/read.rs | 4 +- 3 files changed, 81 insertions(+), 20 deletions(-) diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 807d0b1aa..3855a715c 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -11,6 +11,7 @@ use serde::{de, Deserialize, Deserializer, Serialize}; #[cfg(feature = "simdnbt")] use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _}; use std::fmt::Display; +use tracing::{trace, warn}; /// A chat component, basically anything you can see in chat. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Hash)] @@ -313,22 +314,60 @@ impl simdnbt::FromNbtTag for FormattedText { // if it's a string component with no styling and no siblings, just add // a string to with_array otherwise add the // component to the array - let c = FormattedText::from_nbt_tag( + if let Some(primitive) = item.get("") { + // minecraft does this sometimes, for example + // for the /give system messages + match primitive { + simdnbt::borrow::NbtTag::Byte(b) => { + // interpreted as boolean + with_array.push(StringOrComponent::String( + if *b != 0 { "true" } else { "false" }.to_string(), + )); + } + simdnbt::borrow::NbtTag::Short(s) => { + with_array.push(StringOrComponent::String(s.to_string())); + } + simdnbt::borrow::NbtTag::Int(i) => { + with_array.push(StringOrComponent::String(i.to_string())); + } + simdnbt::borrow::NbtTag::Long(l) => { + with_array.push(StringOrComponent::String(l.to_string())); + } + simdnbt::borrow::NbtTag::Float(f) => { + with_array.push(StringOrComponent::String(f.to_string())); + } + simdnbt::borrow::NbtTag::Double(d) => { + with_array.push(StringOrComponent::String(d.to_string())); + } + simdnbt::borrow::NbtTag::String(s) => { + with_array.push(StringOrComponent::String(s.to_string())); + } + _ => { + warn!("couldn't parse {item:?} as FormattedText because it has a disallowed primitive"); + with_array.push(StringOrComponent::String("?".to_string())); + } + } + } else if let Some(c) = FormattedText::from_nbt_tag( &simdnbt::borrow::NbtTag::Compound(item.clone()), - )?; - if let FormattedText::Text(text_component) = c { - if text_component.base.siblings.is_empty() - && text_component.base.style.is_empty() - { - with_array.push(StringOrComponent::String(text_component.text)); - continue; + ) { + if let FormattedText::Text(text_component) = c { + if text_component.base.siblings.is_empty() + && text_component.base.style.is_empty() + { + with_array + .push(StringOrComponent::String(text_component.text)); + continue; + } } + with_array.push(StringOrComponent::FormattedText( + FormattedText::from_nbt_tag( + &simdnbt::borrow::NbtTag::Compound(item.clone()), + )?, + )); + } else { + warn!("couldn't parse {item:?} as FormattedText"); + with_array.push(StringOrComponent::String("?".to_string())); } - with_array.push(StringOrComponent::FormattedText( - FormattedText::from_nbt_tag(&simdnbt::borrow::NbtTag::Compound( - item.clone(), - ))?, - )); } component = FormattedText::Translatable(TranslatableComponent::new( translate, with_array, @@ -344,22 +383,21 @@ impl simdnbt::FromNbtTag for FormattedText { // object = GsonHelper.getAsJsonObject(jsonObject, "score"); if score.get("name").is_none() || score.get("objective").is_none() { // A score component needs at least a name and an objective - tracing::trace!("A score component needs at least a name and an objective"); + trace!("A score component needs at least a name and an objective"); return None; } // TODO, score text components aren't yet supported return None; } else if compound.get("selector").is_some() { // selector text components aren't yet supported - tracing::trace!("selector text components aren't yet supported"); + trace!("selector text components aren't yet supported"); return None; } else if compound.get("keybind").is_some() { // keybind text components aren't yet supported - tracing::trace!("keybind text components aren't yet supported"); + trace!("keybind text components aren't yet supported"); return None; } else { let Some(_nbt) = compound.get("nbt") else { - // Don't know how to turn 'nbt' into a FormattedText return None; }; let _separator = FormattedText::parse_separator_nbt(compound)?; @@ -369,7 +407,7 @@ impl simdnbt::FromNbtTag for FormattedText { None => false, }; if let Some(_block) = compound.get("block") {} - // nbt text components aren't yet supported + trace!("nbt text components aren't yet supported"); return None; } if let Some(extra) = compound.get("extra") { diff --git a/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs index 8a5823a0a..420dfd36f 100755 --- a/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs @@ -7,3 +7,26 @@ pub struct ClientboundSystemChatPacket { pub content: FormattedText, pub overlay: bool, } + +#[cfg(test)] +mod tests { + use std::io::Cursor; + + use azalea_buf::McBufReadable; + + use super::*; + + #[test] + fn test_clientbound_system_chat_packet() { + #[rustfmt::skip] + let bytes = [ + 10, 9, 0, 4, 119, 105, 116, 104, 10, 0, 0, 0, 2, 10, 0, 10, 104, 111, 118, 101, 114, 69, 118, 101, 110, 116, 10, 0, 8, 99, 111, 110, 116, 101, 110, 116, 115, 8, 0, 4, 110, 97, 109, 101, 0, 3, 112, 121, 53, 11, 0, 2, 105, 100, 0, 0, 0, 4, 101, 54, 191, 237, 134, 149, 72, 253, 131, 161, 236, 210, 76, 242, 160, 253, 8, 0, 4, 116, 121, 112, 101, 0, 16, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 112, 108, 97, 121, 101, 114, 0, 8, 0, 6, 97, 99, 116, 105, 111, 110, 0, 11, 115, 104, 111, 119, 95, 101, 110, 116, 105, 116, 121, 0, 10, 0, 10, 99, 108, 105, 99, 107, 69, 118, 101, 110, 116, 8, 0, 6, 97, 99, 116, 105, 111, 110, 0, 15, 115, 117, 103, 103, 101, 115, 116, 95, 99, 111, 109, 109, 97, 110, 100, 8, 0, 5, 118, 97, 108, 117, 101, 0, 10, 47, 116, 101, 108, 108, 32, 112, 121, 53, 32, 0, 8, 0, 9, 105, 110, 115, 101, 114, 116, 105, 111, 110, 0, 3, 112, 121, 53, 8, 0, 4, 116, 101, 120, 116, 0, 3, 112, 121, 53, 0, 9, 0, 4, 119, 105, 116, 104, 10, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 1, 0, 10, 0, 10, 104, 111, 118, 101, 114, 69, 118, 101, 110, 116, 10, 0, 8, 99, 111, 110, 116, 101, 110, 116, 115, 8, 0, 2, 105, 100, 0, 25, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 100, 105, 97, 109, 111, 110, 100, 95, 112, 105, 99, 107, 97, 120, 101, 8, 0, 3, 116, 97, 103, 0, 10, 123, 68, 97, 109, 97, 103, 101, 58, 48, 125, 0, 8, 0, 6, 97, 99, 116, 105, 111, 110, 0, 9, 115, 104, 111, 119, 95, 105, 116, 101, 109, 0, 9, 0, 4, 119, 105, 116, 104, 10, 0, 0, 0, 1, 9, 0, 5, 101, 120, 116, 114, 97, 10, 0, 0, 0, 1, 8, 0, 9, 116, 114, 97, 110, 115, 108, 97, 116, 101, 0, 30, 105, 116, 101, 109, 46, 109, 105, 110, 101, 99, 114, 97, 102, 116, 46, 100, 105, 97, 109, 111, 110, 100, 95, 112, 105, 99, 107, 97, 120, 101, 0, 8, 0, 4, 116, 101, 120, 116, 0, 0, 0, 8, 0, 5, 99, 111, 108, 111, 114, 0, 5, 119, 104, 105, 116, 101, 8, 0, 9, 116, 114, 97, 110, 115, 108, 97, 116, 101, 0, 20, 99, 104, 97, 116, 46, 115, 113, 117, 97, 114, 101, 95, 98, 114, 97, 99, 107, 101, 116, 115, 0, 10, 0, 10, 104, 111, 118, 101, 114, 69, 118, 101, 110, 116, 10, 0, 8, 99, 111, 110, 116, 101, 110, 116, 115, 8, 0, 4, 110, 97, 109, 101, 0, 3, 112, 121, 53, 11, 0, 2, 105, 100, 0, 0, 0, 4, 101, 54, 191, 237, 134, 149, 72, 253, 131, 161, 236, 210, 76, 242, 160, 253, 8, 0, 4, 116, 121, 112, 101, 0, 16, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 112, 108, 97, 121, 101, 114, 0, 8, 0, 6, 97, 99, 116, 105, 111, 110, 0, 11, 115, 104, 111, 119, 95, 101, 110, 116, 105, 116, 121, 0, 10, 0, 10, 99, 108, 105, 99, 107, 69, 118, 101, 110, 116, 8, 0, 6, 97, 99, 116, 105, 111, 110, 0, 15, 115, 117, 103, 103, 101, 115, 116, 95, 99, 111, 109, 109, 97, 110, 100, 8, 0, 5, 118, 97, 108, 117, 101, 0, 10, 47, 116, 101, 108, 108, 32, 112, 121, 53, 32, 0, 8, 0, 9, 105, 110, 115, 101, 114, 116, 105, 111, 110, 0, 3, 112, 121, 53, 8, 0, 4, 116, 101, 120, 116, 0, 3, 112, 121, 53, 0, 8, 0, 9, 116, 114, 97, 110, 115, 108, 97, 116, 101, 0, 28, 99, 111, 109, 109, 97, 110, 100, 115, 46, 103, 105, 118, 101, 46, 115, 117, 99, 99, 101, 115, 115, 46, 115, 105, 110, 103, 108, 101, 0, 8, 0, 5, 99, 111, 108, 111, 114, 0, 4, 103, 114, 97, 121, 1, 0, 6, 105, 116, 97, 108, 105, 99, 1, 8, 0, 9, 116, 114, 97, 110, 115, 108, 97, 116, 101, 0, 15, 99, 104, 97, 116, 46, 116, 121, 112, 101, 46, 97, 100, 109, 105, 110, 0, 0 + ]; + + let packet = ClientboundSystemChatPacket::read_from(&mut Cursor::new(&bytes)).unwrap(); + assert_eq!( + packet.content.to_string(), + "[py5: Gave 1 [Diamond Pickaxe] to py5]".to_string() + ); + } +} diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs index e93378988..434cc74a9 100755 --- a/azalea-protocol/src/read.rs +++ b/azalea-protocol/src/read.rs @@ -349,10 +349,10 @@ where } if log::log_enabled!(log::Level::Trace) { - const EXTRA_LARGE_LOGS: bool = false; + const DO_NOT_CUT_OFF_PACKET_LOGS: bool = false; let buf_string: String = { - if !EXTRA_LARGE_LOGS && buf.len() > 500 { + if !DO_NOT_CUT_OFF_PACKET_LOGS && buf.len() > 500 { let cut_off_buf = &buf[..500]; format!("{cut_off_buf:?}...") } else { From 13426b035e43c4435854f175155439ab28a18544 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 24 Feb 2024 21:03:02 -0600 Subject: [PATCH 24/37] add Display for Vec3, add SimulationSet, and add EntityChunkPos component --- azalea-core/src/position.rs | 6 + azalea-core/src/tick.rs | 4 + azalea-entity/src/lib.rs | 5 + azalea-entity/src/plugin/indexing.rs | 35 +++--- azalea/src/lib.rs | 1 + azalea/src/pathfinder/simulation.rs | 163 +++++++++++++++++---------- 6 files changed, 142 insertions(+), 72 deletions(-) diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index 369607c5c..e2a9c4cc2 100755 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -564,6 +564,12 @@ impl fmt::Display for BlockPos { write!(f, "{} {} {}", self.x, self.y, self.z) } } +impl fmt::Display for Vec3 { + /// Display a position as `x y z`. + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{} {} {}", self.x, self.y, self.z) + } +} const PACKED_X_LENGTH: u64 = 1 + 25; // minecraft does something a bit more complicated to get this 25 const PACKED_Z_LENGTH: u64 = PACKED_X_LENGTH; diff --git a/azalea-core/src/tick.rs b/azalea-core/src/tick.rs index db10d80ad..c6f02c129 100644 --- a/azalea-core/src/tick.rs +++ b/azalea-core/src/tick.rs @@ -1,4 +1,8 @@ use bevy_ecs::schedule::ScheduleLabel; +/// A Bevy schedule that runs every Minecraft game tick, i.e. every 50ms. +/// +/// Many client systems run on this schedule, the most important one being +/// physics. #[derive(ScheduleLabel, Hash, Copy, Clone, Debug, Default, Eq, PartialEq)] pub struct GameTick; diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index e08284a92..1b643e4a4 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -23,6 +23,7 @@ use bevy_ecs::{bundle::Bundle, component::Component}; pub use data::*; use derive_more::{Deref, DerefMut}; pub use dimensions::EntityDimensions; +use plugin::indexing::EntityChunkPos; use std::{ fmt::Debug, hash::{Hash, Hasher}, @@ -347,6 +348,9 @@ pub struct EntityBundle { pub world_name: InstanceName, pub position: Position, pub last_sent_position: LastSentPosition, + + pub chunk_pos: EntityChunkPos, + pub physics: Physics, pub direction: LookDirection, pub eye_height: EyeHeight, @@ -375,6 +379,7 @@ impl EntityBundle { uuid: EntityUuid(uuid), world_name: InstanceName(world_name), position: Position(pos), + chunk_pos: EntityChunkPos(ChunkPos::from(&pos)), last_sent_position: LastSentPosition(pos), physics: Physics::new(dimensions, &pos), eye_height: EyeHeight(eye_height), diff --git a/azalea-entity/src/plugin/indexing.rs b/azalea-entity/src/plugin/indexing.rs index 86e91ff21..c8aaffb00 100644 --- a/azalea-entity/src/plugin/indexing.rs +++ b/azalea-entity/src/plugin/indexing.rs @@ -8,12 +8,13 @@ use bevy_ecs::{ query::Changed, system::{Commands, Query, Res, ResMut, Resource}, }; +use derive_more::{Deref, DerefMut}; use nohash_hasher::IntMap; use std::{collections::HashMap, fmt::Debug}; use tracing::{debug, warn}; use uuid::Uuid; -use crate::{EntityUuid, LastSentPosition, Position}; +use crate::{EntityUuid, Position}; use super::LoadedBy; @@ -83,33 +84,37 @@ impl Debug for EntityUuidIndex { } } -// TODO: this should keep track of chunk position changes in a better way -// instead of relying on LastSentPosition +/// The chunk position that an entity is currently in. +#[derive(Component, Debug, Deref, DerefMut)] +pub struct EntityChunkPos(pub ChunkPos); /// Update the chunk position indexes in [`Instance::entities_by_chunk`]. /// /// [`Instance::entities_by_chunk`]: azalea_world::Instance::entities_by_chunk pub fn update_entity_chunk_positions( - mut query: Query<(Entity, &Position, &LastSentPosition, &InstanceName), Changed>, + mut query: Query<(Entity, &Position, &InstanceName, &mut EntityChunkPos), Changed>, instance_container: Res, ) { - for (entity, pos, last_pos, world_name) in query.iter_mut() { + for (entity, pos, world_name, mut entity_chunk_pos) in query.iter_mut() { let instance_lock = instance_container.get(world_name).unwrap(); let mut instance = instance_lock.write(); - let old_chunk = ChunkPos::from(*last_pos); + let old_chunk = **entity_chunk_pos; let new_chunk = ChunkPos::from(*pos); - if old_chunk != new_chunk { - // move the entity from the old chunk to the new one - if let Some(entities) = instance.entities_by_chunk.get_mut(&old_chunk) { - entities.remove(&entity); + **entity_chunk_pos = new_chunk; + + if old_chunk != new_chunk { + // move the entity from the old chunk to the new one + if let Some(entities) = instance.entities_by_chunk.get_mut(&old_chunk) { + entities.remove(&entity); + } + instance + .entities_by_chunk + .entry(new_chunk) + .or_default() + .insert(entity); } - instance - .entities_by_chunk - .entry(new_chunk) - .or_default() - .insert(entity); } } } diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index fd2cb83ac..84c215d54 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -29,6 +29,7 @@ pub use azalea_core::{ resource_location::ResourceLocation, }; pub use azalea_entity as entity; +pub use azalea_physics as physics; pub use azalea_protocol as protocol; pub use azalea_registry as registry; pub use azalea_world as world; diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs index ab3b340e8..bea99e934 100644 --- a/azalea/src/pathfinder/simulation.rs +++ b/azalea/src/pathfinder/simulation.rs @@ -7,7 +7,7 @@ use azalea_client::{ }; use azalea_core::{position::Vec3, resource_location::ResourceLocation, tick::GameTick}; use azalea_entity::{ - attributes::AttributeInstance, Attributes, EntityDimensions, Physics, Position, + attributes::AttributeInstance, Attributes, EntityDimensions, LookDirection, Physics, Position, }; use azalea_world::{ChunkStorage, Instance, InstanceContainer, MinecraftEntityId, PartialInstance}; use bevy_app::App; @@ -20,6 +20,7 @@ pub struct SimulatedPlayerBundle { pub position: Position, pub physics: Physics, pub physics_state: PhysicsState, + pub look_direction: LookDirection, pub attributes: Attributes, pub inventory: InventoryComponent, } @@ -35,6 +36,7 @@ impl SimulatedPlayerBundle { position: Position::new(position), physics: Physics::new(dimensions, &position), physics_state: PhysicsState::default(), + look_direction: LookDirection::new(0.0, 0.0), attributes: Attributes { speed: AttributeInstance::new(0.1), attack_speed: AttributeInstance::new(4.0), @@ -44,6 +46,77 @@ impl SimulatedPlayerBundle { } } +fn simulation_instance_name() -> ResourceLocation { + ResourceLocation::new("azalea:simulation") +} + +fn create_simulation_instance(chunks: ChunkStorage) -> (App, Arc>) { + let instance_name = simulation_instance_name(); + + let instance = Arc::new(RwLock::new(Instance { + chunks, + ..Default::default() + })); + + let mut app = App::new(); + // we don't use all the default azalea plugins because we don't need all of them + app.add_plugins(( + azalea_physics::PhysicsPlugin, + azalea_entity::EntityPlugin, + azalea_client::movement::PlayerMovePlugin, + super::PathfinderPlugin, + crate::BotPlugin, + azalea_client::task_pool::TaskPoolPlugin::default(), + // for mining + azalea_client::inventory::InventoryPlugin, + azalea_client::mining::MinePlugin, + azalea_client::interact::InteractPlugin, + )) + .insert_resource(InstanceContainer { + instances: [(instance_name.clone(), Arc::downgrade(&instance.clone()))] + .iter() + .cloned() + .collect(), + }) + .add_event::(); + + app.edit_schedule(bevy_app::Main, |schedule| { + schedule.set_executor_kind(bevy_ecs::schedule::ExecutorKind::SingleThreaded); + }); + + (app, instance) +} + +fn create_simulation_player( + ecs: &mut World, + instance: Arc>, + player: SimulatedPlayerBundle, +) -> Entity { + let instance_name = simulation_instance_name(); + + let mut entity = ecs.spawn(( + MinecraftEntityId(0), + azalea_entity::LocalEntity, + azalea_entity::metadata::PlayerMetadataBundle::default(), + azalea_entity::EntityBundle::new( + Uuid::nil(), + *player.position, + azalea_registry::EntityKind::Player, + instance_name, + ), + azalea_client::InstanceHolder { + // partial_instance is never actually used by the pathfinder so + partial_instance: Arc::new(RwLock::new(PartialInstance::default())), + instance: instance.clone(), + }, + InventoryComponent::default(), + )); + entity.insert(player); + + let entity_id = entity.id(); + entity_id +} + /// Simulate the Minecraft world to see if certain movements would be possible. pub struct Simulation { pub app: App, @@ -53,71 +126,47 @@ pub struct Simulation { impl Simulation { pub fn new(chunks: ChunkStorage, player: SimulatedPlayerBundle) -> Self { - let instance_name = ResourceLocation::new("azalea:simulation"); - - let instance = Arc::new(RwLock::new(Instance { - chunks, - ..Default::default() - })); - - let mut app = App::new(); - // we don't use all the default azalea plugins because we don't need all of them - app.add_plugins(( - azalea_physics::PhysicsPlugin, - azalea_entity::EntityPlugin, - azalea_client::movement::PlayerMovePlugin, - super::PathfinderPlugin, - crate::BotPlugin, - azalea_client::task_pool::TaskPoolPlugin::default(), - // for mining - azalea_client::inventory::InventoryPlugin, - azalea_client::mining::MinePlugin, - azalea_client::interact::InteractPlugin, - )) - .insert_resource(InstanceContainer { - instances: [(instance_name.clone(), Arc::downgrade(&instance.clone()))] - .iter() - .cloned() - .collect(), - }) - .add_event::(); - - app.edit_schedule(bevy_app::Main, |schedule| { - schedule.set_executor_kind(bevy_ecs::schedule::ExecutorKind::SingleThreaded); - }); - - let mut entity = app.world.spawn(( - MinecraftEntityId(0), - azalea_entity::LocalEntity, - azalea_entity::metadata::PlayerMetadataBundle::default(), - azalea_entity::EntityBundle::new( - Uuid::nil(), - *player.position, - azalea_registry::EntityKind::Player, - instance_name, - ), - azalea_client::InstanceHolder { - // partial_instance is never actually used by the pathfinder so - partial_instance: Arc::new(RwLock::new(PartialInstance::default())), - instance: instance.clone(), - }, - InventoryComponent::default(), - )); - entity.insert(player); - - let entity_id = entity.id(); - + let (mut app, instance) = create_simulation_instance(chunks); + let entity = create_simulation_player(&mut app.world, instance.clone(), player); Self { app, - entity: entity_id, + entity, _instance: instance, } } + pub fn tick(&mut self) { - self.app.world.run_schedule(GameTick); self.app.update(); + self.app.world.run_schedule(GameTick); } pub fn position(&self) -> Vec3 { **self.app.world.get::(self.entity).unwrap() } } + +/// A set of simulations, useful for efficiently doing multiple simulations. +pub struct SimulationSet { + pub app: App, + instance: Arc>, +} +impl SimulationSet { + pub fn new(chunks: ChunkStorage) -> Self { + let (app, instance) = create_simulation_instance(chunks); + Self { app, instance } + } + pub fn tick(&mut self) { + self.app.update(); + self.app.world.run_schedule(GameTick); + } + + pub fn spawn(&mut self, player: SimulatedPlayerBundle) -> Entity { + create_simulation_player(&mut self.app.world, self.instance.clone(), player) + } + pub fn despawn(&mut self, entity: Entity) { + self.app.world.despawn(entity); + } + + pub fn position(&self, entity: Entity) -> Vec3 { + **self.app.world.get::(entity).unwrap() + } +} From 018ab55bdb02e7774044198c8a30e0d02a7c6e29 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 25 Feb 2024 16:53:08 -0600 Subject: [PATCH 25/37] optimize physics --- Cargo.lock | 3 +- Cargo.toml | 0 azalea-chat/src/component.rs | 4 +- azalea-physics/Cargo.toml | 1 + .../src/collision/world_collisions.rs | 60 ++++++-- azalea-world/Cargo.toml | 2 +- azalea-world/src/container.rs | 3 +- azalea/Cargo.toml | 4 + azalea/benches/physics.rs | 144 ++++++++++++++++++ azalea/src/pathfinder/simulation.rs | 3 +- 10 files changed, 201 insertions(+), 23 deletions(-) mode change 100755 => 100644 Cargo.toml create mode 100644 azalea/benches/physics.rs diff --git a/Cargo.lock b/Cargo.lock index 6f61f0c1c..168ac60bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -457,6 +457,7 @@ dependencies = [ "bevy_app", "bevy_ecs", "bevy_time", + "nohash-hasher", "once_cell", "parking_lot", "tracing", @@ -543,10 +544,10 @@ dependencies = [ "bevy_ecs", "criterion", "derive_more", - "enum-as-inner", "nohash-hasher", "once_cell", "parking_lot", + "rustc-hash", "serde", "serde_json", "simdnbt", diff --git a/Cargo.toml b/Cargo.toml old mode 100755 new mode 100644 diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 3855a715c..d301aba15 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -397,9 +397,7 @@ impl simdnbt::FromNbtTag for FormattedText { trace!("keybind text components aren't yet supported"); return None; } else { - let Some(_nbt) = compound.get("nbt") else { - return None; - }; + let _nbt = compound.get("nbt")?; let _separator = FormattedText::parse_separator_nbt(compound)?; let _interpret = match compound.get("interpret") { diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index 340dc096e..043c0548c 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -20,6 +20,7 @@ bevy_ecs = "0.13.0" tracing = "0.1.40" once_cell = "1.19.0" parking_lot = "^0.12.1" +nohash-hasher = "0.2.0" [dev-dependencies] bevy_time = "0.13.0" diff --git a/azalea-physics/src/collision/world_collisions.rs b/azalea-physics/src/collision/world_collisions.rs index c4c6a846e..cb721f004 100644 --- a/azalea-physics/src/collision/world_collisions.rs +++ b/azalea-physics/src/collision/world_collisions.rs @@ -4,11 +4,11 @@ use azalea_block::BlockState; use azalea_core::{ cursor3d::{Cursor3d, CursorIterationType}, math::EPSILON, - position::{ChunkPos, ChunkSectionPos}, + position::{BlockPos, ChunkPos, ChunkSectionBlockPos, ChunkSectionPos}, }; use azalea_world::{Chunk, Instance}; use parking_lot::RwLock; -use std::{ops::Deref, sync::Arc}; +use std::sync::Arc; pub fn get_block_collisions(world: &Instance, aabb: AABB) -> BlockCollisions<'_> { BlockCollisions::new(world, aabb) @@ -20,6 +20,8 @@ pub struct BlockCollisions<'a> { pub entity_shape: VoxelShape, pub cursor: Cursor3d, pub only_suffocating_blocks: bool, + + cached_sections: Vec<(ChunkSectionPos, azalea_world::Section)>, } impl<'a> BlockCollisions<'a> { @@ -40,6 +42,8 @@ impl<'a> BlockCollisions<'a> { entity_shape: VoxelShape::from(aabb), cursor, only_suffocating_blocks: false, + + cached_sections: Vec::new(), } } @@ -63,6 +67,36 @@ impl<'a> BlockCollisions<'a> { self.world.chunks.get(&chunk_pos) } + + fn get_block_state(&mut self, block_pos: BlockPos) -> BlockState { + let section_pos = ChunkSectionPos::from(block_pos); + let section_block_pos = ChunkSectionBlockPos::from(block_pos); + + for (cached_section_pos, cached_section) in &self.cached_sections { + if section_pos == *cached_section_pos { + return cached_section.get(section_block_pos); + } + } + + let chunk = self.get_chunk(block_pos.x, block_pos.z); + let Some(chunk) = chunk else { + return BlockState::AIR; + }; + let chunk = chunk.read(); + + let sections = &chunk.sections; + let section_index = + azalea_world::chunk_storage::section_index(block_pos.y, self.world.chunks.min_y) + as usize; + + let Some(section) = sections.get(section_index) else { + return BlockState::AIR; + }; + + self.cached_sections.push((section_pos, section.clone())); + + section.get(section_block_pos) + } } impl<'a> Iterator for BlockCollisions<'a> { @@ -74,24 +108,18 @@ impl<'a> Iterator for BlockCollisions<'a> { continue; } - let chunk = self.get_chunk(item.pos.x, item.pos.z); - let Some(chunk) = chunk else { - continue; - }; + let block_state = self.get_block_state(item.pos); - let pos = item.pos; - let block_state: BlockState = chunk - .read() - .get(&(&pos).into(), self.world.chunks.min_y) - .unwrap_or(BlockState::AIR); + if block_state.is_air() { + // fast path since we can't collide with air + continue; + } // TODO: continue if self.only_suffocating_blocks and the block is not // suffocating - let block_shape = block_state.shape(); - // if it's a full block do a faster collision check - if block_shape == BLOCK_SHAPE.deref() { + if block_state.is_shape_full() { if !self.aabb.intersects_aabb(&AABB { min_x: item.pos.x as f64, min_y: item.pos.y as f64, @@ -103,13 +131,15 @@ impl<'a> Iterator for BlockCollisions<'a> { continue; } - return Some(block_shape.move_relative( + return Some(BLOCK_SHAPE.move_relative( item.pos.x as f64, item.pos.y as f64, item.pos.z as f64, )); } + let block_shape = block_state.shape(); + let block_shape = block_shape.move_relative(item.pos.x as f64, item.pos.y as f64, item.pos.z as f64); // if the entity shape and block shape don't collide, continue diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index b2d9b9df8..20e3a261c 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -19,7 +19,6 @@ azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } bevy_ecs = "0.13.0" derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } -enum-as-inner = "0.6.0" tracing = "0.1.40" nohash-hasher = "0.2.0" once_cell = "1.19.0" @@ -28,6 +27,7 @@ thiserror = "1.0.57" uuid = "1.7.0" serde_json = "1.0.113" serde = "1.0.196" +rustc-hash = "1.1.0" [dev-dependencies] azalea-client = { path = "../azalea-client" } diff --git a/azalea-world/src/container.rs b/azalea-world/src/container.rs index 0b68ead68..69b8f9084 100644 --- a/azalea-world/src/container.rs +++ b/azalea-world/src/container.rs @@ -3,6 +3,7 @@ use bevy_ecs::{component::Component, system::Resource}; use derive_more::{Deref, DerefMut}; use nohash_hasher::IntMap; use parking_lot::RwLock; +use rustc_hash::FxHashMap; use std::{ collections::HashMap, sync::{Arc, Weak}, @@ -27,7 +28,7 @@ pub struct InstanceContainer { // telling them apart. We hope most servers are nice and don't do that though. It's only an // issue when there's multiple clients with the same WorldContainer in different worlds // anyways. - pub instances: HashMap>>, + pub instances: FxHashMap>>, } impl InstanceContainer { diff --git a/azalea/Cargo.toml b/azalea/Cargo.toml index 8a11fc463..d1d9a4f87 100644 --- a/azalea/Cargo.toml +++ b/azalea/Cargo.toml @@ -57,3 +57,7 @@ log = ["azalea-client/log"] [[bench]] name = "pathfinder" harness = false + +[[bench]] +name = "physics" +harness = false diff --git a/azalea/benches/physics.rs b/azalea/benches/physics.rs new file mode 100644 index 000000000..6f8dc7bc2 --- /dev/null +++ b/azalea/benches/physics.rs @@ -0,0 +1,144 @@ +use std::{hint::black_box, sync::Arc, time::Duration}; + +use azalea::{ + pathfinder::{ + astar::{self, a_star}, + goals::{BlockPosGoal, Goal}, + mining::MiningCache, + simulation::{SimulatedPlayerBundle, Simulation, SimulationSet}, + world::CachedWorld, + }, + BlockPos, Vec3, +}; +use azalea_core::position::{ChunkBlockPos, ChunkPos}; +use azalea_inventory::Menu; +use azalea_world::{Chunk, ChunkStorage, PartialChunkStorage}; +use criterion::{criterion_group, criterion_main, Bencher, Criterion}; +use parking_lot::RwLock; + +#[allow(dead_code)] +fn generate_world(partial_chunks: &mut PartialChunkStorage, size: u32) -> ChunkStorage { + let size = size as i32; + + let mut chunks = ChunkStorage::default(); + for chunk_x in -size..size { + for chunk_z in -size..size { + let chunk_pos = ChunkPos::new(chunk_x, chunk_z); + partial_chunks.set(&chunk_pos, Some(Chunk::default()), &mut chunks); + } + } + + // for chunk_x in -size..size { + // for chunk_z in -size..size { + // let chunk_pos = ChunkPos::new(chunk_x, chunk_z); + // let chunk = chunks.get(&chunk_pos).unwrap(); + // let mut chunk = chunk.write(); + // for x in 0..16_u8 { + // for z in 0..16_u8 { + // chunk.set( + // &ChunkBlockPos::new(x, 1, z), + // azalea_registry::Block::Bedrock.into(), + // chunks.min_y, + // ); + // if rng.gen_bool(0.5) { + // chunk.set( + // &ChunkBlockPos::new(x, 2, z), + // azalea_registry::Block::Bedrock.into(), + // chunks.min_y, + // ); + // } + // } + // } + // } + // } + + // let mut start = BlockPos::new(-64, 4, -64); + // // move start down until it's on a solid block + // while chunks.get_block_state(&start).unwrap().is_air() { + // start = start.down(1); + // } + // start = start.up(1); + + // let mut end = BlockPos::new(63, 4, 63); + // // move end down until it's on a solid block + // while chunks.get_block_state(&end).unwrap().is_air() { + // end = end.down(1); + // } + // end = end.up(1); + + chunks +} + +fn generate_mining_world( + partial_chunks: &mut PartialChunkStorage, + size: u32, +) -> (ChunkStorage, BlockPos, BlockPos) { + let size = size as i32; + + let mut chunks = ChunkStorage::default(); + for chunk_x in -size..size { + for chunk_z in -size..size { + let chunk_pos = ChunkPos::new(chunk_x, chunk_z); + partial_chunks.set(&chunk_pos, Some(Chunk::default()), &mut chunks); + } + } + + // let mut rng = StdRng::seed_from_u64(0); + + for chunk_x in -size..size { + for chunk_z in -size..size { + let chunk_pos = ChunkPos::new(chunk_x, chunk_z); + let chunk = chunks.get(&chunk_pos).unwrap(); + let mut chunk = chunk.write(); + for y in chunks.min_y..(chunks.min_y + chunks.height as i32) { + for x in 0..16_u8 { + for z in 0..16_u8 { + chunk.set( + &ChunkBlockPos::new(x, y, z), + azalea_registry::Block::Stone.into(), + chunks.min_y, + ); + } + } + } + } + } + + let start = BlockPos::new(-64, 4, -64); + let end = BlockPos::new(0, 4, 0); + + (chunks, start, end) +} + +fn run_physics_benchmark(b: &mut Bencher<'_>) { + let mut partial_chunks = PartialChunkStorage::new(32); + + let world = generate_world(&mut partial_chunks, 4); + + let mut simulation_set = SimulationSet::new(world); + + // let entity = simulation_set.spawn(SimulatedPlayerBundle::new(Vec3::new(0.0, + // 4.0, 0.0))); for _ in 0..20 { + // simulation_set.tick(); + // println!("tick over"); + // } + // simulation_set.despawn(entity); + // std::process::exit(0); + + b.iter(|| { + let entity = simulation_set.spawn(SimulatedPlayerBundle::new(Vec3::new(0.0, 4.0, 0.0))); + for _ in 0..20 { + simulation_set.tick(); + } + simulation_set.despawn(entity); + }) +} + +fn bench_pathfinder(c: &mut Criterion) { + c.bench_function("physics", |b| { + run_physics_benchmark(b); + }); +} + +criterion_group!(benches, bench_pathfinder); +criterion_main!(benches); diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs index bea99e934..a5e8113f7 100644 --- a/azalea/src/pathfinder/simulation.rs +++ b/azalea/src/pathfinder/simulation.rs @@ -113,8 +113,7 @@ fn create_simulation_player( )); entity.insert(player); - let entity_id = entity.id(); - entity_id + entity.id() } /// Simulate the Minecraft world to see if certain movements would be possible. From e47dee388e1e7f051417244ab1c054f8b9acd755 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 25 Feb 2024 22:31:56 -0600 Subject: [PATCH 26/37] reduce allocations for collision detection --- Cargo.lock | 1 + azalea-block/src/lib.rs | 2 + azalea-physics/Cargo.toml | 1 + .../src/collision/discrete_voxel_shape.rs | 2 + azalea-physics/src/collision/shape.rs | 71 ++++++++++------ .../src/collision/world_collisions.rs | 23 +++++- azalea/benches/physics.rs | 82 ++++--------------- 7 files changed, 90 insertions(+), 92 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 168ac60bf..6f228d2de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -460,6 +460,7 @@ dependencies = [ "nohash-hasher", "once_cell", "parking_lot", + "smallvec", "tracing", "uuid", ] diff --git a/azalea-block/src/lib.rs b/azalea-block/src/lib.rs index dc41b4055..2a46fd010 100755 --- a/azalea-block/src/lib.rs +++ b/azalea-block/src/lib.rs @@ -59,6 +59,8 @@ impl BlockState { state_id <= Self::max_state() } + /// Returns true if the block is air. This only checks for normal air, not + /// other types like cave air. #[inline] pub fn is_air(&self) -> bool { self == &Self::AIR diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index 043c0548c..7b7628961 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -21,6 +21,7 @@ tracing = "0.1.40" once_cell = "1.19.0" parking_lot = "^0.12.1" nohash-hasher = "0.2.0" +smallvec = "1.13.1" [dev-dependencies] bevy_time = "0.13.0" diff --git a/azalea-physics/src/collision/discrete_voxel_shape.rs b/azalea-physics/src/collision/discrete_voxel_shape.rs index f63b7c2af..211e63032 100755 --- a/azalea-physics/src/collision/discrete_voxel_shape.rs +++ b/azalea-physics/src/collision/discrete_voxel_shape.rs @@ -13,6 +13,7 @@ pub enum DiscreteVoxelShape { } impl DiscreteVoxelShape { + #[inline] pub fn size(&self, axis: Axis) -> u32 { match self { DiscreteVoxelShape::BitSet(shape) => shape.size(axis), @@ -305,6 +306,7 @@ impl BitSetDiscreteVoxelShape { } impl BitSetDiscreteVoxelShape { + #[inline] fn size(&self, axis: Axis) -> u32 { axis.choose(self.x_size, self.y_size, self.z_size) } diff --git a/azalea-physics/src/collision/shape.rs b/azalea-physics/src/collision/shape.rs index 41ade73cb..56befa393 100755 --- a/azalea-physics/src/collision/shape.rs +++ b/azalea-physics/src/collision/shape.rs @@ -169,22 +169,22 @@ impl Shapes { // var5.getList(), var6.getList(), var7.getList())); let var5 = Self::create_index_merger( 1, - a.get_coords(Axis::X), - b.get_coords(Axis::X), + a.get_coords(Axis::X).to_vec(), + b.get_coords(Axis::X).to_vec(), op_true_false, op_false_true, ); let var6 = Self::create_index_merger( (var5.size() - 1).try_into().unwrap(), - a.get_coords(Axis::Y), - b.get_coords(Axis::Y), + a.get_coords(Axis::Y).to_vec(), + b.get_coords(Axis::Y).to_vec(), op_true_false, op_false_true, ); let var7 = Self::create_index_merger( ((var5.size() - 1) * (var6.size() - 1)).try_into().unwrap(), - a.get_coords(Axis::Z), - b.get_coords(Axis::Z), + a.get_coords(Axis::Z).to_vec(), + b.get_coords(Axis::Z).to_vec(), op_true_false, op_false_true, ); @@ -233,22 +233,22 @@ impl Shapes { let x_merger = Self::create_index_merger( 1, - a.get_coords(Axis::X), - b.get_coords(Axis::X), + a.get_coords(Axis::X).to_vec(), + b.get_coords(Axis::X).to_vec(), op_true_false, op_false_true, ); let y_merger = Self::create_index_merger( (x_merger.size() - 1) as i32, - a.get_coords(Axis::Y), - b.get_coords(Axis::Y), + a.get_coords(Axis::Y).to_vec(), + b.get_coords(Axis::Y).to_vec(), op_true_false, op_false_true, ); let z_merger = Self::create_index_merger( ((x_merger.size() - 1) * (y_merger.size() - 1)) as i32, - a.get_coords(Axis::Z), - b.get_coords(Axis::Z), + a.get_coords(Axis::Z).to_vec(), + b.get_coords(Axis::Z).to_vec(), op_true_false, op_false_true, ); @@ -361,7 +361,7 @@ impl VoxelShape { } } - pub fn get_coords(&self, axis: Axis) -> Vec { + pub fn get_coords(&self, axis: Axis) -> &[f64] { match self { VoxelShape::Array(s) => s.get_coords(axis), VoxelShape::Cube(s) => s.get_coords(axis), @@ -625,6 +625,10 @@ pub struct CubeVoxelShape { // TODO: check where faces is used in minecraft #[allow(dead_code)] faces: Option>, + + x_coords: Vec, + y_coords: Vec, + z_coords: Vec, } impl ArrayVoxelShape { @@ -634,9 +638,9 @@ impl ArrayVoxelShape { let z_size = shape.size(Axis::Z) + 1; // Lengths of point arrays must be consistent with the size of the VoxelShape. - assert_eq!(x_size, xs.len() as u32); - assert_eq!(y_size, ys.len() as u32); - assert_eq!(z_size, zs.len() as u32); + debug_assert_eq!(x_size, xs.len() as u32); + debug_assert_eq!(y_size, ys.len() as u32); + debug_assert_eq!(z_size, zs.len() as u32); Self { faces: None, @@ -648,19 +652,30 @@ impl ArrayVoxelShape { } } -impl CubeVoxelShape { - pub fn new(shape: DiscreteVoxelShape) -> Self { - Self { shape, faces: None } - } -} - impl ArrayVoxelShape { fn shape(&self) -> &DiscreteVoxelShape { &self.shape } - fn get_coords(&self, axis: Axis) -> Vec { - axis.choose(self.xs.clone(), self.ys.clone(), self.zs.clone()) + fn get_coords(&self, axis: Axis) -> &[f64] { + axis.choose(&self.xs, &self.ys, &self.zs) + } +} + +impl CubeVoxelShape { + pub fn new(shape: DiscreteVoxelShape) -> Self { + // pre-calculate the coor + let x_coords = Self::calculate_coords(&shape, Axis::X); + let y_coords = Self::calculate_coords(&shape, Axis::Y); + let z_coords = Self::calculate_coords(&shape, Axis::Z); + + Self { + shape, + faces: None, + x_coords, + y_coords, + z_coords, + } } } @@ -669,8 +684,8 @@ impl CubeVoxelShape { &self.shape } - fn get_coords(&self, axis: Axis) -> Vec { - let size = self.shape.size(axis); + fn calculate_coords(shape: &DiscreteVoxelShape, axis: Axis) -> Vec { + let size = shape.size(axis); let mut parts = Vec::with_capacity(size as usize); for i in 0..=size { parts.push(i as f64 / size as f64); @@ -678,6 +693,10 @@ impl CubeVoxelShape { parts } + fn get_coords(&self, axis: Axis) -> &[f64] { + axis.choose(&self.x_coords, &self.y_coords, &self.z_coords) + } + fn find_index(&self, axis: Axis, coord: f64) -> i32 { let n = self.shape().size(axis); (f64::clamp(coord * (n as f64), -1f64, n as f64)) as i32 diff --git a/azalea-physics/src/collision/world_collisions.rs b/azalea-physics/src/collision/world_collisions.rs index cb721f004..8493b8472 100644 --- a/azalea-physics/src/collision/world_collisions.rs +++ b/azalea-physics/src/collision/world_collisions.rs @@ -22,6 +22,7 @@ pub struct BlockCollisions<'a> { pub only_suffocating_blocks: bool, cached_sections: Vec<(ChunkSectionPos, azalea_world::Section)>, + cached_block_shapes: Vec<(BlockState, &'static VoxelShape)>, } impl<'a> BlockCollisions<'a> { @@ -44,6 +45,7 @@ impl<'a> BlockCollisions<'a> { only_suffocating_blocks: false, cached_sections: Vec::new(), + cached_block_shapes: Vec::new(), } } @@ -95,8 +97,27 @@ impl<'a> BlockCollisions<'a> { self.cached_sections.push((section_pos, section.clone())); + // println!( + // "chunk section length: {}", + // section.states.storage.data.len() + // ); + // println!("biome length: {}", section.biomes.storage.data.len()); + section.get(section_block_pos) } + + fn get_block_shape(&mut self, block_state: BlockState) -> &'static VoxelShape { + for (cached_block_state, cached_shape) in &self.cached_block_shapes { + if block_state == *cached_block_state { + return cached_shape; + } + } + + let shape = block_state.shape(); + self.cached_block_shapes.push((block_state, shape)); + + shape + } } impl<'a> Iterator for BlockCollisions<'a> { @@ -138,7 +159,7 @@ impl<'a> Iterator for BlockCollisions<'a> { )); } - let block_shape = block_state.shape(); + let block_shape = self.get_block_shape(block_state); let block_shape = block_shape.move_relative(item.pos.x as f64, item.pos.y as f64, item.pos.z as f64); diff --git a/azalea/benches/physics.rs b/azalea/benches/physics.rs index 6f8dc7bc2..0d4a3f2fa 100644 --- a/azalea/benches/physics.rs +++ b/azalea/benches/physics.rs @@ -28,29 +28,22 @@ fn generate_world(partial_chunks: &mut PartialChunkStorage, size: u32) -> ChunkS } } - // for chunk_x in -size..size { - // for chunk_z in -size..size { - // let chunk_pos = ChunkPos::new(chunk_x, chunk_z); - // let chunk = chunks.get(&chunk_pos).unwrap(); - // let mut chunk = chunk.write(); - // for x in 0..16_u8 { - // for z in 0..16_u8 { - // chunk.set( - // &ChunkBlockPos::new(x, 1, z), - // azalea_registry::Block::Bedrock.into(), - // chunks.min_y, - // ); - // if rng.gen_bool(0.5) { - // chunk.set( - // &ChunkBlockPos::new(x, 2, z), - // azalea_registry::Block::Bedrock.into(), - // chunks.min_y, - // ); - // } - // } - // } - // } - // } + for chunk_x in -size..size { + for chunk_z in -size..size { + let chunk_pos = ChunkPos::new(chunk_x, chunk_z); + let chunk = chunks.get(&chunk_pos).unwrap(); + let mut chunk = chunk.write(); + for x in 0..16_u8 { + for z in 0..16_u8 { + chunk.set( + &ChunkBlockPos::new(x, 1, z), + azalea_registry::Block::OakFence.into(), + chunks.min_y, + ); + } + } + } + } // let mut start = BlockPos::new(-64, 4, -64); // // move start down until it's on a solid block @@ -69,47 +62,6 @@ fn generate_world(partial_chunks: &mut PartialChunkStorage, size: u32) -> ChunkS chunks } -fn generate_mining_world( - partial_chunks: &mut PartialChunkStorage, - size: u32, -) -> (ChunkStorage, BlockPos, BlockPos) { - let size = size as i32; - - let mut chunks = ChunkStorage::default(); - for chunk_x in -size..size { - for chunk_z in -size..size { - let chunk_pos = ChunkPos::new(chunk_x, chunk_z); - partial_chunks.set(&chunk_pos, Some(Chunk::default()), &mut chunks); - } - } - - // let mut rng = StdRng::seed_from_u64(0); - - for chunk_x in -size..size { - for chunk_z in -size..size { - let chunk_pos = ChunkPos::new(chunk_x, chunk_z); - let chunk = chunks.get(&chunk_pos).unwrap(); - let mut chunk = chunk.write(); - for y in chunks.min_y..(chunks.min_y + chunks.height as i32) { - for x in 0..16_u8 { - for z in 0..16_u8 { - chunk.set( - &ChunkBlockPos::new(x, y, z), - azalea_registry::Block::Stone.into(), - chunks.min_y, - ); - } - } - } - } - } - - let start = BlockPos::new(-64, 4, -64); - let end = BlockPos::new(0, 4, 0); - - (chunks, start, end) -} - fn run_physics_benchmark(b: &mut Bencher<'_>) { let mut partial_chunks = PartialChunkStorage::new(32); @@ -126,7 +78,7 @@ fn run_physics_benchmark(b: &mut Bencher<'_>) { // std::process::exit(0); b.iter(|| { - let entity = simulation_set.spawn(SimulatedPlayerBundle::new(Vec3::new(0.0, 4.0, 0.0))); + let entity = simulation_set.spawn(SimulatedPlayerBundle::new(Vec3::new(0.5, 2.0, 0.5))); for _ in 0..20 { simulation_set.tick(); } From 4f288b1c031065805f5eb11362fe762f2e295c12 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 26 Feb 2024 00:55:27 -0600 Subject: [PATCH 27/37] optimize physics a bit more --- azalea-core/src/cursor3d.rs | 35 ++-- azalea-entity/src/lib.rs | 2 +- azalea-physics/src/collision/mergers.rs | 54 ++++--- azalea-physics/src/collision/mod.rs | 1 - azalea-physics/src/collision/shape.rs | 70 ++++---- .../src/collision/world_collisions.rs | 151 ++++++++++-------- azalea/src/pathfinder/simulation.rs | 20 ++- 7 files changed, 176 insertions(+), 157 deletions(-) diff --git a/azalea-core/src/cursor3d.rs b/azalea-core/src/cursor3d.rs index 0594a80a6..dc96d890d 100755 --- a/azalea-core/src/cursor3d.rs +++ b/azalea-core/src/cursor3d.rs @@ -3,9 +3,7 @@ use crate::position::BlockPos; pub struct Cursor3d { index: usize, - origin_x: i32, - origin_y: i32, - origin_z: i32, + origin: BlockPos, width: usize, height: usize, @@ -14,6 +12,12 @@ pub struct Cursor3d { end: usize, } +impl Cursor3d { + pub fn origin(&self) -> BlockPos { + self.origin + } +} + impl Iterator for Cursor3d { type Item = CursorIteration; @@ -40,9 +44,9 @@ impl Iterator for Cursor3d { Some(CursorIteration { pos: BlockPos { - x: self.origin_x + x as i32, - y: self.origin_y + y as i32, - z: self.origin_z + z as i32, + x: self.origin.x + x as i32, + y: self.origin.y + y as i32, + z: self.origin.z + z as i32, }, iteration_type: iteration_type.into(), }) @@ -64,30 +68,21 @@ pub struct CursorIteration { } impl Cursor3d { - pub fn new( - origin_x: i32, - origin_y: i32, - origin_z: i32, - end_x: i32, - end_y: i32, - end_z: i32, - ) -> Self { - let width = (end_x - origin_x + 1) + pub fn new(origin: BlockPos, end: BlockPos) -> Self { + let width = (end.x - origin.x + 1) .try_into() .expect("Impossible width."); - let height = (end_y - origin_y + 1) + let height = (end.y - origin.y + 1) .try_into() .expect("Impossible height."); - let depth = (end_z - origin_z + 1) + let depth = (end.z - origin.z + 1) .try_into() .expect("Impossible depth."); Self { index: 0, - origin_x, - origin_y, - origin_z, + origin, width, height, diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index 1b643e4a4..dd818c6dc 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -410,7 +410,7 @@ pub struct PlayerBundle { /// be updated by other clients. /// /// If this is for a client then all of our clients will have this. -#[derive(Component)] +#[derive(Component, Clone)] pub struct LocalEntity; #[derive(Component, Clone, Debug, PartialEq, Deref, DerefMut)] diff --git a/azalea-physics/src/collision/mergers.rs b/azalea-physics/src/collision/mergers.rs index 69ae2ab57..c43412d12 100755 --- a/azalea-physics/src/collision/mergers.rs +++ b/azalea-physics/src/collision/mergers.rs @@ -1,4 +1,4 @@ -use std::cmp::Ordering; +use std::cmp::{self, Ordering}; use super::CubePointRange; use azalea_core::math::{gcd, lcm, EPSILON}; @@ -135,27 +135,27 @@ impl IndexMerger { } } - pub fn new_indirect(var1: &[f64], var2: &[f64], var3: bool, var4: bool) -> Self { + pub fn new_indirect(coords1: &[f64], coords2: &[f64], var3: bool, var4: bool) -> Self { let mut var5 = f64::NAN; - let var7 = var1.len(); - let var8 = var2.len(); - let var9 = var7 + var8; - let mut result = vec![0.0; var9]; - let mut first_indices: Vec = vec![0; var9]; - let mut second_indices: Vec = vec![0; var9]; + let coords1_len = coords1.len(); + let coords2_len = coords2.len(); + let number_of_indices = coords1_len + coords2_len; + let mut result = vec![0.0; number_of_indices]; + let mut first_indices: Vec = vec![0; number_of_indices]; + let mut second_indices: Vec = vec![0; number_of_indices]; let var10 = !var3; let var11 = !var4; let mut var12 = 0; - let mut var13 = 0; - let mut var14 = 0; + let mut coords1_index = 0; + let mut coords2_index = 0; loop { - let mut var17: bool; + let mut iterating_coords1: bool; loop { - let var15 = var13 >= var7; - let var16 = var14 >= var8; - if var15 && var16 { - let result_length = std::cmp::max(1, var12); + let at_end_of_coords1 = coords1_index >= coords1_len; + let at_end_of_coords2 = coords2_index >= coords2_len; + if at_end_of_coords1 && at_end_of_coords2 { + let result_length = cmp::max(1, var12); return Self::Indirect { result, first_indices, @@ -164,26 +164,28 @@ impl IndexMerger { }; } - var17 = !var15 && (var16 || var1[var13] < var2[var14] + EPSILON); - if var17 { - var13 += 1; - if !var10 || var14 != 0 && !var16 { + iterating_coords1 = !at_end_of_coords1 + && (at_end_of_coords2 + || coords1[coords1_index] < coords2[coords2_index] + EPSILON); + if iterating_coords1 { + coords1_index += 1; + if !var10 || coords2_index != 0 && !at_end_of_coords2 { break; } } else { - var14 += 1; - if !var11 || var13 != 0 && !var15 { + coords2_index += 1; + if !var11 || coords1_index != 0 && !at_end_of_coords1 { break; } } } - let var18: isize = (var13 as isize) - 1; - let var19: isize = (var14 as isize) - 1; - let var20 = if var17 { - var1[TryInto::::try_into(var18).unwrap()] + let var18: isize = (coords1_index as isize) - 1; + let var19: isize = (coords2_index as isize) - 1; + let var20 = if iterating_coords1 { + coords1[usize::try_from(var18).unwrap()] } else { - var2[TryInto::::try_into(var19).unwrap()] + coords2[usize::try_from(var19).unwrap()] }; match var5.partial_cmp(&(var20 - EPSILON)) { None | Some(Ordering::Less) => { diff --git a/azalea-physics/src/collision/mod.rs b/azalea-physics/src/collision/mod.rs index 72151b6b3..3986dc477 100644 --- a/azalea-physics/src/collision/mod.rs +++ b/azalea-physics/src/collision/mod.rs @@ -266,7 +266,6 @@ fn collide_bounding_box( let block_collisions = get_block_collisions(world, entity_bounding_box.expand_towards(movement)); - let block_collisions = block_collisions.collect::>(); collision_boxes.extend(block_collisions); collide_with_shapes(movement, *entity_bounding_box, &collision_boxes) } diff --git a/azalea-physics/src/collision/shape.rs b/azalea-physics/src/collision/shape.rs index 56befa393..710074de2 100755 --- a/azalea-physics/src/collision/shape.rs +++ b/azalea-physics/src/collision/shape.rs @@ -169,22 +169,22 @@ impl Shapes { // var5.getList(), var6.getList(), var7.getList())); let var5 = Self::create_index_merger( 1, - a.get_coords(Axis::X).to_vec(), - b.get_coords(Axis::X).to_vec(), + a.get_coords(Axis::X), + b.get_coords(Axis::X), op_true_false, op_false_true, ); let var6 = Self::create_index_merger( (var5.size() - 1).try_into().unwrap(), - a.get_coords(Axis::Y).to_vec(), - b.get_coords(Axis::Y).to_vec(), + a.get_coords(Axis::Y), + b.get_coords(Axis::Y), op_true_false, op_false_true, ); let var7 = Self::create_index_merger( ((var5.size() - 1) * (var6.size() - 1)).try_into().unwrap(), - a.get_coords(Axis::Z).to_vec(), - b.get_coords(Axis::Z).to_vec(), + a.get_coords(Axis::Z), + b.get_coords(Axis::Z), op_true_false, op_false_true, ); @@ -208,8 +208,12 @@ impl Shapes { /// Check if the op is true anywhere when joining the two shapes /// vanilla calls this joinIsNotEmpty - pub fn matches_anywhere(a: &VoxelShape, b: &VoxelShape, op: fn(bool, bool) -> bool) -> bool { - assert!(!op(false, false)); + pub fn matches_anywhere( + a: &VoxelShape, + b: &VoxelShape, + op: impl Fn(bool, bool) -> bool, + ) -> bool { + debug_assert!(!op(false, false)); let a_is_empty = a.is_empty(); let b_is_empty = b.is_empty(); if a_is_empty || b_is_empty { @@ -233,22 +237,22 @@ impl Shapes { let x_merger = Self::create_index_merger( 1, - a.get_coords(Axis::X).to_vec(), - b.get_coords(Axis::X).to_vec(), + a.get_coords(Axis::X), + b.get_coords(Axis::X), op_true_false, op_false_true, ); let y_merger = Self::create_index_merger( (x_merger.size() - 1) as i32, - a.get_coords(Axis::Y).to_vec(), - b.get_coords(Axis::Y).to_vec(), + a.get_coords(Axis::Y), + b.get_coords(Axis::Y), op_true_false, op_false_true, ); let z_merger = Self::create_index_merger( ((x_merger.size() - 1) * (y_merger.size() - 1)) as i32, - a.get_coords(Axis::Z).to_vec(), - b.get_coords(Axis::Z).to_vec(), + a.get_coords(Axis::Z), + b.get_coords(Axis::Z), op_true_false, op_false_true, ); @@ -269,7 +273,7 @@ impl Shapes { merged_z: IndexMerger, shape1: DiscreteVoxelShape, shape2: DiscreteVoxelShape, - op: fn(bool, bool) -> bool, + op: impl Fn(bool, bool) -> bool, ) -> bool { !merged_x.for_merged_indexes(|var5x, var6, _var7| { merged_y.for_merged_indexes(|var6x, var7x, _var8| { @@ -285,13 +289,13 @@ impl Shapes { pub fn create_index_merger( _var0: i32, - var1: Vec, - var2: Vec, + coords1: &[f64], + coords2: &[f64], var3: bool, var4: bool, ) -> IndexMerger { - let var5 = var1.len() - 1; - let var6 = var2.len() - 1; + let var5 = coords1.len() - 1; + let var6 = coords2.len() - 1; // if (&var1 as &dyn Any).is::() && (&var2 as &dyn // Any).is::() { // return new DiscreteCubeMerger(var0, var5, var6, var3, var4); @@ -302,22 +306,24 @@ impl Shapes { // } // } - if var1[var5] < var2[0] - EPSILON { + if coords1[var5] < coords2[0] - EPSILON { IndexMerger::NonOverlapping { - lower: var1, - upper: var2, + lower: coords1.to_vec(), + upper: coords2.to_vec(), swap: false, } - } else if var2[var6] < var1[0] - EPSILON { + } else if coords2[var6] < coords1[0] - EPSILON { IndexMerger::NonOverlapping { - lower: var2, - upper: var1, + lower: coords2.to_vec(), + upper: coords1.to_vec(), swap: true, } - } else if var5 == var6 && var1 == var2 { - IndexMerger::Identical { coords: var1 } + } else if var5 == var6 && coords1 == coords2 { + IndexMerger::Identical { + coords: coords1.to_vec(), + } } else { - IndexMerger::new_indirect(&var1, &var2, var3, var4) + IndexMerger::new_indirect(&coords1, &coords2, var3, var4) } } } @@ -386,6 +392,7 @@ impl VoxelShape { )) } + #[inline] pub fn get(&self, axis: Axis, index: usize) -> f64 { // self.get_coords(axis)[index] match self { @@ -403,9 +410,8 @@ impl VoxelShape { match self { VoxelShape::Cube(s) => s.find_index(axis, coord), _ => { - binary_search(0, (self.shape().size(axis) + 1) as i32, &|t| { - coord < self.get(axis, t as usize) - }) - 1 + let upper_limit = (self.shape().size(axis) + 1) as i32; + binary_search(0, upper_limit, &|t| coord < self.get(axis, t as usize)) - 1 } } } @@ -657,6 +663,7 @@ impl ArrayVoxelShape { &self.shape } + #[inline] fn get_coords(&self, axis: Axis) -> &[f64] { axis.choose(&self.xs, &self.ys, &self.zs) } @@ -693,6 +700,7 @@ impl CubeVoxelShape { parts } + #[inline] fn get_coords(&self, axis: Axis) -> &[f64] { axis.choose(&self.x_coords, &self.y_coords, &self.z_coords) } diff --git a/azalea-physics/src/collision/world_collisions.rs b/azalea-physics/src/collision/world_collisions.rs index 8493b8472..54493d622 100644 --- a/azalea-physics/src/collision/world_collisions.rs +++ b/azalea-physics/src/collision/world_collisions.rs @@ -4,17 +4,79 @@ use azalea_block::BlockState; use azalea_core::{ cursor3d::{Cursor3d, CursorIterationType}, math::EPSILON, - position::{BlockPos, ChunkPos, ChunkSectionBlockPos, ChunkSectionPos}, + position::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos, ChunkSectionPos}, }; use azalea_world::{Chunk, Instance}; use parking_lot::RwLock; use std::sync::Arc; -pub fn get_block_collisions(world: &Instance, aabb: AABB) -> BlockCollisions<'_> { - BlockCollisions::new(world, aabb) +pub fn get_block_collisions(world: &Instance, aabb: AABB) -> Vec { + let mut state = BlockCollisionsState::new(world, aabb); + let mut block_collisions = Vec::new(); + + let initial_chunk_pos = ChunkPos::from(state.cursor.origin()); + let initial_chunk = world.chunks.get(&initial_chunk_pos).unwrap(); + let initial_chunk = initial_chunk.read(); + + while let Some(item) = state.cursor.next() { + if item.iteration_type == CursorIterationType::Corner { + continue; + } + + let item_chunk_pos = ChunkPos::from(item.pos); + let block_state: BlockState = if item_chunk_pos == initial_chunk_pos { + initial_chunk + .get(&ChunkBlockPos::from(item.pos), state.world.chunks.min_y) + .unwrap_or(BlockState::AIR) + } else { + state.get_block_state(item.pos) + }; + + if block_state.is_air() { + // fast path since we can't collide with air + continue; + } + + // TODO: continue if self.only_suffocating_blocks and the block is not + // suffocating + + // if it's a full block do a faster collision check + if block_state.is_shape_full() { + if !state.aabb.intersects_aabb(&AABB { + min_x: item.pos.x as f64, + min_y: item.pos.y as f64, + min_z: item.pos.z as f64, + max_x: (item.pos.x + 1) as f64, + max_y: (item.pos.y + 1) as f64, + max_z: (item.pos.z + 1) as f64, + }) { + continue; + } + + block_collisions.push(BLOCK_SHAPE.move_relative( + item.pos.x as f64, + item.pos.y as f64, + item.pos.z as f64, + )); + continue; + } + + let block_shape = state.get_block_shape(block_state); + + let block_shape = + block_shape.move_relative(item.pos.x as f64, item.pos.y as f64, item.pos.z as f64); + // if the entity shape and block shape don't collide, continue + if !Shapes::matches_anywhere(&block_shape, &state.entity_shape, |a, b| a && b) { + continue; + } + + block_collisions.push(block_shape); + } + + block_collisions } -pub struct BlockCollisions<'a> { +pub struct BlockCollisionsState<'a> { pub world: &'a Instance, pub aabb: AABB, pub entity_shape: VoxelShape, @@ -25,17 +87,21 @@ pub struct BlockCollisions<'a> { cached_block_shapes: Vec<(BlockState, &'static VoxelShape)>, } -impl<'a> BlockCollisions<'a> { +impl<'a> BlockCollisionsState<'a> { pub fn new(world: &'a Instance, aabb: AABB) -> Self { - let origin_x = (aabb.min_x - EPSILON).floor() as i32 - 1; - let origin_y = (aabb.min_y - EPSILON).floor() as i32 - 1; - let origin_z = (aabb.min_z - EPSILON).floor() as i32 - 1; + let origin = BlockPos { + x: (aabb.min_x - EPSILON).floor() as i32 - 1, + y: (aabb.min_y - EPSILON).floor() as i32 - 1, + z: (aabb.min_z - EPSILON).floor() as i32 - 1, + }; - let end_x = (aabb.max_x + EPSILON).floor() as i32 + 1; - let end_y = (aabb.max_y + EPSILON).floor() as i32 + 1; - let end_z = (aabb.max_z + EPSILON).floor() as i32 + 1; + let end = BlockPos { + x: (aabb.max_x + EPSILON).floor() as i32 + 1, + y: (aabb.max_y + EPSILON).floor() as i32 + 1, + z: (aabb.max_z + EPSILON).floor() as i32 + 1, + }; - let cursor = Cursor3d::new(origin_x, origin_y, origin_z, end_x, end_y, end_z); + let cursor = Cursor3d::new(origin, end); Self { world, @@ -97,10 +163,8 @@ impl<'a> BlockCollisions<'a> { self.cached_sections.push((section_pos, section.clone())); - // println!( - // "chunk section length: {}", - // section.states.storage.data.len() - // ); + // println!("chunk section palette: {:?}", section.states.palette); + // println!("chunk section data: {:?}", section.states.storage.data); // println!("biome length: {}", section.biomes.storage.data.len()); section.get(section_block_pos) @@ -119,58 +183,3 @@ impl<'a> BlockCollisions<'a> { shape } } - -impl<'a> Iterator for BlockCollisions<'a> { - type Item = VoxelShape; - - fn next(&mut self) -> Option { - while let Some(item) = self.cursor.next() { - if item.iteration_type == CursorIterationType::Corner { - continue; - } - - let block_state = self.get_block_state(item.pos); - - if block_state.is_air() { - // fast path since we can't collide with air - continue; - } - - // TODO: continue if self.only_suffocating_blocks and the block is not - // suffocating - - // if it's a full block do a faster collision check - if block_state.is_shape_full() { - if !self.aabb.intersects_aabb(&AABB { - min_x: item.pos.x as f64, - min_y: item.pos.y as f64, - min_z: item.pos.z as f64, - max_x: (item.pos.x + 1) as f64, - max_y: (item.pos.y + 1) as f64, - max_z: (item.pos.z + 1) as f64, - }) { - continue; - } - - return Some(BLOCK_SHAPE.move_relative( - item.pos.x as f64, - item.pos.y as f64, - item.pos.z as f64, - )); - } - - let block_shape = self.get_block_shape(block_state); - - let block_shape = - block_shape.move_relative(item.pos.x as f64, item.pos.y as f64, item.pos.z as f64); - // if the entity shape and block shape don't collide, continue - if !Shapes::matches_anywhere(&block_shape, &self.entity_shape, |a, b| a && b) { - continue; - } - - return Some(block_shape); - } - - None - } -} diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs index a5e8113f7..2803b846f 100644 --- a/azalea/src/pathfinder/simulation.rs +++ b/azalea/src/pathfinder/simulation.rs @@ -87,14 +87,13 @@ fn create_simulation_instance(chunks: ChunkStorage) -> (App, Arc>, - player: SimulatedPlayerBundle, -) -> Entity { + player: &SimulatedPlayerBundle, +) -> impl Bundle { let instance_name = simulation_instance_name(); - let mut entity = ecs.spawn(( + ( MinecraftEntityId(0), azalea_entity::LocalEntity, azalea_entity::metadata::PlayerMetadataBundle::default(), @@ -110,9 +109,16 @@ fn create_simulation_player( instance: instance.clone(), }, InventoryComponent::default(), - )); - entity.insert(player); + ) +} +fn create_simulation_player( + ecs: &mut World, + instance: Arc>, + player: SimulatedPlayerBundle, +) -> Entity { + let mut entity = ecs.spawn(create_simulation_player_complete_bundle(instance, &player)); + entity.insert(player); entity.id() } From 7fc31f9506df8a0ad532741576473aedd13786b1 Mon Sep 17 00:00:00 2001 From: veronoicc <64193056+veronoicc@users.noreply.github.com> Date: Fri, 8 Mar 2024 17:56:55 +0100 Subject: [PATCH 28/37] Update clientbound_game_event_packet.rs (#133) Added 2 new game even types --- .../src/packets/game/clientbound_game_event_packet.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azalea-protocol/src/packets/game/clientbound_game_event_packet.rs b/azalea-protocol/src/packets/game/clientbound_game_event_packet.rs index bd1b2ab61..2416f7c33 100755 --- a/azalea-protocol/src/packets/game/clientbound_game_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_game_event_packet.rs @@ -21,4 +21,6 @@ pub enum EventType { PufferFishSting = 9, GuardianElderEffect = 10, ImmediateRespawn = 11, + LimitedCrafting = 12, + WaitForLevelChunks = 13, } From 38bb98707e92747910793669d2f03dc7ee9533fd Mon Sep 17 00:00:00 2001 From: 1zuna Date: Thu, 21 Mar 2024 19:36:15 +0100 Subject: [PATCH 29/37] fix: GameOwnershipResponse key_id format (#138) --- azalea-auth/src/auth.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs index 7b5846c42..e0a75adff 100755 --- a/azalea-auth/src/auth.rs +++ b/azalea-auth/src/auth.rs @@ -238,6 +238,7 @@ pub struct MinecraftAuthResponse { pub struct GameOwnershipResponse { pub items: Vec, pub signature: String, + #[serde(rename = "keyId")] pub key_id: String, } From cadc5605ec143d391382a77a431b55b44f5c5153 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 26 Feb 2024 17:13:05 -0600 Subject: [PATCH 30/37] make recalculate_near_end_of_path public so other plugins can do .after(recalculate_near_end_of_path) --- azalea/src/pathfinder/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index 360c4df51..a1bdaaad3 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -618,7 +618,7 @@ fn check_for_path_obstruction( } } -fn recalculate_near_end_of_path( +pub fn recalculate_near_end_of_path( mut query: Query<(Entity, &mut Pathfinder, &mut ExecutingPath)>, mut walk_events: EventWriter, mut goto_events: EventWriter, From b66b5b6b9042c3817ebb6d426c5ecd523b271c32 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 9 Apr 2024 07:15:30 +0000 Subject: [PATCH 31/37] add functions to ClientBuilder and SwarmBuilder for custom addresses --- azalea/src/lib.rs | 21 +++++++++++++++++++++ azalea/src/swarm/mod.rs | 42 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index 84c215d54..6e18ff7d4 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -15,6 +15,8 @@ pub mod pathfinder; pub mod prelude; pub mod swarm; +use std::net::SocketAddr; + use app::Plugins; pub use azalea_auth as auth; pub use azalea_block as blocks; @@ -189,6 +191,25 @@ where } self.swarm.start(address).await } + + /// Do the same as [`Self::start`], but allow passing in a custom resolved + /// address. This is useful if the address you're connecting to doesn't + /// resolve to anything, like if the server uses the address field to pass + /// custom data (like Bungeecord or Forge). + pub async fn start_with_custom_resolved_address( + mut self, + account: Account, + address: impl TryInto, + resolved_address: SocketAddr, + ) -> Result { + self.swarm.accounts = vec![account]; + if self.swarm.states.is_empty() { + self.swarm.states = vec![S::default()]; + } + self.swarm + .start_with_custom_resolved_address(address, resolved_address) + .await + } } impl Default for ClientBuilder { fn default() -> Self { diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 6d3885ef1..2be56567e 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -296,6 +296,28 @@ where /// /// [`ServerAddress`]: azalea_protocol::ServerAddress pub async fn start(self, address: impl TryInto) -> Result { + // convert the TryInto into a ServerAddress + let address: ServerAddress = match address.try_into() { + Ok(address) => address, + Err(_) => return Err(StartError::InvalidAddress), + }; + + // resolve the address + let resolved_address = resolver::resolve_address(&address).await?; + + self.start_with_custom_resolved_address(address, resolved_address) + .await + } + + /// Do the same as [`Self::start`], but allow passing in a custom resolved + /// address. This is useful if the address you're connecting to doesn't + /// resolve to anything, like if the server uses the address field to pass + /// custom data (like Bungeecord or Forge). + pub async fn start_with_custom_resolved_address( + self, + address: impl TryInto, + resolved_address: SocketAddr, + ) -> Result { assert_eq!( self.accounts.len(), self.states.len(), @@ -308,9 +330,6 @@ where Err(_) => return Err(StartError::InvalidAddress), }; - // resolve the address - let resolved_address = resolver::resolve_address(&address).await?; - let instance_container = Arc::new(RwLock::new(InstanceContainer::default())); // we can't modify the swarm plugins after this @@ -528,6 +547,23 @@ impl Swarm { let address = self.address.read().clone(); let resolved_address = *self.resolved_address.read(); + self.add_with_custom_address(account, state, address, resolved_address) + .await + } + /// Add a new account to the swarm, using the given host and socket + /// address. This is useful if you want bots in the same swarm to connect to + /// different addresses. Usually you'll just want [`Self::add`] though. + /// + /// # Errors + /// + /// Returns an `Err` if the bot could not do a handshake successfully. + pub async fn add_with_custom_address( + &mut self, + account: &Account, + state: S, + address: ServerAddress, + resolved_address: SocketAddr, + ) -> Result { let (bot, mut rx) = Client::start_client( self.ecs_lock.clone(), account, From 8808ecef9416edca9c77296742a533e848fba075 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 18 Apr 2024 19:52:13 -0500 Subject: [PATCH 32/37] fix get_block_collisions panicking when starting in a non existent chunk --- azalea-physics/src/collision/world_collisions.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/azalea-physics/src/collision/world_collisions.rs b/azalea-physics/src/collision/world_collisions.rs index 54493d622..4a3c2c3b3 100644 --- a/azalea-physics/src/collision/world_collisions.rs +++ b/azalea-physics/src/collision/world_collisions.rs @@ -15,8 +15,8 @@ pub fn get_block_collisions(world: &Instance, aabb: AABB) -> Vec { let mut block_collisions = Vec::new(); let initial_chunk_pos = ChunkPos::from(state.cursor.origin()); - let initial_chunk = world.chunks.get(&initial_chunk_pos).unwrap(); - let initial_chunk = initial_chunk.read(); + let initial_chunk = world.chunks.get(&initial_chunk_pos); + let initial_chunk = initial_chunk.as_deref().map(RwLock::read); while let Some(item) = state.cursor.next() { if item.iteration_type == CursorIterationType::Corner { @@ -25,9 +25,13 @@ pub fn get_block_collisions(world: &Instance, aabb: AABB) -> Vec { let item_chunk_pos = ChunkPos::from(item.pos); let block_state: BlockState = if item_chunk_pos == initial_chunk_pos { - initial_chunk - .get(&ChunkBlockPos::from(item.pos), state.world.chunks.min_y) - .unwrap_or(BlockState::AIR) + if let Some(initial_chunk) = &initial_chunk { + initial_chunk + .get(&ChunkBlockPos::from(item.pos), state.world.chunks.min_y) + .unwrap_or(BlockState::AIR) + } else { + BlockState::AIR + } } else { state.get_block_state(item.pos) }; From fa96af786b6f549edd8f04f4a19ced01faffe114 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 18 Apr 2024 20:22:26 -0500 Subject: [PATCH 33/37] Release 0.9.1 azalea@0.9.1 azalea-auth@0.9.1 azalea-block@0.9.1 azalea-block-macros@0.9.1 azalea-brigadier@0.9.1 azalea-buf@0.9.1 azalea-buf-macros@0.9.1 azalea-chat@0.9.1 azalea-client@0.9.1 azalea-core@0.9.1 azalea-crypto@0.9.1 azalea-entity@0.9.1 azalea-inventory@0.9.1 azalea-inventory-macros@0.9.1 azalea-language@0.9.1 azalea-physics@0.9.1 azalea-protocol@0.9.1 azalea-protocol-macros@0.9.1 azalea-registry@0.9.1 azalea-registry-macros@0.9.1 azalea-world@0.9.1 Generated by cargo-workspaces --- Cargo.lock | 42 +++++++++---------- azalea-auth/Cargo.toml | 2 +- azalea-block/Cargo.toml | 2 +- azalea-block/azalea-block-macros/Cargo.toml | 2 +- azalea-brigadier/Cargo.toml | 2 +- azalea-buf/Cargo.toml | 2 +- azalea-buf/azalea-buf-macros/Cargo.toml | 2 +- azalea-chat/Cargo.toml | 2 +- azalea-client/Cargo.toml | 2 +- azalea-core/Cargo.toml | 2 +- azalea-crypto/Cargo.toml | 2 +- azalea-entity/Cargo.toml | 2 +- azalea-inventory/Cargo.toml | 2 +- .../azalea-inventory-macros/Cargo.toml | 2 +- azalea-language/Cargo.toml | 2 +- azalea-physics/Cargo.toml | 2 +- azalea-protocol/Cargo.toml | 2 +- .../azalea-protocol-macros/Cargo.toml | 2 +- azalea-registry/Cargo.toml | 2 +- .../azalea-registry-macros/Cargo.toml | 2 +- azalea-world/Cargo.toml | 2 +- azalea/Cargo.toml | 2 +- 22 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f228d2de..741cce8ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,7 +196,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "azalea" -version = "0.9.0" +version = "0.9.1" dependencies = [ "anyhow", "async-trait", @@ -236,7 +236,7 @@ dependencies = [ [[package]] name = "azalea-auth" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-buf", "azalea-crypto", @@ -258,7 +258,7 @@ dependencies = [ [[package]] name = "azalea-block" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-block-macros", "azalea-buf", @@ -267,7 +267,7 @@ dependencies = [ [[package]] name = "azalea-block-macros" -version = "0.9.0" +version = "0.9.1" dependencies = [ "proc-macro2", "quote", @@ -276,7 +276,7 @@ dependencies = [ [[package]] name = "azalea-brigadier" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-buf", "azalea-chat", @@ -285,7 +285,7 @@ dependencies = [ [[package]] name = "azalea-buf" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-buf-macros", "byteorder", @@ -298,7 +298,7 @@ dependencies = [ [[package]] name = "azalea-buf-macros" -version = "0.9.0" +version = "0.9.1" dependencies = [ "proc-macro2", "quote", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "azalea-chat" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-buf", "azalea-language", @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "azalea-client" -version = "0.9.0" +version = "0.9.1" dependencies = [ "anyhow", "async-trait", @@ -361,7 +361,7 @@ dependencies = [ [[package]] name = "azalea-core" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-buf", "azalea-inventory", @@ -378,7 +378,7 @@ dependencies = [ [[package]] name = "azalea-crypto" -version = "0.9.0" +version = "0.9.1" dependencies = [ "aes", "azalea-buf", @@ -395,7 +395,7 @@ dependencies = [ [[package]] name = "azalea-entity" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-block", "azalea-buf", @@ -418,7 +418,7 @@ dependencies = [ [[package]] name = "azalea-inventory" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-buf", "azalea-inventory-macros", @@ -428,7 +428,7 @@ dependencies = [ [[package]] name = "azalea-inventory-macros" -version = "0.9.0" +version = "0.9.1" dependencies = [ "proc-macro2", "quote", @@ -437,7 +437,7 @@ dependencies = [ [[package]] name = "azalea-language" -version = "0.9.0" +version = "0.9.1" dependencies = [ "once_cell", "serde", @@ -446,7 +446,7 @@ dependencies = [ [[package]] name = "azalea-physics" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-block", "azalea-core", @@ -467,7 +467,7 @@ dependencies = [ [[package]] name = "azalea-protocol" -version = "0.9.0" +version = "0.9.1" dependencies = [ "anyhow", "async-recursion", @@ -506,7 +506,7 @@ dependencies = [ [[package]] name = "azalea-protocol-macros" -version = "0.9.0" +version = "0.9.1" dependencies = [ "proc-macro2", "quote", @@ -515,7 +515,7 @@ dependencies = [ [[package]] name = "azalea-registry" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-buf", "azalea-registry-macros", @@ -525,7 +525,7 @@ dependencies = [ [[package]] name = "azalea-registry-macros" -version = "0.9.0" +version = "0.9.1" dependencies = [ "proc-macro2", "quote", @@ -534,7 +534,7 @@ dependencies = [ [[package]] name = "azalea-world" -version = "0.9.0" +version = "0.9.1" dependencies = [ "azalea-block", "azalea-buf", diff --git a/azalea-auth/Cargo.toml b/azalea-auth/Cargo.toml index 72612454f..b7179e72d 100644 --- a/azalea-auth/Cargo.toml +++ b/azalea-auth/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-auth" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-auth" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-block/Cargo.toml b/azalea-block/Cargo.toml index 1f3a829f4..5b0377091 100644 --- a/azalea-block/Cargo.toml +++ b/azalea-block/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-block" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-block" -version = "0.9.0" +version = "0.9.1" [lib] diff --git a/azalea-block/azalea-block-macros/Cargo.toml b/azalea-block/azalea-block-macros/Cargo.toml index 7489a93ea..adad76184 100644 --- a/azalea-block/azalea-block-macros/Cargo.toml +++ b/azalea-block/azalea-block-macros/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-block-macros" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-block/azalea-block-macros" -version = "0.9.0" +version = "0.9.1" [lib] proc-macro = true diff --git a/azalea-brigadier/Cargo.toml b/azalea-brigadier/Cargo.toml index d9bfa3637..6615ac07c 100644 --- a/azalea-brigadier/Cargo.toml +++ b/azalea-brigadier/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-brigadier" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-brigadier" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-buf/Cargo.toml b/azalea-buf/Cargo.toml index eb4325802..cb7886001 100644 --- a/azalea-buf/Cargo.toml +++ b/azalea-buf/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-buf" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-buf" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-buf/azalea-buf-macros/Cargo.toml b/azalea-buf/azalea-buf-macros/Cargo.toml index 0bef0aca2..f9df08616 100644 --- a/azalea-buf/azalea-buf-macros/Cargo.toml +++ b/azalea-buf/azalea-buf-macros/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-buf-macros" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-buf" -version = "0.9.0" +version = "0.9.1" [lib] proc-macro = true diff --git a/azalea-chat/Cargo.toml b/azalea-chat/Cargo.toml index 2536bfaa7..f70c164ce 100644 --- a/azalea-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-chat" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-chat" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index cbf2b1deb..78411ed97 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-client" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-client" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-core/Cargo.toml b/azalea-core/Cargo.toml index d294b755b..7df9bde26 100644 --- a/azalea-core/Cargo.toml +++ b/azalea-core/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-core" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-core" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-crypto/Cargo.toml b/azalea-crypto/Cargo.toml index 04423f2a6..07bd6847e 100644 --- a/azalea-crypto/Cargo.toml +++ b/azalea-crypto/Cargo.toml @@ -3,7 +3,7 @@ description = "Cryptography features used in Minecraft." edition = "2021" license = "MIT" name = "azalea-crypto" -version = "0.9.0" +version = "0.9.1" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-crypto" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-entity/Cargo.toml b/azalea-entity/Cargo.toml index c35323bbf..fe098a15b 100644 --- a/azalea-entity/Cargo.toml +++ b/azalea-entity/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "azalea-entity" -version = "0.9.0" +version = "0.9.1" edition = "2021" description = "Things related to Minecraft entities used by Azalea" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-entity" diff --git a/azalea-inventory/Cargo.toml b/azalea-inventory/Cargo.toml index aacbd4340..3f768a11c 100644 --- a/azalea-inventory/Cargo.toml +++ b/azalea-inventory/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-inventory" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-inventory-macros" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-inventory/azalea-inventory-macros/Cargo.toml b/azalea-inventory/azalea-inventory-macros/Cargo.toml index f3c406909..7f5dddf00 100644 --- a/azalea-inventory/azalea-inventory-macros/Cargo.toml +++ b/azalea-inventory/azalea-inventory-macros/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-inventory-macros" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-inventory/azalea-inventory-macros" -version = "0.9.0" +version = "0.9.1" [lib] proc-macro = true diff --git a/azalea-language/Cargo.toml b/azalea-language/Cargo.toml index 3ffa1f1c8..09dcda519 100644 --- a/azalea-language/Cargo.toml +++ b/azalea-language/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-language" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-language" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index 7b7628961..447f7b8c3 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-physics" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-physics" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index d80255898..939087706 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-protocol" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-protocol" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-protocol/azalea-protocol-macros/Cargo.toml b/azalea-protocol/azalea-protocol-macros/Cargo.toml index f37ca2ab1..394c4c442 100644 --- a/azalea-protocol/azalea-protocol-macros/Cargo.toml +++ b/azalea-protocol/azalea-protocol-macros/Cargo.toml @@ -3,7 +3,7 @@ description = "Macros internally used in azalea-protocol." edition = "2021" license = "MIT" name = "azalea-protocol-macros" -version = "0.9.0" +version = "0.9.1" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-protocol/azalea-protocol-macros" [lib] diff --git a/azalea-registry/Cargo.toml b/azalea-registry/Cargo.toml index e1bae3afd..09789cff7 100644 --- a/azalea-registry/Cargo.toml +++ b/azalea-registry/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-registry" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-registry" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-registry/azalea-registry-macros/Cargo.toml b/azalea-registry/azalea-registry-macros/Cargo.toml index cb07e2f70..ac40eb7e8 100644 --- a/azalea-registry/azalea-registry-macros/Cargo.toml +++ b/azalea-registry/azalea-registry-macros/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-registry-macros" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-registry/azalea-registry-macros" -version = "0.9.0" +version = "0.9.1" [lib] proc-macro = true diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index 20e3a261c..37915f4c0 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-world" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-world" -version = "0.9.0" +version = "0.9.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea/Cargo.toml b/azalea/Cargo.toml index d1d9a4f87..72a18aa34 100644 --- a/azalea/Cargo.toml +++ b/azalea/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea" -version = "0.9.0" +version = "0.9.1" [package.metadata.release] pre-release-replacements = [ From 353eda21ac8280213edcec3823cc3bd77fe17c44 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 20 Apr 2024 03:40:59 +0000 Subject: [PATCH 34/37] socks5 support (#113) --- Cargo.lock | 22 ++++++ azalea-client/Cargo.toml | 1 + azalea-client/src/client.rs | 11 ++- azalea-client/src/ping.rs | 29 ++++++-- azalea-protocol/Cargo.toml | 2 + azalea-protocol/src/connect.rs | 38 +++++++++- azalea/examples/testbot/main.rs | 6 +- azalea/src/lib.rs | 71 +++++++++++++++--- azalea/src/swarm/mod.rs | 124 ++++++++++++++++++++------------ 9 files changed, 240 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 741cce8ef..1c0ea9beb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,6 +122,12 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +[[package]] +name = "as-any" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a30a44e99a1c83ccb2a6298c563c888952a1c9134953db26876528f84c93a" + [[package]] name = "async-channel" version = "2.2.0" @@ -353,6 +359,7 @@ dependencies = [ "serde", "serde_json", "simdnbt", + "socks5-impl", "thiserror", "tokio", "tracing", @@ -495,6 +502,7 @@ dependencies = [ "serde", "serde_json", "simdnbt", + "socks5-impl", "thiserror", "tokio", "tokio-util", @@ -2533,6 +2541,20 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "socks5-impl" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dfc11441196e51be4f48c72b075e7fff394a3c6a43f93420f907a2708079b27" +dependencies = [ + "as-any", + "async-trait", + "byteorder", + "bytes", + "thiserror", + "tokio", +] + [[package]] name = "spin" version = "0.5.2" diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index 78411ed97..b79f694a3 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -43,6 +43,7 @@ azalea-entity = { version = "0.9.0", path = "../azalea-entity" } serde_json = "1.0.113" serde = "1.0.196" minecraft_folder_path = "0.1.2" +socks5-impl = "0.5.6" [features] default = ["log"] diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index af5354159..8ca0bbefb 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -34,7 +34,7 @@ use azalea_entity::{ }; use azalea_physics::PhysicsPlugin; use azalea_protocol::{ - connect::{Connection, ConnectionError}, + connect::{Connection, ConnectionError, Proxy}, packets::{ configuration::{ serverbound_client_information_packet::ClientInformation, @@ -183,6 +183,7 @@ impl Client { pub async fn join( account: &Account, address: impl TryInto, + proxy: Option, ) -> Result<(Self, mpsc::UnboundedReceiver), JoinError> { let address: ServerAddress = address.try_into().map_err(|_| JoinError::InvalidAddress)?; let resolved_address = resolver::resolve_address(&address).await?; @@ -200,6 +201,7 @@ impl Client { account, &address, &resolved_address, + proxy, run_schedule_sender, ) .await @@ -212,6 +214,7 @@ impl Client { account: &Account, address: &ServerAddress, resolved_address: &SocketAddr, + proxy: Option, run_schedule_sender: mpsc::UnboundedSender<()>, ) -> Result<(Self, mpsc::UnboundedReceiver), JoinError> { // check if an entity with our uuid already exists in the ecs and if so then @@ -239,7 +242,11 @@ impl Client { entity }; - let conn = Connection::new(resolved_address).await?; + let conn = if let Some(proxy) = proxy { + Connection::new_with_proxy(resolved_address, proxy).await? + } else { + Connection::new(resolved_address).await? + }; let (conn, game_profile) = Self::handshake(ecs_lock.clone(), entity, conn, account, address).await?; diff --git a/azalea-client/src/ping.rs b/azalea-client/src/ping.rs index 9064065c2..c74a62be9 100755 --- a/azalea-client/src/ping.rs +++ b/azalea-client/src/ping.rs @@ -1,9 +1,12 @@ //! Ping Minecraft servers. use azalea_protocol::{ - connect::{Connection, ConnectionError}, + connect::{Connection, ConnectionError, Proxy}, packets::{ - handshaking::client_intention_packet::ClientIntentionPacket, + handshaking::{ + client_intention_packet::ClientIntentionPacket, ClientboundHandshakePacket, + ServerboundHandshakePacket, + }, status::{ clientbound_status_response_packet::ClientboundStatusResponsePacket, serverbound_status_request_packet::ServerboundStatusRequestPacket, @@ -47,11 +50,29 @@ pub async fn ping_server( address: impl TryInto, ) -> Result { let address: ServerAddress = address.try_into().map_err(|_| PingError::InvalidAddress)?; - let resolved_address = resolver::resolve_address(&address).await?; + let conn = Connection::new(&resolved_address).await?; + ping_server_with_connection(address, conn).await +} - let mut conn = Connection::new(&resolved_address).await?; +/// Ping a Minecraft server through a Socks5 proxy. +pub async fn ping_server_with_proxy( + address: impl TryInto, + proxy: Proxy, +) -> Result { + let address: ServerAddress = address.try_into().map_err(|_| PingError::InvalidAddress)?; + let resolved_address = resolver::resolve_address(&address).await?; + let conn = Connection::new_with_proxy(&resolved_address, proxy).await?; + ping_server_with_connection(address, conn).await +} +/// Ping a Minecraft server after we've already created a [`Connection`]. The +/// `Connection` must still be in the handshake state (which is the state it's +/// in immediately after it's created). +pub async fn ping_server_with_connection( + address: ServerAddress, + mut conn: Connection, +) -> Result { // send the client intention packet and switch to the status state conn.write( ClientIntentionPacket { diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 939087706..609d2019c 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -48,6 +48,8 @@ trust-dns-resolver = { version = "^0.23.2", default-features = false, features = uuid = "1.7.0" log = "0.4.20" +socks5-impl = "0.5.6" + [features] connecting = [] default = ["packets"] diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs index 86b926938..cc1b71c13 100755 --- a/azalea-protocol/src/connect.rs +++ b/azalea-protocol/src/connect.rs @@ -20,7 +20,7 @@ use std::io::Cursor; use std::marker::PhantomData; use std::net::SocketAddr; use thiserror::Error; -use tokio::io::AsyncWriteExt; +use tokio::io::{AsyncWriteExt, BufStream}; use tokio::net::tcp::{OwnedReadHalf, OwnedWriteHalf, ReuniteError}; use tokio::net::TcpStream; use tracing::{error, info}; @@ -257,6 +257,20 @@ pub enum ConnectionError { Io(#[from] std::io::Error), } +use socks5_impl::protocol::UserKey; + +#[derive(Debug, Clone)] +pub struct Proxy { + pub addr: SocketAddr, + pub auth: Option, +} + +impl Proxy { + pub fn new(addr: SocketAddr, auth: Option) -> Self { + Self { addr, auth } + } +} + impl Connection { /// Create a new connection to the given address. pub async fn new(address: &SocketAddr) -> Result { @@ -265,6 +279,28 @@ impl Connection { // enable tcp_nodelay stream.set_nodelay(true)?; + Self::new_from_stream(stream).await + } + + /// Create a new connection to the given address and Socks5 proxy. If you're + /// not using a proxy, use [`Self::new`] instead. + pub async fn new_with_proxy( + address: &SocketAddr, + proxy: Proxy, + ) -> Result { + let proxy_stream = TcpStream::connect(proxy.addr).await?; + let mut stream = BufStream::new(proxy_stream); + + let _ = socks5_impl::client::connect(&mut stream, address, proxy.auth) + .await + .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?; + + Self::new_from_stream(stream.into_inner()).await + } + + /// Create a new connection from an existing stream. Useful if you want to + /// set custom options on the stream. Otherwise, just use [`Self::new`]. + pub async fn new_from_stream(stream: TcpStream) -> Result { let (read_stream, write_stream) = stream.into_split(); Ok(Connection { diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index 86395b7e6..6795e6cf5 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -181,10 +181,12 @@ async fn swarm_handle( _state: SwarmState, ) -> anyhow::Result<()> { match &event { - SwarmEvent::Disconnect(account) => { + SwarmEvent::Disconnect(account, join_opts) => { println!("bot got kicked! {}", account.username); tokio::time::sleep(Duration::from_secs(5)).await; - swarm.add_and_retry_forever(account, State::default()).await; + swarm + .add_and_retry_forever_with_opts(account, State::default(), join_opts) + .await; } SwarmEvent::Chat(chat) => { if chat.message().to_string() == "The particle was not visible for anybody" { diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index 6e18ff7d4..7d8b424c9 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -38,6 +38,7 @@ pub use azalea_world as world; pub use bot::*; use ecs::component::Component; use futures::{future::BoxFuture, Future}; +use protocol::connect::Proxy; use protocol::{resolver::ResolverError, ServerAddress}; use swarm::SwarmBuilder; use thiserror::Error; @@ -185,30 +186,26 @@ where account: Account, address: impl TryInto, ) -> Result { - self.swarm.accounts = vec![account]; + self.swarm.accounts = vec![(account, JoinOpts::default())]; if self.swarm.states.is_empty() { self.swarm.states = vec![S::default()]; } self.swarm.start(address).await } - /// Do the same as [`Self::start`], but allow passing in a custom resolved - /// address. This is useful if the address you're connecting to doesn't - /// resolve to anything, like if the server uses the address field to pass - /// custom data (like Bungeecord or Forge). - pub async fn start_with_custom_resolved_address( + /// Do the same as [`Self::start`], but allow passing in custom join + /// options. + pub async fn start_with_opts( mut self, account: Account, address: impl TryInto, - resolved_address: SocketAddr, + opts: JoinOpts, ) -> Result { - self.swarm.accounts = vec![account]; + self.swarm.accounts = vec![(account, opts.clone())]; if self.swarm.states.is_empty() { self.swarm.states = vec![S::default()]; } - self.swarm - .start_with_custom_resolved_address(address, resolved_address) - .await + self.swarm.start_with_default_opts(address, opts).await } } impl Default for ClientBuilder { @@ -224,3 +221,55 @@ impl Default for ClientBuilder { /// [`SwarmBuilder`]: swarm::SwarmBuilder #[derive(Component, Clone, Default)] pub struct NoState; + +/// Optional settings when adding an account to a swarm or client. +#[derive(Clone, Debug, Default)] +#[non_exhaustive] +pub struct JoinOpts { + /// The Socks5 proxy that this bot will use. + pub proxy: Option, + /// Override the server address that this specific bot will send in the + /// handshake packet. + pub custom_address: Option, + /// Override the socket address that this specific bot will use to connect + /// to the server. + pub custom_resolved_address: Option, +} + +impl JoinOpts { + pub fn new() -> Self { + Self::default() + } + + pub fn update(&mut self, other: &Self) { + if let Some(proxy) = other.proxy.clone() { + self.proxy = Some(proxy); + } + if let Some(custom_address) = other.custom_address.clone() { + self.custom_address = Some(custom_address); + } + if let Some(custom_resolved_address) = other.custom_resolved_address { + self.custom_resolved_address = Some(custom_resolved_address); + } + } + + /// Set the proxy that this bot will use. + #[must_use] + pub fn proxy(mut self, proxy: Proxy) -> Self { + self.proxy = Some(proxy); + self + } + /// Set the custom address that this bot will send in the handshake packet. + #[must_use] + pub fn custom_address(mut self, custom_address: ServerAddress) -> Self { + self.custom_address = Some(custom_address); + self + } + /// Set the custom resolved address that this bot will use to connect to the + /// server. + #[must_use] + pub fn custom_resolved_address(mut self, custom_resolved_address: SocketAddr) -> Self { + self.custom_resolved_address = Some(custom_resolved_address); + self + } +} diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 2be56567e..a53e6fe8c 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -17,7 +17,7 @@ use std::{collections::HashMap, future::Future, net::SocketAddr, sync::Arc, time use tokio::sync::mpsc; use tracing::error; -use crate::{BoxHandleFn, DefaultBotPlugins, HandleFn, NoState, StartError}; +use crate::{BoxHandleFn, DefaultBotPlugins, HandleFn, JoinOpts, NoState, StartError}; /// A swarm is a way to conveniently control many bots at once, while also /// being able to control bots at an individual level when desired. @@ -51,8 +51,8 @@ where SS: Default + Send + Sync + Clone + Resource + 'static, { pub(crate) app: App, - /// The accounts that are going to join the server. - pub(crate) accounts: Vec, + /// The accounts and proxies that are going to join the server. + pub(crate) accounts: Vec<(Account, JoinOpts)>, /// The individual bot states. This must be the same length as `accounts`, /// since each bot gets one state. pub(crate) states: Vec, @@ -257,8 +257,20 @@ where /// Add an account with a custom initial state. Use just /// [`Self::add_account`] to use the Default implementation for the state. #[must_use] - pub fn add_account_with_state(mut self, account: Account, state: S) -> Self { - self.accounts.push(account); + pub fn add_account_with_state(self, account: Account, state: S) -> Self { + self.add_account_with_state_and_opts(account, state, JoinOpts::default()) + } + + /// Same as [`Self::add_account_with_state`], but allow passing in custom + /// join options. + #[must_use] + pub fn add_account_with_state_and_opts( + mut self, + account: Account, + state: S, + join_opts: JoinOpts, + ) -> Self { + self.accounts.push((account, join_opts)); self.states.push(state); self } @@ -302,21 +314,16 @@ where Err(_) => return Err(StartError::InvalidAddress), }; - // resolve the address - let resolved_address = resolver::resolve_address(&address).await?; - - self.start_with_custom_resolved_address(address, resolved_address) + self.start_with_default_opts(address, JoinOpts::default()) .await } - /// Do the same as [`Self::start`], but allow passing in a custom resolved - /// address. This is useful if the address you're connecting to doesn't - /// resolve to anything, like if the server uses the address field to pass - /// custom data (like Bungeecord or Forge). - pub async fn start_with_custom_resolved_address( + /// Do the same as [`Self::start`], but allow passing in default join + /// options for the bots. + pub async fn start_with_default_opts( self, address: impl TryInto, - resolved_address: SocketAddr, + default_join_opts: JoinOpts, ) -> Result { assert_eq!( self.accounts.len(), @@ -325,11 +332,17 @@ where ); // convert the TryInto into a ServerAddress - let address: ServerAddress = match address.try_into() { + let address = match address.try_into() { Ok(address) => address, Err(_) => return Err(StartError::InvalidAddress), }; + let address: ServerAddress = default_join_opts.custom_address.clone().unwrap_or(address); + let resolved_address: SocketAddr = match default_join_opts.custom_resolved_address { + Some(resolved_address) => resolved_address, + None => resolver::resolve_address(&address).await?, + }; + let instance_container = Arc::new(RwLock::new(InstanceContainer::default())); // we can't modify the swarm plugins after this @@ -378,24 +391,27 @@ where tokio::spawn(async move { if let Some(join_delay) = join_delay { // if there's a join delay, then join one by one - for (account, state) in accounts.iter().zip(states) { - swarm_clone.add_and_retry_forever(account, state).await; + for ((account, bot_join_opts), state) in accounts.iter().zip(states) { + let mut join_opts = default_join_opts.clone(); + join_opts.update(bot_join_opts); + swarm_clone + .add_and_retry_forever_with_opts(account, state, &join_opts) + .await; tokio::time::sleep(join_delay).await; } } else { // otherwise, join all at once let swarm_borrow = &swarm_clone; - join_all( - accounts - .iter() - .zip(states) - .map(move |(account, state)| async { - swarm_borrow - .clone() - .add_and_retry_forever(account, state) - .await; - }), - ) + join_all(accounts.iter().zip(states).map( + |((account, bot_join_opts), state)| async { + let mut join_opts = default_join_opts.clone(); + join_opts.update(bot_join_opts); + swarm_borrow + .clone() + .add_and_retry_forever_with_opts(account, state, &join_opts) + .await; + }, + )) .await; } @@ -460,9 +476,9 @@ pub enum SwarmEvent { Init, /// A bot got disconnected from the server. /// - /// You can implement an auto-reconnect by calling [`Swarm::add`] - /// with the account from this event. - Disconnect(Box), + /// You can implement an auto-reconnect by calling [`Swarm::add_with_opts`] + /// with the account and options from this event. + Disconnect(Box, JoinOpts), /// At least one bot received a chat message. Chat(ChatPacket), } @@ -544,31 +560,36 @@ impl Swarm { account: &Account, state: S, ) -> Result { - let address = self.address.read().clone(); - let resolved_address = *self.resolved_address.read(); - - self.add_with_custom_address(account, state, address, resolved_address) + self.add_with_opts(account, state, JoinOpts::default()) .await } - /// Add a new account to the swarm, using the given host and socket - /// address. This is useful if you want bots in the same swarm to connect to - /// different addresses. Usually you'll just want [`Self::add`] though. + /// Add a new account to the swarm, using custom options. This is useful if + /// you want bots in the same swarm to connect to different addresses. + /// Usually you'll just want [`Self::add`] though. /// /// # Errors /// /// Returns an `Err` if the bot could not do a handshake successfully. - pub async fn add_with_custom_address( + pub async fn add_with_opts( &mut self, account: &Account, state: S, - address: ServerAddress, - resolved_address: SocketAddr, + opts: JoinOpts, ) -> Result { + let address = opts + .custom_address + .clone() + .unwrap_or_else(|| self.address.read().clone()); + let resolved_address = opts + .custom_resolved_address + .unwrap_or_else(|| *self.resolved_address.read()); + let (bot, mut rx) = Client::start_client( self.ecs_lock.clone(), account, &address, &resolved_address, + opts.proxy.clone(), self.run_schedule_sender.clone(), ) .await?; @@ -597,7 +618,7 @@ impl Swarm { .get_component::() .expect("bot is missing required Account component"); swarm_tx - .send(SwarmEvent::Disconnect(Box::new(account))) + .send(SwarmEvent::Disconnect(Box::new(account), opts)) .unwrap(); }); @@ -613,10 +634,25 @@ impl Swarm { &mut self, account: &Account, state: S, + ) -> Client { + self.add_and_retry_forever_with_opts(account, state, &JoinOpts::default()) + .await + } + + /// Same as [`Self::add_and_retry_forever`], but allow passing custom join + /// options. + pub async fn add_and_retry_forever_with_opts( + &mut self, + account: &Account, + state: S, + opts: &JoinOpts, ) -> Client { let mut disconnects = 0; loop { - match self.add(account, state.clone()).await { + match self + .add_with_opts(account, state.clone(), opts.clone()) + .await + { Ok(bot) => return bot, Err(e) => { disconnects += 1; From 6d9d1a456951ae321089343a91d15bfa9f3087d7 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 20 Apr 2024 03:59:50 +0000 Subject: [PATCH 35/37] add Client::join_with_proxy and fix tests --- azalea-client/src/client.rs | 80 +++++++++++++++++++++++++++---------- azalea-client/src/lib.rs | 3 +- azalea/src/swarm/mod.rs | 35 ++++++++-------- 3 files changed, 77 insertions(+), 41 deletions(-) diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 8ca0bbefb..93852c75e 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -138,6 +138,45 @@ pub enum JoinError { Disconnect { reason: FormattedText }, } +pub struct StartClientOpts<'a> { + pub ecs_lock: Arc>, + pub account: &'a Account, + pub address: &'a ServerAddress, + pub resolved_address: &'a SocketAddr, + pub proxy: Option, + pub run_schedule_sender: mpsc::UnboundedSender<()>, +} + +impl<'a> StartClientOpts<'a> { + pub fn new( + account: &'a Account, + address: &'a ServerAddress, + resolved_address: &'a SocketAddr, + ) -> StartClientOpts<'a> { + // An event that causes the schedule to run. This is only used internally. + let (run_schedule_sender, run_schedule_receiver) = mpsc::unbounded_channel(); + + let mut app = App::new(); + app.add_plugins(DefaultPlugins); + + let ecs_lock = start_ecs_runner(app, run_schedule_receiver, run_schedule_sender.clone()); + + Self { + ecs_lock, + account, + address, + resolved_address, + proxy: None, + run_schedule_sender, + } + } + + pub fn proxy(mut self, proxy: Proxy) -> Self { + self.proxy = Some(proxy); + self + } +} + impl Client { /// Create a new client from the given [`GameProfile`], ECS Entity, ECS /// World, and schedule runner function. @@ -183,39 +222,36 @@ impl Client { pub async fn join( account: &Account, address: impl TryInto, - proxy: Option, ) -> Result<(Self, mpsc::UnboundedReceiver), JoinError> { let address: ServerAddress = address.try_into().map_err(|_| JoinError::InvalidAddress)?; let resolved_address = resolver::resolve_address(&address).await?; - // An event that causes the schedule to run. This is only used internally. - let (run_schedule_sender, run_schedule_receiver) = mpsc::unbounded_channel(); - - let mut app = App::new(); - app.add_plugins(DefaultPlugins); + Self::start_client(StartClientOpts::new(account, &address, &resolved_address)).await + } - let ecs_lock = start_ecs_runner(app, run_schedule_receiver, run_schedule_sender.clone()); + pub async fn join_with_proxy( + account: &Account, + address: impl TryInto, + proxy: Proxy, + ) -> Result<(Self, mpsc::UnboundedReceiver), JoinError> { + let address: ServerAddress = address.try_into().map_err(|_| JoinError::InvalidAddress)?; + let resolved_address = resolver::resolve_address(&address).await?; - Self::start_client( - ecs_lock, - account, - &address, - &resolved_address, - proxy, - run_schedule_sender, - ) - .await + Self::start_client(StartClientOpts::new(account, &address, &resolved_address).proxy(proxy)) + .await } /// Create a [`Client`] when you already have the ECS made with /// [`start_ecs_runner`]. You'd usually want to use [`Self::join`] instead. pub async fn start_client( - ecs_lock: Arc>, - account: &Account, - address: &ServerAddress, - resolved_address: &SocketAddr, - proxy: Option, - run_schedule_sender: mpsc::UnboundedSender<()>, + StartClientOpts { + ecs_lock, + account, + address, + resolved_address, + proxy, + run_schedule_sender, + }: StartClientOpts<'_>, ) -> Result<(Self, mpsc::UnboundedReceiver), JoinError> { // check if an entity with our uuid already exists in the ecs and if so then // just use that diff --git a/azalea-client/src/lib.rs b/azalea-client/src/lib.rs index 41399ce97..ec19e3ace 100644 --- a/azalea-client/src/lib.rs +++ b/azalea-client/src/lib.rs @@ -32,7 +32,8 @@ pub mod task_pool; pub use account::{Account, AccountOpts}; pub use azalea_protocol::packets::configuration::serverbound_client_information_packet::ClientInformation; pub use client::{ - start_ecs_runner, Client, DefaultPlugins, JoinError, JoinedClientBundle, TickBroadcast, + start_ecs_runner, Client, DefaultPlugins, JoinError, JoinedClientBundle, StartClientOpts, + TickBroadcast, }; pub use events::Event; pub use local_player::{GameProfileComponent, InstanceHolder, TabList}; diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index a53e6fe8c..451d887c6 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -6,6 +6,7 @@ pub mod prelude; use azalea_client::{ chat::ChatPacket, start_ecs_runner, Account, Client, DefaultPlugins, Event, JoinError, + StartClientOpts, }; use azalea_protocol::{resolver, ServerAddress}; use azalea_world::InstanceContainer; @@ -535,10 +536,10 @@ pub type BoxSwarmHandleFn = /// _state: SwarmState, /// ) -> anyhow::Result<()> { /// match &event { -/// SwarmEvent::Disconnect(account) => { +/// SwarmEvent::Disconnect(account, join_opts) => { /// // automatically reconnect after 5 seconds /// tokio::time::sleep(Duration::from_secs(5)).await; -/// swarm.add(account, State::default()).await?; +/// swarm.add_with_opts(account, State::default(), join_opts).await?; /// } /// SwarmEvent::Chat(m) => { /// println!("{}", m.message().to_ansi()); @@ -560,7 +561,7 @@ impl Swarm { account: &Account, state: S, ) -> Result { - self.add_with_opts(account, state, JoinOpts::default()) + self.add_with_opts(account, state, &JoinOpts::default()) .await } /// Add a new account to the swarm, using custom options. This is useful if @@ -574,24 +575,24 @@ impl Swarm { &mut self, account: &Account, state: S, - opts: JoinOpts, + join_opts: &JoinOpts, ) -> Result { - let address = opts + let address = join_opts .custom_address .clone() .unwrap_or_else(|| self.address.read().clone()); - let resolved_address = opts + let resolved_address = join_opts .custom_resolved_address .unwrap_or_else(|| *self.resolved_address.read()); - let (bot, mut rx) = Client::start_client( - self.ecs_lock.clone(), + let (bot, mut rx) = Client::start_client(StartClientOpts { + ecs_lock: self.ecs_lock.clone(), account, - &address, - &resolved_address, - opts.proxy.clone(), - self.run_schedule_sender.clone(), - ) + address: &address, + resolved_address: &resolved_address, + proxy: join_opts.proxy.clone(), + run_schedule_sender: self.run_schedule_sender.clone(), + }) .await?; // add the state to the client { @@ -605,6 +606,7 @@ impl Swarm { let cloned_bots_tx = self.bots_tx.clone(); let cloned_bot = bot.clone(); let swarm_tx = self.swarm_tx.clone(); + let join_opts = join_opts.clone(); tokio::spawn(async move { while let Some(event) = rx.recv().await { // we can't handle events here (since we can't copy the handler), @@ -618,7 +620,7 @@ impl Swarm { .get_component::() .expect("bot is missing required Account component"); swarm_tx - .send(SwarmEvent::Disconnect(Box::new(account), opts)) + .send(SwarmEvent::Disconnect(Box::new(account), join_opts)) .unwrap(); }); @@ -649,10 +651,7 @@ impl Swarm { ) -> Client { let mut disconnects = 0; loop { - match self - .add_with_opts(account, state.clone(), opts.clone()) - .await - { + match self.add_with_opts(account, state.clone(), opts).await { Ok(bot) => return bot, Err(e) => { disconnects += 1; From 8a1e1b7bb93373e85432ce4211b6ede4eae79409 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 20 Apr 2024 04:03:03 +0000 Subject: [PATCH 36/37] clippy --- .../src/context/command_context_builder.rs | 4 ++-- azalea-buf/src/write.rs | 4 ++-- azalea-client/src/packet_handling/game.rs | 2 +- azalea-client/src/task_pool.rs | 4 ++-- azalea-physics/src/collision/shape.rs | 2 +- azalea-physics/src/collision/world_collisions.rs | 2 -- azalea/benches/physics.rs | 14 ++------------ 7 files changed, 10 insertions(+), 22 deletions(-) diff --git a/azalea-brigadier/src/context/command_context_builder.rs b/azalea-brigadier/src/context/command_context_builder.rs index 752958251..95e1b5d8b 100755 --- a/azalea-brigadier/src/context/command_context_builder.rs +++ b/azalea-brigadier/src/context/command_context_builder.rs @@ -63,7 +63,7 @@ impl<'a, S> CommandContextBuilder<'a, S> { } pub fn with_command(&mut self, command: &Command) -> &Self { - self.command = command.clone(); + self.command.clone_from(command); self } pub fn with_child(&mut self, child: Rc>) -> &Self { @@ -80,7 +80,7 @@ impl<'a, S> CommandContextBuilder<'a, S> { range, }); self.range = StringRange::encompassing(&self.range, &range); - self.modifier = node.read().modifier.clone(); + self.modifier.clone_from(&node.read().modifier); self.forks = node.read().forks; self } diff --git a/azalea-buf/src/write.rs b/azalea-buf/src/write.rs index c8d1f9907..7b1fb3310 100755 --- a/azalea-buf/src/write.rs +++ b/azalea-buf/src/write.rs @@ -41,7 +41,7 @@ impl McBufVarWritable for i32 { } while value != 0 { buffer[0] = (value & 0b0111_1111) as u8; - value = (value >> 7) & (i32::max_value() >> 6); + value = (value >> 7) & (i32::MAX >> 6); if value != 0 { buffer[0] |= 0b1000_0000; } @@ -137,7 +137,7 @@ impl McBufVarWritable for i64 { } while value != 0 { buffer[0] = (value & 0b0111_1111) as u8; - value = (value >> 7) & (i64::max_value() >> 6); + value = (value >> 7) & (i64::MAX >> 6); if value != 0 { buffer[0] |= 0b1000_0000; } diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index 30b736c08..1c913ba52 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -557,7 +557,7 @@ pub fn process_packet_events(ecs: &mut World) { info.latency = updated_info.latency; } if p.actions.update_display_name { - info.display_name = updated_info.display_name.clone(); + info.display_name.clone_from(&updated_info.display_name); } update_player_events.send(UpdatePlayerEvent { entity: player_entity, diff --git a/azalea-client/src/task_pool.rs b/azalea-client/src/task_pool.rs index da1de6079..d4963cd57 100644 --- a/azalea-client/src/task_pool.rs +++ b/azalea-client/src/task_pool.rs @@ -58,7 +58,7 @@ impl Default for TaskPoolOptions { TaskPoolOptions { // By default, use however many cores are available on the system min_total_threads: 1, - max_total_threads: std::usize::MAX, + max_total_threads: usize::MAX, // Use 25% of cores for IO, at least 1, no more than 4 io: TaskPoolThreadAssignmentPolicy { @@ -77,7 +77,7 @@ impl Default for TaskPoolOptions { // Use all remaining cores for compute (at least 1) compute: TaskPoolThreadAssignmentPolicy { min_threads: 1, - max_threads: std::usize::MAX, + max_threads: usize::MAX, percent: 1.0, // This 1.0 here means "whatever is left over" }, } diff --git a/azalea-physics/src/collision/shape.rs b/azalea-physics/src/collision/shape.rs index 710074de2..edcfbf24d 100755 --- a/azalea-physics/src/collision/shape.rs +++ b/azalea-physics/src/collision/shape.rs @@ -323,7 +323,7 @@ impl Shapes { coords: coords1.to_vec(), } } else { - IndexMerger::new_indirect(&coords1, &coords2, var3, var4) + IndexMerger::new_indirect(coords1, coords2, var3, var4) } } } diff --git a/azalea-physics/src/collision/world_collisions.rs b/azalea-physics/src/collision/world_collisions.rs index 4a3c2c3b3..9d25e9880 100644 --- a/azalea-physics/src/collision/world_collisions.rs +++ b/azalea-physics/src/collision/world_collisions.rs @@ -85,7 +85,6 @@ pub struct BlockCollisionsState<'a> { pub aabb: AABB, pub entity_shape: VoxelShape, pub cursor: Cursor3d, - pub only_suffocating_blocks: bool, cached_sections: Vec<(ChunkSectionPos, azalea_world::Section)>, cached_block_shapes: Vec<(BlockState, &'static VoxelShape)>, @@ -112,7 +111,6 @@ impl<'a> BlockCollisionsState<'a> { aabb, entity_shape: VoxelShape::from(aabb), cursor, - only_suffocating_blocks: false, cached_sections: Vec::new(), cached_block_shapes: Vec::new(), diff --git a/azalea/benches/physics.rs b/azalea/benches/physics.rs index 0d4a3f2fa..146b30187 100644 --- a/azalea/benches/physics.rs +++ b/azalea/benches/physics.rs @@ -1,20 +1,10 @@ -use std::{hint::black_box, sync::Arc, time::Duration}; - use azalea::{ - pathfinder::{ - astar::{self, a_star}, - goals::{BlockPosGoal, Goal}, - mining::MiningCache, - simulation::{SimulatedPlayerBundle, Simulation, SimulationSet}, - world::CachedWorld, - }, - BlockPos, Vec3, + pathfinder::simulation::{SimulatedPlayerBundle, SimulationSet}, + Vec3, }; use azalea_core::position::{ChunkBlockPos, ChunkPos}; -use azalea_inventory::Menu; use azalea_world::{Chunk, ChunkStorage, PartialChunkStorage}; use criterion::{criterion_group, criterion_main, Bencher, Criterion}; -use parking_lot::RwLock; #[allow(dead_code)] fn generate_world(partial_chunks: &mut PartialChunkStorage, size: u32) -> ChunkStorage { From f919fb65d67891d2eb6e302ea400743963c4c550 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 20 Apr 2024 04:12:16 +0000 Subject: [PATCH 37/37] upgrade deps --- Cargo.lock | 889 +++++++++--------- azalea-auth/Cargo.toml | 20 +- azalea-block/azalea-block-macros/Cargo.toml | 6 +- azalea-buf/Cargo.toml | 4 +- azalea-buf/azalea-buf-macros/Cargo.toml | 6 +- azalea-chat/Cargo.toml | 2 +- azalea-client/Cargo.toml | 30 +- azalea-core/Cargo.toml | 6 +- azalea-crypto/Cargo.toml | 2 +- azalea-entity/Cargo.toml | 8 +- .../azalea-inventory-macros/Cargo.toml | 6 +- azalea-language/Cargo.toml | 2 +- azalea-physics/Cargo.toml | 10 +- azalea-protocol/Cargo.toml | 22 +- .../azalea-protocol-macros/Cargo.toml | 6 +- .../azalea-registry-macros/Cargo.toml | 6 +- azalea-world/Cargo.toml | 10 +- azalea/Cargo.toml | 24 +- 18 files changed, 506 insertions(+), 553 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c0ea9beb..8c184a6a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -43,18 +43,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android_log-sys" @@ -70,9 +70,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -118,9 +118,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "as-any" @@ -130,24 +130,23 @@ checksum = "5b8a30a44e99a1c83ccb2a6298c563c888952a1c9134953db26876528f84c93a" [[package]] name = "async-channel" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" dependencies = [ "concurrent-queue", - "event-listener 5.0.0", - "event-listener-strategy 0.5.0", + "event-listener", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" dependencies = [ - "async-lock", "async-task", "concurrent-queue", "fastrand", @@ -155,26 +154,15 @@ dependencies = [ "slab", ] -[[package]] -name = "async-lock" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" -dependencies = [ - "event-listener 4.0.2", - "event-listener-strategy 0.4.0", - "pin-project-lite", -] - [[package]] name = "async-recursion" -version = "1.0.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -185,20 +173,20 @@ checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "azalea" @@ -277,7 +265,7 @@ version = "0.9.1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -308,7 +296,7 @@ version = "0.9.1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -439,7 +427,7 @@ version = "0.9.1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -518,7 +506,7 @@ version = "0.9.1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -537,7 +525,7 @@ version = "0.9.1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -567,9 +555,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -582,9 +570,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" [[package]] name = "base64ct" @@ -594,9 +582,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bevy_app" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bce3544afc010ffed39c136f6d5a9322d20d38df1394d468ba9106caa0434cb" +checksum = "ab348a32e46d21c5d61794294a92d415a770d26c7ba8951830b127b40b53ccc4" dependencies = [ "bevy_derive", "bevy_ecs", @@ -610,20 +598,20 @@ dependencies = [ [[package]] name = "bevy_derive" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028ae2a34678055185d7f1beebb1ebe6a8dcf3733e139e4ee1383a7f29ae8ba6" +checksum = "f0e01f8343f391e2d6a63b368b82fb5b252ed43c8713fc87f9a8f2d59407dd00" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] name = "bevy_ecs" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85406d5febbbdbcac4444ef61cd9a816f2f025ed692a3fc5439a32153070304" +checksum = "98e612a8e7962ead849e370f3a7e972b88df879ced05cd9dad6a0286d14650cf" dependencies = [ "async-channel", "bevy_ecs_macros", @@ -641,21 +629,21 @@ dependencies = [ [[package]] name = "bevy_ecs_macros" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3ce4b65d7c5f1990e729df75cec2ea6e2241b4a0c37b31c281a04c59c11b7b" +checksum = "807b5106c3410e58f4f523b55ea3c071e2a09e31e9510f3c22021c6a04732b5b" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] name = "bevy_log" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd5bcc3531f8008897fb03cc8751b86d0d29ef94f8fd38b422f9603b7ae80d0" +checksum = "a5eea6c527fd828b7fef8d0f518167f27f405b904a16f227b644687d3f46a809" dependencies = [ "android_log-sys", "bevy_app", @@ -669,22 +657,22 @@ dependencies = [ [[package]] name = "bevy_macro_utils" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac4401c25b197e7c1455a4875a90b61bba047a9e8d290ce029082c818ab1a21c" +checksum = "eb270c98a96243b29465139ed10bda2f675d00a11904f6588a5f7fc4774119c7" dependencies = [ "proc-macro2", "quote", "rustc-hash", - "syn 2.0.49", + "syn 2.0.60", "toml_edit", ] [[package]] name = "bevy_math" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f312b1b8aa6d3965b65040b08e33efac030db3071f20b44f9da9c4c3dfcaf76" +checksum = "f06daa26ffb82d90ba772256c0ba286f6c305c392f6976c9822717974805837c" dependencies = [ "glam", "serde", @@ -692,15 +680,15 @@ dependencies = [ [[package]] name = "bevy_ptr" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86afa4a88ee06b10fe1e6f28a796ba2eedd16804717cbbb911df0cbb0cd6677b" +checksum = "8050e2869fe341db6874203b5a01ff12673807a2c7c80cb829f6c7bea6997268" [[package]] name = "bevy_reflect" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "133dfab8d403d0575eeed9084e85780bbb449dcf75dd687448439117789b40a2" +checksum = "ccbd7de21d586457a340a0962ad0747dc5098ff925eb6b27a918c4bdd8252f7b" dependencies = [ "bevy_math", "bevy_ptr", @@ -716,22 +704,22 @@ dependencies = [ [[package]] name = "bevy_reflect_derive" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce1679a4dfdb2c9ff24ca590914c3cec119d7c9e1b56fa637776913acc030386" +checksum = "3ce33051bd49036d4a5a62aa3f2068672ec55f3ebe92aa0d003a341f15cc37ac" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", "uuid", ] [[package]] name = "bevy_tasks" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b20f243f6fc4c4ba10c2dbff891e947ddae947bb20b263f43e023558b35294bd" +checksum = "f07fcc4969b357de143509925b39c9a2c56eaa8750828d97f319ca9ed41897cb" dependencies = [ "async-channel", "async-executor", @@ -743,9 +731,9 @@ dependencies = [ [[package]] name = "bevy_time" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9738901b6b251d2c9250542af7002d6f671401fc3b74504682697c5ec822f210" +checksum = "38ea5ae9fe7f56f555dbb05a88d34931907873e3f0c7dc426591839eef72fe3e" dependencies = [ "bevy_app", "bevy_ecs", @@ -757,14 +745,14 @@ dependencies = [ [[package]] name = "bevy_utils" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a06aca1c1863606416b892f4c79e300dbc6211b6690953269051a431c2cca0" +checksum = "5a9f845a985c00e0ee8dc2d8af3f417be925fb52aad4bda5b96e2e58a2b4d2eb" dependencies = [ "ahash", "bevy_utils_proc_macros", "getrandom", - "hashbrown 0.14.3", + "hashbrown", "nonmax", "petgraph", "smallvec", @@ -776,13 +764,13 @@ dependencies = [ [[package]] name = "bevy_utils_proc_macros" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31ae98e9c0c08b0f5c90e22cd713201f759b98d4fd570b99867a695f8641859a" +checksum = "bef158627f30503d5c18c20c60b444829f698d343516eeaf6eeee078c9a45163" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -791,12 +779,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitflags" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" - [[package]] name = "block-buffer" version = "0.10.4" @@ -808,15 +790,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" [[package]] name = "byteorder" @@ -826,9 +808,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cast" @@ -838,12 +820,15 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfb8" @@ -862,9 +847,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "num-traits", "serde", @@ -872,9 +857,9 @@ dependencies = [ [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -883,15 +868,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -909,18 +894,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.12" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.12" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstyle", "clap_lex", @@ -928,9 +913,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -969,22 +954,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - [[package]] name = "cpufeatures" version = "0.2.12" @@ -996,9 +965,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -1041,32 +1010,29 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.17" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", ] @@ -1076,6 +1042,12 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -1094,9 +1066,9 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -1129,24 +1101,15 @@ dependencies = [ [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "either" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "enum-as-inner" @@ -1157,7 +1120,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -1172,9 +1135,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ "anstream", "anstyle", @@ -1191,70 +1154,39 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" +checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" dependencies = [ "serde", ] -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "event-listener" -version = "4.0.2" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "218a870470cce1469024e9fb66b901aa983929d81304a1cdb299f28118e550d5" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" dependencies = [ "concurrent-queue", "parking", "pin-project-lite", ] -[[package]] -name = "event-listener" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.2", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" dependencies = [ - "event-listener 5.0.0", + "event-listener", "pin-project-lite", ] [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "fixedbitset" @@ -1337,9 +1269,9 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ "fastrand", "futures-core", @@ -1356,7 +1288,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -1401,9 +1333,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "js-sys", @@ -1429,36 +1361,15 @@ dependencies = [ ] [[package]] -name = "h2" -version = "0.3.24" +name = "half" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 2.2.3", - "slab", - "tokio", - "tokio-util", - "tracing", + "cfg-if", + "crunchy", ] -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.3" @@ -1478,15 +1389,15 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "http" -version = "0.2.11" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -1495,12 +1406,24 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", "pin-project-lite", ] @@ -1510,12 +1433,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - [[package]] name = "humantime" version = "2.1.0" @@ -1524,40 +1441,58 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", - "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", "http", "hyper", + "hyper-util", "rustls", + "rustls-pki-types", "tokio", "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -1582,22 +1517,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.2.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -1617,12 +1542,12 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys 0.52.0", ] @@ -1637,15 +1562,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1677,12 +1602,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" - [[package]] name = "lock_api" version = "0.4.11" @@ -1695,9 +1614,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru-cache" @@ -1729,9 +1648,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -1747,18 +1666,18 @@ checksum = "d60a6352e005f1f86008644a9fe336a66f74c94428182162cc69eb8c6fff458d" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1789,9 +1708,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "3135b08af27d103b0a51f2ae0f8632117b7b185ccf931445affa8df530576a41" dependencies = [ "num-bigint", "num-complex", @@ -1831,28 +1750,27 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" dependencies = [ "num-traits", ] [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" dependencies = [ "autocfg", "num-integer", @@ -1972,14 +1890,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.3", + "indexmap", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2044,28 +1982,29 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "priority-queue" -version = "1.4.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bda9164fe05bc9225752d54aae413343c36f684380005398a6a8fde95fe785" +checksum = "509354d8a769e8d0b567d6821b84495c60213162761a732d68ce87c964bd347f" dependencies = [ "autocfg", - "indexmap 1.9.3", + "equivalent", + "indexmap", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2102,9 +2041,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -2112,9 +2051,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -2126,19 +2065,19 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -2152,13 +2091,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -2169,26 +2108,26 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", + "http-body-util", "hyper", "hyper-rustls", + "hyper-util", "ipnet", "js-sys", "log", @@ -2198,11 +2137,11 @@ dependencies = [ "pin-project-lite", "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", "tokio-rustls", "tower-service", @@ -2231,16 +2170,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2296,55 +2236,52 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.38.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" -dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - [[package]] name = "rustls" -version = "0.21.10" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ "base64", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" + [[package]] name = "rustls-webpki" -version = "0.101.7" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ "ring", + "rustls-pki-types", "untrusted", ] [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -2361,47 +2298,37 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "semver" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -2472,24 +2399,25 @@ dependencies = [ [[package]] name = "simdnbt" -version = "0.4.0" -source = "git+https://github.com/azalea-rs/simdnbt#4594562ef0146431fd8c4405c753b32d1bb89c6a" +version = "0.4.2" +source = "git+https://github.com/azalea-rs/simdnbt#860d6e1b3a50d49b58b2853bf160420cd0b5eafe" dependencies = [ "byteorder", "flate2", "residua-mutf8", "simdnbt-derive", "thiserror", + "valence_nbt", ] [[package]] name = "simdnbt-derive" -version = "0.4.0" -source = "git+https://github.com/azalea-rs/simdnbt#4594562ef0146431fd8c4405c753b32d1bb89c6a" +version = "0.4.1" +source = "git+https://github.com/azalea-rs/simdnbt#860d6e1b3a50d49b58b2853bf160420cd0b5eafe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -2515,42 +2443,44 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" dependencies = [ "serde", ] [[package]] name = "smol_str" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" dependencies = [ "serde", ] [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "socks5-impl" -version = "0.5.6" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dfc11441196e51be4f48c72b075e7fff394a3c6a43f93420f907a2708079b27" +checksum = "a3b7cb60ae94f81007e9c4e165b0999415a0b34249805309f31d38767e863329" dependencies = [ "as-any", "async-trait", "byteorder", "bytes", + "percent-encoding", + "serde", "thiserror", "tokio", ] @@ -2596,9 +2526,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.49" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -2611,45 +2541,24 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -2664,9 +2573,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2699,9 +2608,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -2724,16 +2633,17 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ "rustls", + "rustls-pki-types", "tokio", ] @@ -2763,11 +2673,33 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.3", + "indexmap", "toml_datetime", "winnow", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -2780,6 +2712,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2793,7 +2726,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -2927,9 +2860,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -2959,15 +2892,25 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", "md-5", "serde", ] +[[package]] +name = "valence_nbt" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3cddc3222ed5ead4fa446881b3deeeee0dba60b0088b2bf12fedbac7eda2312" +dependencies = [ + "byteorder", + "cesu8", +] + [[package]] name = "valuable" version = "0.1.0" @@ -2982,9 +2925,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -3007,9 +2950,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3017,24 +2960,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -3044,9 +2987,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3054,28 +2997,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -3093,9 +3036,12 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "winapi" @@ -3143,7 +3089,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -3163,17 +3109,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -3184,9 +3131,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -3196,9 +3143,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -3208,9 +3155,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -3220,9 +3173,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -3232,9 +3185,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -3244,9 +3197,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -3256,24 +3209,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.5.34" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.50.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -3296,7 +3249,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] diff --git a/azalea-auth/Cargo.toml b/azalea-auth/Cargo.toml index b7179e72d..55900a0e0 100644 --- a/azalea-auth/Cargo.toml +++ b/azalea-auth/Cargo.toml @@ -11,23 +11,23 @@ version = "0.9.1" [dependencies] azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-crypto = { path = "../azalea-crypto", version = "0.9.0" } -base64 = "0.21.7" -chrono = { version = "0.4.34", default-features = false, features = ["serde"] } +base64 = "0.22.0" +chrono = { version = "0.4.38", default-features = false, features = ["serde"] } tracing = "0.1.40" num-bigint = "0.4.4" once_cell = "1.19.0" -reqwest = { version = "0.11.24", default-features = false, features = [ +reqwest = { version = "0.12.4", default-features = false, features = [ "json", "rustls-tls", ] } rsa = "0.9.6" -serde = { version = "1.0.196", features = ["derive"] } -serde_json = "1.0.113" -thiserror = "1.0.57" -tokio = { version = "1.36.0", features = ["fs"] } -uuid = { version = "1.7.0", features = ["serde", "v3"] } +serde = { version = "1.0.198", features = ["derive"] } +serde_json = "1.0.116" +thiserror = "1.0.58" +tokio = { version = "1.37.0", features = ["fs"] } +uuid = { version = "1.8.0", features = ["serde", "v3"] } md-5 = "0.10.6" [dev-dependencies] -env_logger = "0.11.2" -tokio = { version = "1.36.0", features = ["full"] } +env_logger = "0.11.3" +tokio = { version = "1.37.0", features = ["full"] } diff --git a/azalea-block/azalea-block-macros/Cargo.toml b/azalea-block/azalea-block-macros/Cargo.toml index adad76184..b6c754251 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.78" -quote = "1.0.35" -syn = "2.0.49" +proc-macro2 = "1.0.81" +quote = "1.0.36" +syn = "2.0.60" diff --git a/azalea-buf/Cargo.toml b/azalea-buf/Cargo.toml index cb7886001..a477c84b3 100644 --- a/azalea-buf/Cargo.toml +++ b/azalea-buf/Cargo.toml @@ -14,8 +14,8 @@ azalea-buf-macros = { path = "./azalea-buf-macros", version = "0.9.0" } byteorder = "^1.5.0" tracing = "0.1.40" serde_json = { version = "^1.0", optional = true } -thiserror = "1.0.57" -uuid = "^1.7.0" +thiserror = "1.0.58" +uuid = "^1.8.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 f9df08616..57f7fc6ab 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.78" -quote = "^1.0.35" -syn = { version = "^2.0.49", features = ["extra-traits"] } +proc-macro2 = "^1.0.81" +quote = "^1.0.36" +syn = { version = "^2.0.60", features = ["extra-traits"] } diff --git a/azalea-chat/Cargo.toml b/azalea-chat/Cargo.toml index f70c164ce..dbea888ed 100644 --- a/azalea-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -23,5 +23,5 @@ simdnbt = { version = "0.4", optional = true, git = "https://github.com/azalea-r tracing = "0.1.40" once_cell = "1.19.0" serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0.113" +serde_json = "^1.0.116" azalea-registry = { path = "../azalea-registry", version = "0.9.0", optional = true } diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index b79f694a3..09d7b598b 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -10,9 +10,9 @@ version = "0.9.1" [dependencies] simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } -reqwest = { version = "0.11.24", default-features = false } -anyhow = "1.0.79" -async-trait = "0.1.77" +reqwest = { version = "0.12.4", default-features = false } +anyhow = "1.0.82" +async-trait = "0.1.80" azalea-auth = { path = "../azalea-auth", version = "0.9.0" } azalea-block = { path = "../azalea-block", version = "0.9.0" } azalea-chat = { path = "../azalea-chat", version = "0.9.0" } @@ -23,11 +23,11 @@ azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-protocol = { path = "../azalea-protocol", version = "0.9.0" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } azalea-world = { path = "../azalea-world", version = "0.9.0" } -bevy_app = "0.13.0" -bevy_ecs = "0.13.0" -bevy_log = { version = "0.13.0", optional = true } -bevy_tasks = "0.13.0" -bevy_time = "0.13.0" +bevy_app = "0.13.2" +bevy_ecs = "0.13.2" +bevy_log = { version = "0.13.2", optional = true } +bevy_tasks = "0.13.2" +bevy_time = "0.13.2" azalea-inventory = { path = "../azalea-inventory", version = "0.9.0" } derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } futures = "0.3.30" @@ -35,15 +35,15 @@ tracing = "0.1.40" nohash-hasher = "0.2.0" once_cell = "1.19.0" parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } -regex = "1.10.3" -thiserror = "^1.0.57" -tokio = { version = "^1.36.0", features = ["sync"] } -uuid = "^1.7.0" +regex = "1.10.4" +thiserror = "^1.0.58" +tokio = { version = "^1.37.0", features = ["sync"] } +uuid = "^1.8.0" azalea-entity = { version = "0.9.0", path = "../azalea-entity" } -serde_json = "1.0.113" -serde = "1.0.196" +serde_json = "1.0.116" +serde = "1.0.198" minecraft_folder_path = "0.1.2" -socks5-impl = "0.5.6" +socks5-impl = "0.5.12" [features] default = ["log"] diff --git a/azalea-core/Cargo.toml b/azalea-core/Cargo.toml index 7df9bde26..a8acde6b2 100644 --- a/azalea-core/Cargo.toml +++ b/azalea-core/Cargo.toml @@ -13,12 +13,12 @@ simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } azalea-buf = { path = "../azalea-buf", version = "0.9.0" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } -bevy_ecs = { version = "0.13.0", default-features = false, optional = true } +bevy_ecs = { version = "0.13.2", default-features = false, optional = true } nohash-hasher = "0.2.0" num-traits = "0.2.18" serde = { version = "^1.0", optional = true } -uuid = "^1.7.0" -serde_json = "^1.0.113" +uuid = "^1.8.0" +serde_json = "^1.0.116" tracing = "0.1.40" [features] diff --git a/azalea-crypto/Cargo.toml b/azalea-crypto/Cargo.toml index 07bd6847e..f4f359f04 100644 --- a/azalea-crypto/Cargo.toml +++ b/azalea-crypto/Cargo.toml @@ -18,7 +18,7 @@ rsa = { version = "0.9.6", features = ["sha2"] } rsa_public_encrypt_pkcs1 = "0.4.0" sha-1 = "^0.10.1" sha2 = "0.10.8" -uuid = "^1.7.0" +uuid = "^1.8.0" [dev-dependencies] criterion = { version = "^0.5.1", features = ["html_reports"] } diff --git a/azalea-entity/Cargo.toml b/azalea-entity/Cargo.toml index fe098a15b..206484845 100644 --- a/azalea-entity/Cargo.toml +++ b/azalea-entity/Cargo.toml @@ -19,12 +19,12 @@ azalea-core = { version = "0.9.0", path = "../azalea-core" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { version = "0.9.0", path = "../azalea-registry" } azalea-world = { version = "0.9.0", path = "../azalea-world" } -bevy_app = "0.13.0" -bevy_ecs = "0.13.0" +bevy_app = "0.13.2" +bevy_ecs = "0.13.2" derive_more = "0.99.17" enum-as-inner = "0.6.0" tracing = "0.1.40" nohash-hasher = "0.2.0" parking_lot = "0.12.1" -thiserror = "1.0.57" -uuid = "1.7.0" +thiserror = "1.0.58" +uuid = "1.8.0" diff --git a/azalea-inventory/azalea-inventory-macros/Cargo.toml b/azalea-inventory/azalea-inventory-macros/Cargo.toml index 7f5dddf00..ee6d6f58a 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.78" -quote = "1.0.35" -syn = "2.0.49" +proc-macro2 = "1.0.81" +quote = "1.0.36" +syn = "2.0.60" diff --git a/azalea-language/Cargo.toml b/azalea-language/Cargo.toml index 09dcda519..6a335745a 100644 --- a/azalea-language/Cargo.toml +++ b/azalea-language/Cargo.toml @@ -11,5 +11,5 @@ version = "0.9.1" [dependencies] once_cell = "1.19.0" serde = "^1.0" -serde_json = "^1.0.113" +serde_json = "^1.0.116" # tokio = {version = "^1.21.2", features = ["fs"]} diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index 447f7b8c3..ecf3bc3be 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -15,14 +15,14 @@ azalea-entity = { version = "0.9.0", path = "../azalea-entity" } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } azalea-world = { path = "../azalea-world", version = "0.9.0" } -bevy_app = "0.13.0" -bevy_ecs = "0.13.0" +bevy_app = "0.13.2" +bevy_ecs = "0.13.2" tracing = "0.1.40" once_cell = "1.19.0" parking_lot = "^0.12.1" nohash-hasher = "0.2.0" -smallvec = "1.13.1" +smallvec = "1.13.2" [dev-dependencies] -bevy_time = "0.13.0" -uuid = "^1.7.0" +bevy_time = "0.13.2" +uuid = "^1.8.0" diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 609d2019c..0cc5968b4 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -10,7 +10,7 @@ version = "0.9.1" [dependencies] simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" } -async-recursion = "1.0.5" +async-recursion = "1.1.0" azalea-auth = { path = "../azalea-auth", version = "0.9.0" } azalea-block = { path = "../azalea-block", default-features = false, version = "0.9.0" } azalea-brigadier = { path = "../azalea-brigadier", version = "0.9.0", features = [ @@ -29,26 +29,26 @@ azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-protocol-macros = { path = "./azalea-protocol-macros", version = "0.9.0" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } azalea-world = { path = "../azalea-world", version = "0.9.0" } -bevy_ecs = { version = "0.13.0", default-features = false } +bevy_ecs = { version = "0.13.2", default-features = false } byteorder = "^1.5.0" -bytes = "^1.5.0" +bytes = "^1.6.0" flate2 = "1.0.28" futures = "0.3.30" -futures-lite = "2.2.0" +futures-lite = "2.3.0" futures-util = "0.3.30" tracing = "0.1.40" serde = { version = "^1.0", features = ["serde_derive"] } -serde_json = "^1.0.113" -thiserror = "1.0.57" -tokio = { version = "^1.36.0", features = ["io-util", "net", "macros"] } +serde_json = "^1.0.116" +thiserror = "1.0.58" +tokio = { version = "^1.37.0", features = ["io-util", "net", "macros"] } tokio-util = { version = "0.7.10", features = ["codec"] } trust-dns-resolver = { version = "^0.23.2", default-features = false, features = [ "tokio-runtime", ] } -uuid = "1.7.0" -log = "0.4.20" +uuid = "1.8.0" +log = "0.4.21" -socks5-impl = "0.5.6" +socks5-impl = "0.5.12" [features] connecting = [] @@ -57,7 +57,7 @@ packets = ["connecting", "dep:azalea-core"] strict_registry = ["packets"] [dev-dependencies] -anyhow = "^1.0.79" +anyhow = "^1.0.82" tracing = "^0.1.40" tracing-subscriber = "^0.3.18" once_cell = "1.19.0" diff --git a/azalea-protocol/azalea-protocol-macros/Cargo.toml b/azalea-protocol/azalea-protocol-macros/Cargo.toml index 394c4c442..f984a2cdb 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.78" -quote = "^1.0.35" -syn = "^2.0.49" +proc-macro2 = "^1.0.81" +quote = "^1.0.36" +syn = "^2.0.60" diff --git a/azalea-registry/azalea-registry-macros/Cargo.toml b/azalea-registry/azalea-registry-macros/Cargo.toml index ac40eb7e8..7654cec4c 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.78" -quote = "1.0.35" -syn = "2.0.49" +proc-macro2 = "1.0.81" +quote = "1.0.36" +syn = "2.0.60" [features] serde = [] diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index 37915f4c0..f01559d0f 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -17,16 +17,16 @@ azalea-core = { path = "../azalea-core", version = "0.9.0", features = [ ] } azalea-inventory = { version = "0.9.0", path = "../azalea-inventory" } azalea-registry = { path = "../azalea-registry", version = "0.9.0" } -bevy_ecs = "0.13.0" +bevy_ecs = "0.13.2" derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } tracing = "0.1.40" nohash-hasher = "0.2.0" once_cell = "1.19.0" parking_lot = "^0.12.1" -thiserror = "1.0.57" -uuid = "1.7.0" -serde_json = "1.0.113" -serde = "1.0.196" +thiserror = "1.0.58" +uuid = "1.8.0" +serde_json = "1.0.116" +serde = "1.0.198" rustc-hash = "1.1.0" [dev-dependencies] diff --git a/azalea/Cargo.toml b/azalea/Cargo.toml index 72a18aa34..372b4bb58 100644 --- a/azalea/Cargo.toml +++ b/azalea/Cargo.toml @@ -12,8 +12,8 @@ pre-release-replacements = [ ] [dependencies] -anyhow = "^1.0.79" -async-trait = "0.1.77" +anyhow = "^1.0.82" +async-trait = "0.1.80" azalea-block = { version = "0.9.0", path = "../azalea-block" } azalea-chat = { version = "0.9.0", path = "../azalea-chat" } azalea-client = { version = "0.9.0", path = "../azalea-client", default-features = false } @@ -26,23 +26,23 @@ azalea-world = { version = "0.9.0", path = "../azalea-world" } azalea-auth = { version = "0.9.0", path = "../azalea-auth" } azalea-brigadier = { version = "0.9.0", path = "../azalea-brigadier" } azalea-buf = { version = "0.9.0", path = "../azalea-buf" } -bevy_app = "0.13.0" -bevy_ecs = "0.13.0" -bevy_tasks = { version = "0.13.0", features = ["multi-threaded"] } +bevy_app = "0.13.2" +bevy_ecs = "0.13.2" +bevy_tasks = { version = "0.13.2", features = ["multi-threaded"] } derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } futures = "0.3.30" -futures-lite = "2.2.0" +futures-lite = "2.3.0" tracing = "0.1.40" nohash-hasher = "0.2.0" num-traits = "0.2.18" parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } -priority-queue = "1.4.0" -thiserror = "^1.0.57" -tokio = "^1.36.0" -uuid = "1.7.0" -bevy_log = "0.13.0" +priority-queue = "2.0.2" +thiserror = "^1.0.58" +tokio = "^1.37.0" +uuid = "1.8.0" +bevy_log = "0.13.2" azalea-entity = { version = "0.9.0", path = "../azalea-entity" } -bevy_time = "0.13.0" +bevy_time = "0.13.2" rustc-hash = "1.1.0" [dev-dependencies]