Skip to content

Commit

Permalink
upgrade to simdnbt 0.6 (#160) (#162)
Browse files Browse the repository at this point in the history
Co-authored-by: mat <27899617+mat-1@users.noreply.github.com>
  • Loading branch information
EightFactorial and mat-1 authored Jul 12, 2024
1 parent 38eab50 commit 24c5cb8
Show file tree
Hide file tree
Showing 30 changed files with 507 additions and 490 deletions.
469 changes: 253 additions & 216 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions azalea-auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ version = "0.10.1"
[dependencies]
azalea-buf = { path = "../azalea-buf", version = "0.10.0" }
azalea-crypto = { path = "../azalea-crypto", version = "0.10.0" }
base64 = "0.22.0"
base64 = "0.22.1"
chrono = { version = "0.4.38", default-features = false, features = ["serde"] }
tracing = "0.1.40"
num-bigint = "0.4.4"
num-bigint = "0.4.6"
once_cell = "1.19.0"
reqwest = { version = "0.12.4", default-features = false, features = [
reqwest = { version = "0.12.5", default-features = false, features = [
"json",
"rustls-tls",
] }
rsa = "0.9.6"
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
thiserror = "1.0.59"
tokio = { version = "1.37.0", features = ["fs"] }
uuid = { version = "1.8.0", features = ["serde", "v3"] }
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.120"
thiserror = "1.0.61"
tokio = { version = "1.38.0", features = ["fs"] }
uuid = { version = "1.9.1", features = ["serde", "v3"] }
md-5 = "0.10.6"

[dev-dependencies]
env_logger = "0.11.3"
tokio = { version = "1.37.0", features = ["full"] }
tokio = { version = "1.38.0", features = ["full"] }
4 changes: 2 additions & 2 deletions azalea-block/azalea-block-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.81"
proc-macro2 = "1.0.86"
quote = "1.0.36"
syn = "2.0.60"
syn = "2.0.68"
2 changes: 1 addition & 1 deletion azalea-block/azalea-block-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ pub fn make_block_states(input: TokenStream) -> TokenStream {
fn name_to_ident(name: &str) -> Ident {
let ident_str = match name {
"type" => "kind",
_ => &name,
_ => name,
};
Ident::new(ident_str, proc_macro2::Span::call_site())
}
2 changes: 1 addition & 1 deletion azalea-brigadier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bevy_ecs = "0.13.0"
[dependencies]
azalea-buf = { path = "../azalea-buf", version = "0.10.0", optional = true }
azalea-chat = { path = "../azalea-chat", version = "0.10.0", optional = true }
parking_lot = "0.12.1"
parking_lot = "0.12.3"

[features]
azalea-buf = ["dep:azalea-buf", "dep:azalea-chat", "azalea-chat/azalea-buf"]
6 changes: 3 additions & 3 deletions azalea-buf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
simdnbt = { version = "0.5", git = "https://github.com/azalea-rs/simdnbt" }
simdnbt = "0.6"
azalea-buf-macros = { path = "./azalea-buf-macros", version = "0.10.0" }
byteorder = "^1.5.0"
tracing = "0.1.40"
serde_json = { version = "^1.0", optional = true }
thiserror = "1.0.59"
uuid = "^1.8.0"
thiserror = "1.0.61"
uuid = "^1.9.1"

[features]
serde_json = ["dep:serde_json"]
4 changes: 2 additions & 2 deletions azalea-buf/azalea-buf-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.81"
proc-macro2 = "^1.0.86"
quote = "^1.0.36"
syn = { version = "^2.0.60", features = ["extra-traits"] }
syn = { version = "^2.0.68", features = ["extra-traits"] }
4 changes: 2 additions & 2 deletions azalea-buf/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ impl<T: McBufReadable, const N: usize> McBufReadable for [T; N] {

impl McBufReadable for simdnbt::owned::NbtTag {
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
Ok(simdnbt::owned::NbtTag::read(buf)?)
Ok(simdnbt::owned::read_tag(buf)?)
}
}

impl McBufReadable for simdnbt::owned::NbtCompound {
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
match simdnbt::owned::NbtTag::read(buf)? {
match simdnbt::owned::read_tag(buf)? {
simdnbt::owned::NbtTag::Compound(compound) => Ok(compound),
_ => Err(BufReadError::Custom("Expected compound tag".to_string())),
}
Expand Down
4 changes: 2 additions & 2 deletions azalea-chat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ azalea-buf = { path = "../azalea-buf", features = [
"serde_json",
], version = "0.10.0", optional = true }
azalea-language = { path = "../azalea-language", version = "0.10.0" }
simdnbt = { version = "0.5", optional = true, git = "https://github.com/azalea-rs/simdnbt" }
simdnbt = { version = "0.6", optional = true }
tracing = "0.1.40"
once_cell = "1.19.0"
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0.116"
serde_json = "^1.0.120"
azalea-registry = { path = "../azalea-registry", version = "0.10.0", optional = true }
311 changes: 147 additions & 164 deletions azalea-chat/src/component.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion azalea-chat/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ impl Style {
#[cfg(feature = "simdnbt")]
impl simdnbt::Deserialize for Style {
fn from_compound(
compound: &simdnbt::borrow::NbtCompound,
compound: simdnbt::borrow::NbtCompound,
) -> Result<Self, simdnbt::DeserializeError> {
let bold = compound.byte("bold").map(|v| v != 0);
let italic = compound.byte("italic").map(|v| v != 0);
Expand Down
32 changes: 16 additions & 16 deletions azalea-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
simdnbt = { version = "0.5", git = "https://github.com/azalea-rs/simdnbt" }
reqwest = { version = "0.12.4", default-features = false }
anyhow = "1.0.82"
simdnbt = "0.6"
reqwest = { version = "0.12.5", default-features = false }
anyhow = "1.0.86"
async-trait = "0.1.80"
azalea-auth = { path = "../azalea-auth", version = "0.10.0" }
azalea-block = { path = "../azalea-block", version = "0.10.0" }
Expand All @@ -23,23 +23,23 @@ azalea-buf = { path = "../azalea-buf", version = "0.10.0" }
azalea-protocol = { path = "../azalea-protocol", version = "0.10.0" }
azalea-registry = { path = "../azalea-registry", version = "0.10.0" }
azalea-world = { path = "../azalea-world", version = "0.10.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"
derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] }
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"
derive_more = { version = "0.99.18", features = ["deref", "deref_mut"] }
futures = "0.3.30"
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.4"
thiserror = "^1.0.59"
tokio = { version = "^1.37.0", features = ["sync"] }
uuid = "^1.8.0"
serde_json = "1.0.116"
serde = "1.0.198"
parking_lot = { version = "^0.12.3", features = ["deadlock_detection"] }
regex = "1.10.5"
thiserror = "^1.0.61"
tokio = { version = "^1.38.0", features = ["sync"] }
uuid = "^1.9.1"
serde_json = "1.0.120"
serde = "1.0.203"
minecraft_folder_path = "0.1.2"
azalea-entity = { version = "0.10.0", path = "../azalea-entity" }
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }
Expand Down
10 changes: 5 additions & 5 deletions azalea-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
simdnbt = { version = "0.5", git = "https://github.com/azalea-rs/simdnbt" }
simdnbt = "0.6"
azalea-buf = { path = "../azalea-buf", version = "0.10.0" }
azalea-registry = { path = "../azalea-registry", version = "0.10.0" }
bevy_ecs = { version = "0.13.2", 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.18"
num-traits = "0.2.19"
serde = { version = "^1.0", optional = true }
uuid = "^1.8.0"
serde_json = "^1.0.116"
uuid = "^1.9.1"
serde_json = "^1.0.120"
tracing = "0.1.40"

[features]
Expand Down
1 change: 0 additions & 1 deletion azalea-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![doc = include_str!("../README.md")]
#![feature(lazy_cell)]
#![feature(trait_upcasting)]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
Expand Down
6 changes: 3 additions & 3 deletions azalea-core/src/registry_holder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl RegistryHolder {
value.write(&mut nbt_bytes);
let nbt_borrow_compound =
simdnbt::borrow::read_compound(&mut Cursor::new(&nbt_bytes)).ok()?;
let value = match T::from_compound(&nbt_borrow_compound) {
let value = match T::from_compound((&nbt_borrow_compound).into()) {
Ok(value) => value,
Err(err) => {
return Some(Err(err));
Expand Down Expand Up @@ -182,7 +182,7 @@ pub enum MonsterSpawnLightLevel {
}

impl FromNbtTag for MonsterSpawnLightLevel {
fn from_nbt_tag(tag: &simdnbt::borrow::NbtTag) -> Option<Self> {
fn from_nbt_tag(tag: simdnbt::borrow::NbtTag) -> Option<Self> {
if let Some(value) = tag.int() {
Some(Self::Simple(value as u32))
} else if let Some(value) = tag.compound() {
Expand Down Expand Up @@ -240,7 +240,7 @@ pub enum BiomePrecipitation {
Snow,
}
impl FromNbtTag for BiomePrecipitation {
fn from_nbt_tag(tag: &simdnbt::borrow::NbtTag) -> Option<Self> {
fn from_nbt_tag(tag: simdnbt::borrow::NbtTag) -> Option<Self> {
match tag.string()?.to_str().as_ref() {
"none" => Some(Self::None),
"rain" => Some(Self::Rain),
Expand Down
2 changes: 1 addition & 1 deletion azalea-core/src/resource_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<'de> Deserialize<'de> for ResourceLocation {
}

impl FromNbtTag for ResourceLocation {
fn from_nbt_tag(tag: &simdnbt::borrow::NbtTag) -> Option<Self> {
fn from_nbt_tag(tag: simdnbt::borrow::NbtTag) -> Option<Self> {
tag.string().and_then(|s| s.to_str().parse().ok())
}
}
Expand Down
4 changes: 2 additions & 2 deletions azalea-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-crypto"
aes = "0.8.4"
azalea-buf = { path = "../azalea-buf", version = "0.10.0" }
cfb8 = "0.8.1"
num-bigint = "^0.4.4"
num-bigint = "^0.4.6"
rand = { version = "^0.8.5", features = ["getrandom"] }
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.8.0"
uuid = "^1.9.1"

[dev-dependencies]
criterion = { version = "^0.5.1", features = ["html_reports"] }
Expand Down
14 changes: 7 additions & 7 deletions azalea-entity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.5", git = "https://github.com/azalea-rs/simdnbt" }
simdnbt = "0.6"
azalea-block = { version = "0.10.0", path = "../azalea-block" }
azalea-buf = { version = "0.10.0", path = "../azalea-buf" }
azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = [
Expand All @@ -19,12 +19,12 @@ azalea-core = { version = "0.10.0", path = "../azalea-core" }
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }
azalea-registry = { version = "0.10.0", path = "../azalea-registry" }
azalea-world = { version = "0.10.0", path = "../azalea-world" }
bevy_app = "0.13.2"
bevy_ecs = "0.13.2"
derive_more = "0.99.17"
bevy_app = "0.13.0"
bevy_ecs = "0.13.0"
derive_more = "0.99.18"
enum-as-inner = "0.6.0"
tracing = "0.1.40"
nohash-hasher = "0.2.0"
parking_lot = "0.12.1"
thiserror = "1.0.59"
uuid = "1.8.0"
parking_lot = "0.12.3"
thiserror = "1.0.61"
uuid = "1.9.1"
4 changes: 2 additions & 2 deletions azalea-inventory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
simdnbt = { version = "0.5", git = "https://github.com/azalea-rs/simdnbt" }
simdnbt = "0.6"
azalea-buf = { version = "0.10.0", path = "../azalea-buf" }
azalea-inventory-macros = { version = "0.10.0", path = "./azalea-inventory-macros" }
azalea-registry = { version = "0.10.0", path = "../azalea-registry" }
azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = [
"azalea-buf",
] }
azalea-core = { version = "0.10.0", path = "../azalea-core" }
uuid = "1.8.0"
uuid = "1.9.1"
4 changes: 2 additions & 2 deletions azalea-inventory/azalea-inventory-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.81"
proc-macro2 = "1.0.86"
quote = "1.0.36"
syn = "2.0.60"
syn = "2.0.68"
2 changes: 1 addition & 1 deletion azalea-language/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ version = "0.10.0"
[dependencies]
once_cell = "1.19.0"
serde = "^1.0"
serde_json = "^1.0.116"
serde_json = "^1.0.120"
# tokio = {version = "^1.21.2", features = ["fs"]}
10 changes: 5 additions & 5 deletions azalea-physics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ azalea-block = { path = "../azalea-block", version = "0.10.0" }
azalea-core = { path = "../azalea-core", version = "0.10.0" }
azalea-registry = { path = "../azalea-registry", version = "0.10.0" }
azalea-world = { path = "../azalea-world", version = "0.10.0" }
bevy_app = "0.13.2"
bevy_ecs = "0.13.2"
bevy_app = "0.13.0"
bevy_ecs = "0.13.0"
tracing = "0.1.40"
once_cell = "1.19.0"
parking_lot = "^0.12.1"
parking_lot = "^0.12.3"
nohash-hasher = "0.2.0"
smallvec = "1.13.2"
azalea-entity = { version = "0.10.0", path = "../azalea-entity" }
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }

[dev-dependencies]
bevy_time = "0.13.2"
uuid = "^1.8.0"
bevy_time = "0.13.0"
uuid = "^1.9.1"
1 change: 0 additions & 1 deletion azalea-physics/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = include_str!("../README.md")]
#![feature(trait_alias)]
#![feature(lazy_cell)]

pub mod clip;
pub mod collision;
Expand Down
24 changes: 12 additions & 12 deletions azalea-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
simdnbt = { version = "0.5", git = "https://github.com/azalea-rs/simdnbt" }
async-recursion = "1.1.0"
simdnbt = "0.6"
async-recursion = "1.1.1"
azalea-auth = { path = "../azalea-auth", version = "0.10.0" }
azalea-block = { path = "../azalea-block", default-features = false, version = "0.10.0" }
azalea-brigadier = { path = "../azalea-brigadier", version = "0.10.0", features = [
Expand All @@ -28,35 +28,35 @@ azalea-crypto = { path = "../azalea-crypto", version = "0.10.0" }
azalea-protocol-macros = { path = "./azalea-protocol-macros", version = "0.10.0" }
azalea-registry = { path = "../azalea-registry", version = "0.10.0" }
azalea-world = { path = "../azalea-world", version = "0.10.0" }
bevy_ecs = { version = "0.13.2", default-features = false }
bevy_ecs = { version = "0.13.0", default-features = false }
byteorder = "^1.5.0"
bytes = "^1.6.0"
flate2 = "1.0.28"
flate2 = "1.0.30"
futures = "0.3.30"
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.116"
thiserror = "1.0.59"
tokio = { version = "^1.37.0", features = ["io-util", "net", "macros"] }
tokio-util = { version = "0.7.10", features = ["codec"] }
serde_json = "^1.0.120"
thiserror = "1.0.61"
tokio = { version = "^1.38.0", features = ["io-util", "net", "macros"] }
tokio-util = { version = "0.7.11", features = ["codec"] }
trust-dns-resolver = { version = "^0.23.2", default-features = false, features = [
"tokio-runtime",
] }
uuid = "1.8.0"
log = "0.4.21"
uuid = "1.9.1"
log = "0.4.22"
azalea-entity = { version = "0.10.0", path = "../azalea-entity" }
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }
socks5-impl = "0.5.12"
socks5-impl = "0.5.14"

[features]
connecting = []
default = ["packets"]
packets = ["connecting", "dep:azalea-core"]

[dev-dependencies]
anyhow = "^1.0.82"
anyhow = "^1.0.86"
tracing = "^0.1.40"
tracing-subscriber = "^0.3.18"
once_cell = "1.19.0"
Loading

0 comments on commit 24c5cb8

Please sign in to comment.