diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-11-19 22:07:38 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-19 22:07:38 -0600 |
| commit | 2c610826fc9f8e16897f52313faa8e0602d1dc3d (patch) | |
| tree | 5aad79ecab3b68511a10ebd7eba07af0bd8a5905 /azalea-client/src/chunks.rs | |
| parent | 84e036ce3752ecf57904b0f5aff1f33d43e95a32 (diff) | |
| download | azalea-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-client/src/chunks.rs')
| -rw-r--r-- | azalea-client/src/chunks.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/azalea-client/src/chunks.rs b/azalea-client/src/chunks.rs index 4d2641f5..e91e6b01 100644 --- a/azalea-client/src/chunks.rs +++ b/azalea-client/src/chunks.rs @@ -4,17 +4,18 @@ use std::{ io::Cursor, + ops::Deref, time::{Duration, Instant}, }; use azalea_core::position::ChunkPos; -use azalea_nbt::NbtCompound; use azalea_protocol::packets::game::{ clientbound_level_chunk_with_light_packet::ClientboundLevelChunkWithLightPacket, serverbound_chunk_batch_received_packet::ServerboundChunkBatchReceivedPacket, }; use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::*; +use simdnbt::owned::BaseNbt; use tracing::{error, trace}; use crate::{ @@ -99,10 +100,10 @@ fn handle_receive_chunk_events( } } - let heightmaps = event.packet.chunk_data.heightmaps.as_compound(); + let heightmaps_nbt = &event.packet.chunk_data.heightmaps; // necessary to make the unwrap_or work - let empty_nbt_compound = NbtCompound::default(); - let heightmaps = heightmaps.unwrap_or(&empty_nbt_compound); + let empty_nbt = BaseNbt::default(); + let heightmaps = heightmaps_nbt.unwrap_or(&empty_nbt).deref(); if let Err(e) = partial_instance.chunks.replace_with_packet_data( &pos, |
