aboutsummaryrefslogtreecommitdiff
path: root/azalea-world
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2023-11-19 22:07:38 -0600
committerGitHub <noreply@github.com>2023-11-19 22:07:38 -0600
commit2c610826fc9f8e16897f52313faa8e0602d1dc3d (patch)
tree5aad79ecab3b68511a10ebd7eba07af0bd8a5905 /azalea-world
parent84e036ce3752ecf57904b0f5aff1f33d43e95a32 (diff)
downloadazalea-drasl-2c610826fc9f8e16897f52313faa8e0602d1dc3d.tar.xz
Replace azalea-nbt with simdnbt (#111)
* delete azalea-nbt and replace with simdnbt * use simdnbt from crates.io * remove serde dependency on azalea-registry
Diffstat (limited to 'azalea-world')
-rw-r--r--azalea-world/Cargo.toml2
-rwxr-xr-xazalea-world/src/chunk_storage.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml
index 4e0b4efa..ef2d6517 100644
--- a/azalea-world/Cargo.toml
+++ b/azalea-world/Cargo.toml
@@ -15,7 +15,7 @@ azalea-core = { path = "../azalea-core", version = "^0.8.0", features = [
"bevy_ecs",
] }
azalea-inventory = { version = "0.8.0", path = "../azalea-inventory" }
-azalea-nbt = { path = "../azalea-nbt", version = "0.8.0" }
+simdnbt = { version = "0.2.1" }
azalea-registry = { path = "../azalea-registry", version = "0.8.0" }
bevy_ecs = "0.12.0"
derive_more = { version = "0.99.17", features = ["deref", "deref_mut"] }
diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs
index 7301fdd1..ac81fd09 100755
--- a/azalea-world/src/chunk_storage.rs
+++ b/azalea-world/src/chunk_storage.rs
@@ -5,9 +5,9 @@ use crate::palette::PalettedContainerKind;
use azalea_block::BlockState;
use azalea_buf::{BufReadError, McBufReadable, McBufWritable};
use azalea_core::position::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos};
-use azalea_nbt::NbtCompound;
use nohash_hasher::IntMap;
use parking_lot::RwLock;
+use simdnbt::owned::NbtCompound;
use std::collections::hash_map::Entry;
use std::str::FromStr;
use std::{
@@ -323,11 +323,11 @@ impl Chunk {
let mut heightmaps = HashMap::new();
for (name, heightmap) in heightmaps_nbt.iter() {
- let Ok(kind) = HeightmapKind::from_str(name) else {
+ let Ok(kind) = HeightmapKind::from_str(&name.to_str()) else {
warn!("Unknown heightmap kind: {name}");
continue;
};
- let Some(data) = heightmap.as_long_array() else {
+ let Some(data) = heightmap.long_array() else {
warn!("Heightmap {name} is not a long array");
continue;
};