From ea64fba7f655b9afa03d57e8590c16e024f396f3 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 5 Jul 2024 00:45:45 -0500 Subject: upgrade to simdnbt 0.6 (#160) --- azalea-core/src/lib.rs | 1 - azalea-core/src/registry_holder.rs | 6 +++--- azalea-core/src/resource_location.rs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'azalea-core/src') diff --git a/azalea-core/src/lib.rs b/azalea-core/src/lib.rs index 83dd6245..1596a673 100755 --- a/azalea-core/src/lib.rs +++ b/azalea-core/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] -#![feature(lazy_cell)] #![feature(trait_upcasting)] #![allow(incomplete_features)] #![feature(generic_const_exprs)] diff --git a/azalea-core/src/registry_holder.rs b/azalea-core/src/registry_holder.rs index 68dfcf29..119a1317 100644 --- a/azalea-core/src/registry_holder.rs +++ b/azalea-core/src/registry_holder.rs @@ -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)); @@ -182,7 +182,7 @@ pub enum MonsterSpawnLightLevel { } impl FromNbtTag for MonsterSpawnLightLevel { - fn from_nbt_tag(tag: &simdnbt::borrow::NbtTag) -> Option { + fn from_nbt_tag(tag: simdnbt::borrow::NbtTag) -> Option { if let Some(value) = tag.int() { Some(Self::Simple(value as u32)) } else if let Some(value) = tag.compound() { @@ -240,7 +240,7 @@ pub enum BiomePrecipitation { Snow, } impl FromNbtTag for BiomePrecipitation { - fn from_nbt_tag(tag: &simdnbt::borrow::NbtTag) -> Option { + fn from_nbt_tag(tag: simdnbt::borrow::NbtTag) -> Option { match tag.string()?.to_str().as_ref() { "none" => Some(Self::None), "rain" => Some(Self::Rain), diff --git a/azalea-core/src/resource_location.rs b/azalea-core/src/resource_location.rs index a6dcc0be..2b0feb71 100755 --- a/azalea-core/src/resource_location.rs +++ b/azalea-core/src/resource_location.rs @@ -101,7 +101,7 @@ impl<'de> Deserialize<'de> for ResourceLocation { } impl FromNbtTag for ResourceLocation { - fn from_nbt_tag(tag: &simdnbt::borrow::NbtTag) -> Option { + fn from_nbt_tag(tag: simdnbt::borrow::NbtTag) -> Option { tag.string().and_then(|s| s.to_str().parse().ok()) } } -- cgit v1.2.3