1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

upgrade to simdnbt 0.6 (#160) (#162)

Co-authored-by: mat <27899617+mat-1@users.noreply.github.com>
This commit is contained in:
EightFactorial 2024-07-11 22:47:43 -07:00 committed by GitHub
parent 38eab50b4f
commit 24c5cb80aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 508 additions and 491 deletions

469
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -11,23 +11,23 @@ version = "0.10.1"
[dependencies] [dependencies]
azalea-buf = { path = "../azalea-buf", version = "0.10.0" } azalea-buf = { path = "../azalea-buf", version = "0.10.0" }
azalea-crypto = { path = "../azalea-crypto", 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"] } chrono = { version = "0.4.38", default-features = false, features = ["serde"] }
tracing = "0.1.40" tracing = "0.1.40"
num-bigint = "0.4.4" num-bigint = "0.4.6"
once_cell = "1.19.0" once_cell = "1.19.0"
reqwest = { version = "0.12.4", default-features = false, features = [ reqwest = { version = "0.12.5", default-features = false, features = [
"json", "json",
"rustls-tls", "rustls-tls",
] } ] }
rsa = "0.9.6" rsa = "0.9.6"
serde = { version = "1.0.198", features = ["derive"] } serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.116" serde_json = "1.0.120"
thiserror = "1.0.59" thiserror = "1.0.61"
tokio = { version = "1.37.0", features = ["fs"] } tokio = { version = "1.38.0", features = ["fs"] }
uuid = { version = "1.8.0", features = ["serde", "v3"] } uuid = { version = "1.9.1", features = ["serde", "v3"] }
md-5 = "0.10.6" md-5 = "0.10.6"
[dev-dependencies] [dev-dependencies]
env_logger = "0.11.3" env_logger = "0.11.3"
tokio = { version = "1.37.0", features = ["full"] } tokio = { version = "1.38.0", features = ["full"] }

View file

@ -12,6 +12,6 @@ proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
proc-macro2 = "1.0.81" proc-macro2 = "1.0.86"
quote = "1.0.36" quote = "1.0.36"
syn = "2.0.60" syn = "2.0.68"

View file

@ -829,7 +829,7 @@ pub fn make_block_states(input: TokenStream) -> TokenStream {
fn name_to_ident(name: &str) -> Ident { fn name_to_ident(name: &str) -> Ident {
let ident_str = match name { let ident_str = match name {
"type" => "kind", "type" => "kind",
_ => &name, _ => name,
}; };
Ident::new(ident_str, proc_macro2::Span::call_site()) Ident::new(ident_str, proc_macro2::Span::call_site())
} }

View file

@ -15,7 +15,7 @@ bevy_ecs = "0.13.0"
[dependencies] [dependencies]
azalea-buf = { path = "../azalea-buf", version = "0.10.0", optional = true } azalea-buf = { path = "../azalea-buf", version = "0.10.0", optional = true }
azalea-chat = { path = "../azalea-chat", 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] [features]
azalea-buf = ["dep:azalea-buf", "dep:azalea-chat", "azalea-chat/azalea-buf"] azalea-buf = ["dep:azalea-buf", "dep:azalea-chat", "azalea-chat/azalea-buf"]

View file

@ -9,13 +9,13 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [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" } azalea-buf-macros = { path = "./azalea-buf-macros", version = "0.10.0" }
byteorder = "^1.5.0" byteorder = "^1.5.0"
tracing = "0.1.40" tracing = "0.1.40"
serde_json = { version = "^1.0", optional = true } serde_json = { version = "^1.0", optional = true }
thiserror = "1.0.59" thiserror = "1.0.61"
uuid = "^1.8.0" uuid = "^1.9.1"
[features] [features]
serde_json = ["dep:serde_json"] serde_json = ["dep:serde_json"]

View file

@ -11,6 +11,6 @@ proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
proc-macro2 = "^1.0.81" proc-macro2 = "^1.0.86"
quote = "^1.0.36" quote = "^1.0.36"
syn = { version = "^2.0.60", features = ["extra-traits"] } syn = { version = "^2.0.68", features = ["extra-traits"] }

View file

@ -344,13 +344,13 @@ impl<T: McBufReadable, const N: usize> McBufReadable for [T; N] {
impl McBufReadable for simdnbt::owned::NbtTag { impl McBufReadable for simdnbt::owned::NbtTag {
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { 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 { impl McBufReadable for simdnbt::owned::NbtCompound {
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { 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), simdnbt::owned::NbtTag::Compound(compound) => Ok(compound),
_ => Err(BufReadError::Custom("Expected compound tag".to_string())), _ => Err(BufReadError::Custom("Expected compound tag".to_string())),
} }

View file

@ -19,9 +19,9 @@ azalea-buf = { path = "../azalea-buf", features = [
"serde_json", "serde_json",
], version = "0.10.0", optional = true } ], version = "0.10.0", optional = true }
azalea-language = { path = "../azalea-language", version = "0.10.0" } 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" tracing = "0.1.40"
once_cell = "1.19.0" once_cell = "1.19.0"
serde = { version = "^1.0", features = ["derive"] } 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 } azalea-registry = { path = "../azalea-registry", version = "0.10.0", optional = true }

View file

@ -11,7 +11,7 @@ use serde::{de, Deserialize, Deserializer, Serialize};
#[cfg(feature = "simdnbt")] #[cfg(feature = "simdnbt")]
use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _}; use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _};
use std::fmt::Display; use std::fmt::Display;
use tracing::{trace, warn}; use tracing::{debug, trace, warn};
/// A chat component, basically anything you can see in chat. /// A chat component, basically anything you can see in chat.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Hash)] #[derive(Clone, Debug, PartialEq, Eq, Serialize, Hash)]
@ -291,181 +291,164 @@ impl simdnbt::Serialize for FormattedText {
#[cfg(feature = "simdnbt")] #[cfg(feature = "simdnbt")]
impl simdnbt::FromNbtTag for FormattedText { impl simdnbt::FromNbtTag for FormattedText {
fn from_nbt_tag(tag: &simdnbt::borrow::NbtTag) -> Option<Self> { fn from_nbt_tag(tag: simdnbt::borrow::NbtTag) -> Option<Self> {
// we create a component that we might add siblings to // if it's a string, return a text component with that string
if let Some(string) = tag.string() {
Some(FormattedText::from(string))
}
// if it's a compound, make it do things with { text } and stuff
// simdnbt::borrow::NbtTag::Compound(compound) => {
else if let Some(compound) = tag.compound() {
FormattedText::from_nbt_compound(compound)
}
// ok so it's not a compound, if it's a list deserialize every item
else if let Some(list) = tag.list() {
let mut component;
if let Some(compounds) = list.compounds() {
component = FormattedText::from_nbt_compound(compounds.first()?)?;
for compound in compounds.into_iter().skip(1) {
component.append(FormattedText::from_nbt_compound(compound)?);
}
} else if let Some(strings) = list.strings() {
component = FormattedText::from(*(strings.first()?));
for &string in strings.iter().skip(1) {
component.append(FormattedText::from(string));
}
} else {
debug!("couldn't parse {list:?} as FormattedText");
return None;
}
Some(component)
} else {
Some(FormattedText::Text(TextComponent::new("".to_owned())))
}
}
}
#[cfg(feature = "simdnbt")]
impl FormattedText {
pub fn from_nbt_compound(compound: simdnbt::borrow::NbtCompound) -> Option<Self> {
let mut component: FormattedText; let mut component: FormattedText;
match tag { if let Some(text) = compound.get("text") {
// if it's a string, return a text component with that string let text = text.string().unwrap_or_default().to_string();
simdnbt::borrow::NbtTag::String(string) => { component = FormattedText::Text(TextComponent::new(text));
Some(FormattedText::Text(TextComponent::new(string.to_string()))) } else if let Some(translate) = compound.get("translate") {
} let translate = translate.string()?.into();
// if it's a compound, make it do things with { text } and stuff if let Some(with) = compound.get("with") {
simdnbt::borrow::NbtTag::Compound(compound) => { let mut with_array = Vec::new();
if let Some(text) = compound.get("text") { let with_list = with.list()?;
let text = text.string().unwrap_or_default().to_string(); if with_list.empty() {
component = FormattedText::Text(TextComponent::new(text)); } else if let Some(with) = with_list.strings() {
} else if let Some(translate) = compound.get("translate") { for item in with {
let translate = translate.string()?.into(); with_array.push(StringOrComponent::String(item.to_string()));
if let Some(with) = compound.get("with") { }
let mut with_array = Vec::new(); } else if let Some(with) = with_list.compounds() {
match with.list()? { for item in with {
simdnbt::borrow::NbtList::Empty => {} // if it's a string component with no styling and no siblings,
simdnbt::borrow::NbtList::String(with) => { // just add a string to
for item in *with { // with_array otherwise add the
with_array.push(StringOrComponent::String(item.to_string())); // component to the array
if let Some(primitive) = item.get("") {
// minecraft does this sometimes, for example
// for the /give system messages
if let Some(b) = primitive.byte() {
// interpreted as boolean
with_array.push(StringOrComponent::String(
if b != 0 { "true" } else { "false" }.to_string(),
));
} else if let Some(s) = primitive.short() {
with_array.push(StringOrComponent::String(s.to_string()));
} else if let Some(i) = primitive.int() {
with_array.push(StringOrComponent::String(i.to_string()));
} else if let Some(l) = primitive.long() {
with_array.push(StringOrComponent::String(l.to_string()));
} else if let Some(f) = primitive.float() {
with_array.push(StringOrComponent::String(f.to_string()));
} else if let Some(d) = primitive.double() {
with_array.push(StringOrComponent::String(d.to_string()));
} else if let Some(s) = primitive.string() {
with_array.push(StringOrComponent::String(s.to_string()));
} else {
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_compound(item) {
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;
} }
} }
simdnbt::borrow::NbtList::Compound(with) => { with_array.push(StringOrComponent::FormattedText(
for item in *with { FormattedText::from_nbt_compound(item)?,
// if it's a string component with no styling and no siblings, ));
// just add a string to } else {
// with_array otherwise add the warn!("couldn't parse {item:?} as FormattedText");
// component to the array with_array.push(StringOrComponent::String("?".to_string()));
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;
}
}
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()));
}
}
}
_ => {
warn!("couldn't parse {with:?} as FormattedText because it's not a list of compounds");
return None;
}
} }
component = FormattedText::Translatable(TranslatableComponent::new(
translate, with_array,
));
} else {
// if it doesn't have a "with", just have the with_array be empty
component = FormattedText::Translatable(TranslatableComponent::new(
translate,
Vec::new(),
));
} }
} else if let Some(score) = compound.compound("score") {
// 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
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
trace!("selector text components aren't yet supported");
return None;
} else if compound.get("keybind").is_some() {
// keybind text components aren't yet supported
trace!("keybind text components aren't yet supported");
return None;
} else if let Some(tag) = compound.get("") {
return FormattedText::from_nbt_tag(tag);
} else { } else {
let _nbt = compound.get("nbt")?; warn!("couldn't parse {with:?} as FormattedText because it's not a list of compounds");
let _separator = FormattedText::parse_separator_nbt(compound)?;
let _interpret = match compound.get("interpret") {
Some(v) => v.byte().unwrap_or_default() != 0,
None => false,
};
if let Some(_block) = compound.get("block") {}
trace!("nbt text components aren't yet supported");
return None; return None;
} }
if let Some(extra) = compound.get("extra") { component =
let extra = extra.list()?.as_nbt_tags(); FormattedText::Translatable(TranslatableComponent::new(translate, with_array));
if extra.is_empty() { } else {
// Unexpected empty array of components // if it doesn't have a "with", just have the with_array be empty
return None; component =
} FormattedText::Translatable(TranslatableComponent::new(translate, Vec::new()));
for extra_component in extra {
let sibling = FormattedText::from_nbt_tag(&extra_component)?;
component.append(sibling);
}
}
let style = Style::from_compound(compound).ok()?;
component.get_base_mut().style = style;
Some(component)
} }
// ok so it's not a compound, if it's a list deserialize every item } else if let Some(score) = compound.compound("score") {
simdnbt::borrow::NbtTag::List(list) => { // object = GsonHelper.getAsJsonObject(jsonObject, "score");
let list = list.compounds()?; if score.get("name").is_none() || score.get("objective").is_none() {
let mut component = FormattedText::from_nbt_tag( // A score component needs at least a name and an objective
&simdnbt::borrow::NbtTag::Compound(list.first()?.clone()), trace!("A score component needs at least a name and an objective");
)?; return None;
for i in 1..list.len() {
component.append(FormattedText::from_nbt_tag(
&simdnbt::borrow::NbtTag::Compound(list.get(i)?.clone()),
)?);
}
Some(component)
} }
_ => Some(FormattedText::Text(TextComponent::new("".to_owned()))), // TODO, score text components aren't yet supported
return None;
} else if compound.get("selector").is_some() {
// 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
trace!("keybind text components aren't yet supported");
return None;
} else if let Some(tag) = compound.get("") {
return FormattedText::from_nbt_tag(tag);
} else {
let _nbt = compound.get("nbt")?;
let _separator = FormattedText::parse_separator_nbt(&compound)?;
let _interpret = match compound.get("interpret") {
Some(v) => v.byte().unwrap_or_default() != 0,
None => false,
};
if let Some(_block) = compound.get("block") {}
trace!("nbt text components aren't yet supported");
return None;
} }
if let Some(extra) = compound.get("extra") {
for c in FormattedText::from_nbt_tag(extra)? {
component.append(c);
}
}
let style = Style::from_compound(compound).ok()?;
component.get_base_mut().style = style;
Some(component)
}
}
#[cfg(feature = "simdnbt")]
impl From<&simdnbt::Mutf8Str> for FormattedText {
fn from(s: &simdnbt::Mutf8Str) -> Self {
FormattedText::Text(TextComponent::new(s.to_string()))
} }
} }
@ -475,7 +458,7 @@ impl McBufReadable for FormattedText {
fn read_from(buf: &mut std::io::Cursor<&[u8]>) -> Result<Self, BufReadError> { fn read_from(buf: &mut std::io::Cursor<&[u8]>) -> Result<Self, BufReadError> {
let nbt = simdnbt::borrow::read_optional_tag(buf)?; let nbt = simdnbt::borrow::read_optional_tag(buf)?;
if let Some(nbt) = nbt { if let Some(nbt) = nbt {
FormattedText::from_nbt_tag(&nbt).ok_or(BufReadError::Custom( FormattedText::from_nbt_tag(nbt.as_tag()).ok_or(BufReadError::Custom(
"couldn't convert nbt to chat message".to_owned(), "couldn't convert nbt to chat message".to_owned(),
)) ))
} else { } else {

View file

@ -581,7 +581,7 @@ impl Style {
#[cfg(feature = "simdnbt")] #[cfg(feature = "simdnbt")]
impl simdnbt::Deserialize for Style { impl simdnbt::Deserialize for Style {
fn from_compound( fn from_compound(
compound: &simdnbt::borrow::NbtCompound, compound: simdnbt::borrow::NbtCompound,
) -> Result<Self, simdnbt::DeserializeError> { ) -> Result<Self, simdnbt::DeserializeError> {
let bold = compound.byte("bold").map(|v| v != 0); let bold = compound.byte("bold").map(|v| v != 0);
let italic = compound.byte("italic").map(|v| v != 0); let italic = compound.byte("italic").map(|v| v != 0);

View file

@ -9,9 +9,9 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
simdnbt = { version = "0.5", git = "https://github.com/azalea-rs/simdnbt" } simdnbt = "0.6"
reqwest = { version = "0.12.4", default-features = false } reqwest = { version = "0.12.5", default-features = false }
anyhow = "1.0.82" anyhow = "1.0.86"
async-trait = "0.1.80" async-trait = "0.1.80"
azalea-auth = { path = "../azalea-auth", version = "0.10.0" } azalea-auth = { path = "../azalea-auth", version = "0.10.0" }
azalea-block = { path = "../azalea-block", version = "0.10.0" } azalea-block = { path = "../azalea-block", version = "0.10.0" }
@ -23,23 +23,23 @@ azalea-buf = { path = "../azalea-buf", version = "0.10.0" }
azalea-protocol = { path = "../azalea-protocol", version = "0.10.0" } azalea-protocol = { path = "../azalea-protocol", version = "0.10.0" }
azalea-registry = { path = "../azalea-registry", version = "0.10.0" } azalea-registry = { path = "../azalea-registry", version = "0.10.0" }
azalea-world = { path = "../azalea-world", version = "0.10.0" } azalea-world = { path = "../azalea-world", version = "0.10.0" }
bevy_app = "0.13.2" bevy_app = "0.13.0"
bevy_ecs = "0.13.2" bevy_ecs = "0.13.0"
bevy_log = { version = "0.13.2", optional = true } bevy_log = { version = "0.13.0", optional = true }
bevy_tasks = "0.13.2" bevy_tasks = "0.13.0"
bevy_time = "0.13.2" bevy_time = "0.13.0"
derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } derive_more = { version = "0.99.18", features = ["deref", "deref_mut"] }
futures = "0.3.30" futures = "0.3.30"
tracing = "0.1.40" tracing = "0.1.40"
nohash-hasher = "0.2.0" nohash-hasher = "0.2.0"
once_cell = "1.19.0" once_cell = "1.19.0"
parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } parking_lot = { version = "^0.12.3", features = ["deadlock_detection"] }
regex = "1.10.4" regex = "1.10.5"
thiserror = "^1.0.59" thiserror = "^1.0.61"
tokio = { version = "^1.37.0", features = ["sync"] } tokio = { version = "^1.38.0", features = ["sync"] }
uuid = "^1.8.0" uuid = "^1.9.1"
serde_json = "1.0.116" serde_json = "1.0.120"
serde = "1.0.198" serde = "1.0.203"
minecraft_folder_path = "0.1.2" minecraft_folder_path = "0.1.2"
azalea-entity = { version = "0.10.0", path = "../azalea-entity" } azalea-entity = { version = "0.10.0", path = "../azalea-entity" }
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" } azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }

View file

@ -9,15 +9,15 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [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-buf = { path = "../azalea-buf", version = "0.10.0" }
azalea-registry = { path = "../azalea-registry", 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" nohash-hasher = "0.2.0"
num-traits = "0.2.18" num-traits = "0.2.19"
serde = { version = "^1.0", optional = true } serde = { version = "^1.0", optional = true }
uuid = "^1.8.0" uuid = "^1.9.1"
serde_json = "^1.0.116" serde_json = "^1.0.120"
tracing = "0.1.40" tracing = "0.1.40"
[features] [features]

View file

@ -1,5 +1,4 @@
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![feature(lazy_cell)]
#![feature(trait_upcasting)] #![feature(trait_upcasting)]
#![allow(incomplete_features)] #![allow(incomplete_features)]
#![feature(generic_const_exprs)] #![feature(generic_const_exprs)]

View file

@ -53,7 +53,7 @@ impl RegistryHolder {
value.write(&mut nbt_bytes); value.write(&mut nbt_bytes);
let nbt_borrow_compound = let nbt_borrow_compound =
simdnbt::borrow::read_compound(&mut Cursor::new(&nbt_bytes)).ok()?; 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, Ok(value) => value,
Err(err) => { Err(err) => {
return Some(Err(err)); return Some(Err(err));
@ -182,7 +182,7 @@ pub enum MonsterSpawnLightLevel {
} }
impl FromNbtTag for 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() { if let Some(value) = tag.int() {
Some(Self::Simple(value as u32)) Some(Self::Simple(value as u32))
} else if let Some(value) = tag.compound() { } else if let Some(value) = tag.compound() {
@ -240,7 +240,7 @@ pub enum BiomePrecipitation {
Snow, Snow,
} }
impl FromNbtTag for BiomePrecipitation { 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() { match tag.string()?.to_str().as_ref() {
"none" => Some(Self::None), "none" => Some(Self::None),
"rain" => Some(Self::Rain), "rain" => Some(Self::Rain),

View file

@ -101,7 +101,7 @@ impl<'de> Deserialize<'de> for ResourceLocation {
} }
impl FromNbtTag 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()) tag.string().and_then(|s| s.to_str().parse().ok())
} }
} }

View file

@ -12,13 +12,13 @@ repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-crypto"
aes = "0.8.4" aes = "0.8.4"
azalea-buf = { path = "../azalea-buf", version = "0.10.0" } azalea-buf = { path = "../azalea-buf", version = "0.10.0" }
cfb8 = "0.8.1" cfb8 = "0.8.1"
num-bigint = "^0.4.4" num-bigint = "^0.4.6"
rand = { version = "^0.8.5", features = ["getrandom"] } rand = { version = "^0.8.5", features = ["getrandom"] }
rsa = { version = "0.9.6", features = ["sha2"] } rsa = { version = "0.9.6", features = ["sha2"] }
rsa_public_encrypt_pkcs1 = "0.4.0" rsa_public_encrypt_pkcs1 = "0.4.0"
sha-1 = "^0.10.1" sha-1 = "^0.10.1"
sha2 = "0.10.8" sha2 = "0.10.8"
uuid = "^1.8.0" uuid = "^1.9.1"
[dev-dependencies] [dev-dependencies]
criterion = { version = "^0.5.1", features = ["html_reports"] } criterion = { version = "^0.5.1", features = ["html_reports"] }

View file

@ -9,7 +9,7 @@ license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [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-block = { version = "0.10.0", path = "../azalea-block" }
azalea-buf = { version = "0.10.0", path = "../azalea-buf" } azalea-buf = { version = "0.10.0", path = "../azalea-buf" }
azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = [ azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = [
@ -19,12 +19,12 @@ azalea-core = { version = "0.10.0", path = "../azalea-core" }
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" } azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }
azalea-registry = { version = "0.10.0", path = "../azalea-registry" } azalea-registry = { version = "0.10.0", path = "../azalea-registry" }
azalea-world = { version = "0.10.0", path = "../azalea-world" } azalea-world = { version = "0.10.0", path = "../azalea-world" }
bevy_app = "0.13.2" bevy_app = "0.13.0"
bevy_ecs = "0.13.2" bevy_ecs = "0.13.0"
derive_more = "0.99.17" derive_more = "0.99.18"
enum-as-inner = "0.6.0" enum-as-inner = "0.6.0"
tracing = "0.1.40" tracing = "0.1.40"
nohash-hasher = "0.2.0" nohash-hasher = "0.2.0"
parking_lot = "0.12.1" parking_lot = "0.12.3"
thiserror = "1.0.59" thiserror = "1.0.61"
uuid = "1.8.0" uuid = "1.9.1"

View file

@ -9,7 +9,7 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [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-buf = { version = "0.10.0", path = "../azalea-buf" }
azalea-inventory-macros = { version = "0.10.0", path = "./azalea-inventory-macros" } azalea-inventory-macros = { version = "0.10.0", path = "./azalea-inventory-macros" }
azalea-registry = { version = "0.10.0", path = "../azalea-registry" } azalea-registry = { version = "0.10.0", path = "../azalea-registry" }
@ -17,4 +17,4 @@ azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = [
"azalea-buf", "azalea-buf",
] } ] }
azalea-core = { version = "0.10.0", path = "../azalea-core" } azalea-core = { version = "0.10.0", path = "../azalea-core" }
uuid = "1.8.0" uuid = "1.9.1"

View file

@ -12,6 +12,6 @@ proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
proc-macro2 = "1.0.81" proc-macro2 = "1.0.86"
quote = "1.0.36" quote = "1.0.36"
syn = "2.0.60" syn = "2.0.68"

View file

@ -11,5 +11,5 @@ version = "0.10.0"
[dependencies] [dependencies]
once_cell = "1.19.0" once_cell = "1.19.0"
serde = "^1.0" serde = "^1.0"
serde_json = "^1.0.116" serde_json = "^1.0.120"
# tokio = {version = "^1.21.2", features = ["fs"]} # tokio = {version = "^1.21.2", features = ["fs"]}

View file

@ -13,16 +13,16 @@ azalea-block = { path = "../azalea-block", version = "0.10.0" }
azalea-core = { path = "../azalea-core", version = "0.10.0" } azalea-core = { path = "../azalea-core", version = "0.10.0" }
azalea-registry = { path = "../azalea-registry", version = "0.10.0" } azalea-registry = { path = "../azalea-registry", version = "0.10.0" }
azalea-world = { path = "../azalea-world", version = "0.10.0" } azalea-world = { path = "../azalea-world", version = "0.10.0" }
bevy_app = "0.13.2" bevy_app = "0.13.0"
bevy_ecs = "0.13.2" bevy_ecs = "0.13.0"
tracing = "0.1.40" tracing = "0.1.40"
once_cell = "1.19.0" once_cell = "1.19.0"
parking_lot = "^0.12.1" parking_lot = "^0.12.3"
nohash-hasher = "0.2.0" nohash-hasher = "0.2.0"
smallvec = "1.13.2" smallvec = "1.13.2"
azalea-entity = { version = "0.10.0", path = "../azalea-entity" } azalea-entity = { version = "0.10.0", path = "../azalea-entity" }
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" } azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }
[dev-dependencies] [dev-dependencies]
bevy_time = "0.13.2" bevy_time = "0.13.0"
uuid = "^1.8.0" uuid = "^1.9.1"

View file

@ -1,6 +1,5 @@
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(lazy_cell)]
pub mod clip; pub mod clip;
pub mod collision; pub mod collision;

View file

@ -9,8 +9,8 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
simdnbt = { version = "0.5", git = "https://github.com/azalea-rs/simdnbt" } simdnbt = "0.6"
async-recursion = "1.1.0" async-recursion = "1.1.1"
azalea-auth = { path = "../azalea-auth", version = "0.10.0" } azalea-auth = { path = "../azalea-auth", version = "0.10.0" }
azalea-block = { path = "../azalea-block", default-features = false, version = "0.10.0" } azalea-block = { path = "../azalea-block", default-features = false, version = "0.10.0" }
azalea-brigadier = { path = "../azalea-brigadier", version = "0.10.0", features = [ azalea-brigadier = { path = "../azalea-brigadier", version = "0.10.0", features = [
@ -28,27 +28,27 @@ azalea-crypto = { path = "../azalea-crypto", version = "0.10.0" }
azalea-protocol-macros = { path = "./azalea-protocol-macros", 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-registry = { path = "../azalea-registry", version = "0.10.0" }
azalea-world = { path = "../azalea-world", 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" byteorder = "^1.5.0"
bytes = "^1.6.0" bytes = "^1.6.0"
flate2 = "1.0.28" flate2 = "1.0.30"
futures = "0.3.30" futures = "0.3.30"
futures-lite = "2.3.0" futures-lite = "2.3.0"
futures-util = "0.3.30" futures-util = "0.3.30"
tracing = "0.1.40" tracing = "0.1.40"
serde = { version = "^1.0", features = ["serde_derive"] } serde = { version = "^1.0", features = ["serde_derive"] }
serde_json = "^1.0.116" serde_json = "^1.0.120"
thiserror = "1.0.59" thiserror = "1.0.61"
tokio = { version = "^1.37.0", features = ["io-util", "net", "macros"] } tokio = { version = "^1.38.0", features = ["io-util", "net", "macros"] }
tokio-util = { version = "0.7.10", features = ["codec"] } tokio-util = { version = "0.7.11", features = ["codec"] }
trust-dns-resolver = { version = "^0.23.2", default-features = false, features = [ trust-dns-resolver = { version = "^0.23.2", default-features = false, features = [
"tokio-runtime", "tokio-runtime",
] } ] }
uuid = "1.8.0" uuid = "1.9.1"
log = "0.4.21" log = "0.4.22"
azalea-entity = { version = "0.10.0", path = "../azalea-entity" } azalea-entity = { version = "0.10.0", path = "../azalea-entity" }
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" } azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }
socks5-impl = "0.5.12" socks5-impl = "0.5.14"
[features] [features]
connecting = [] connecting = []
@ -56,7 +56,7 @@ default = ["packets"]
packets = ["connecting", "dep:azalea-core"] packets = ["connecting", "dep:azalea-core"]
[dev-dependencies] [dev-dependencies]
anyhow = "^1.0.82" anyhow = "^1.0.86"
tracing = "^0.1.40" tracing = "^0.1.40"
tracing-subscriber = "^0.3.18" tracing-subscriber = "^0.3.18"
once_cell = "1.19.0" once_cell = "1.19.0"

View file

@ -11,6 +11,6 @@ proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
proc-macro2 = "^1.0.81" proc-macro2 = "^1.0.86"
quote = "^1.0.36" quote = "^1.0.36"
syn = "^2.0.60" syn = "^2.0.68"

View file

@ -9,7 +9,7 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [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-buf = { path = "../azalea-buf", version = "0.10.0" }
azalea-registry-macros = { path = "./azalea-registry-macros", version = "0.10.0" } azalea-registry-macros = { path = "./azalea-registry-macros", version = "0.10.0" }
once_cell = "1.19.0" once_cell = "1.19.0"

View file

@ -12,9 +12,9 @@ proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
proc-macro2 = "1.0.81" proc-macro2 = "1.0.86"
quote = "1.0.36" quote = "1.0.36"
syn = "2.0.60" syn = "2.0.68"
[features] [features]
serde = [] serde = []

View file

@ -9,24 +9,24 @@ version = "0.10.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
simdnbt = { version = "0.5", git = "https://github.com/azalea-rs/simdnbt" } simdnbt = "0.6"
azalea-block = { path = "../azalea-block", default-features = false, version = "0.10.0" } azalea-block = { path = "../azalea-block", default-features = false, version = "0.10.0" }
azalea-buf = { path = "../azalea-buf", version = "0.10.0" } azalea-buf = { path = "../azalea-buf", version = "0.10.0" }
azalea-core = { path = "../azalea-core", version = "0.10.0", features = [ azalea-core = { path = "../azalea-core", version = "0.10.0", features = [
"bevy_ecs", "bevy_ecs",
] } ] }
azalea-registry = { path = "../azalea-registry", version = "0.10.0" } azalea-registry = { path = "../azalea-registry", version = "0.10.0" }
bevy_ecs = "0.13.2" bevy_ecs = "0.13.0"
derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } derive_more = { version = "0.99.18", features = ["deref", "deref_mut"] }
tracing = "0.1.40" tracing = "0.1.40"
nohash-hasher = "0.2.0" nohash-hasher = "0.2.0"
once_cell = "1.19.0" once_cell = "1.19.0"
parking_lot = "^0.12.1" parking_lot = "^0.12.3"
thiserror = "1.0.59" thiserror = "1.0.61"
uuid = "1.8.0" uuid = "1.9.1"
serde_json = "1.0.116" serde_json = "1.0.120"
serde = "1.0.198" serde = "1.0.203"
rustc-hash = "1.1.0" rustc-hash = "2.0.0"
[dev-dependencies] [dev-dependencies]
azalea-client = { path = "../azalea-client" } azalea-client = { path = "../azalea-client" }

View file

@ -12,7 +12,7 @@ pre-release-replacements = [
] ]
[dependencies] [dependencies]
anyhow = "^1.0.82" anyhow = "^1.0.86"
async-trait = "0.1.80" async-trait = "0.1.80"
azalea-block = { version = "0.10.0", path = "../azalea-block" } azalea-block = { version = "0.10.0", path = "../azalea-block" }
azalea-chat = { version = "0.10.0", path = "../azalea-chat" } azalea-chat = { version = "0.10.0", path = "../azalea-chat" }
@ -25,23 +25,23 @@ azalea-world = { version = "0.10.0", path = "../azalea-world" }
azalea-auth = { version = "0.10.0", path = "../azalea-auth" } azalea-auth = { version = "0.10.0", path = "../azalea-auth" }
azalea-brigadier = { version = "0.10.0", path = "../azalea-brigadier" } azalea-brigadier = { version = "0.10.0", path = "../azalea-brigadier" }
azalea-buf = { version = "0.10.0", path = "../azalea-buf" } azalea-buf = { version = "0.10.0", path = "../azalea-buf" }
bevy_app = "0.13.2" bevy_app = "0.13.0"
bevy_ecs = "0.13.2" bevy_ecs = "0.13.0"
bevy_tasks = { version = "0.13.2", features = ["multi-threaded"] } bevy_tasks = { version = "0.13.0", features = ["multi-threaded"] }
derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] } derive_more = { version = "0.99.18", features = ["deref", "deref_mut"] }
futures = "0.3.30" futures = "0.3.30"
futures-lite = "2.3.0" futures-lite = "2.3.0"
tracing = "0.1.40" tracing = "0.1.40"
nohash-hasher = "0.2.0" nohash-hasher = "0.2.0"
num-traits = "0.2.18" num-traits = "0.2.19"
parking_lot = { version = "^0.12.1", features = ["deadlock_detection"] } parking_lot = { version = "^0.12.3", features = ["deadlock_detection"] }
priority-queue = "2.0.2" priority-queue = "2.0.3"
thiserror = "^1.0.59" thiserror = "^1.0.61"
tokio = "^1.37.0" tokio = "^1.38.0"
uuid = "1.8.0" uuid = "1.9.1"
bevy_log = "0.13.2" bevy_log = "0.13.0"
bevy_time = "0.13.2" bevy_time = "0.13.0"
rustc-hash = "1.1.0" rustc-hash = "2.0.0"
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" } azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }
azalea-entity = { version = "0.10.0", path = "../azalea-entity" } azalea-entity = { version = "0.10.0", path = "../azalea-entity" }

View file

@ -1,7 +1,6 @@
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![allow(incomplete_features)] #![allow(incomplete_features)]
#![feature(type_changing_struct_update)] #![feature(type_changing_struct_update)]
#![feature(lazy_cell)]
#![feature(let_chains)] #![feature(let_chains)]
#![feature(never_type)] #![feature(never_type)]