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"] }