aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-09-17 21:44:17 -0500
committermat <git@matdoes.dev>2023-09-17 21:44:17 -0500
commit856a3252f693421df519cbc4d9bc03cfc0f0c212 (patch)
tree310cffa9d9c09a4651ab1707899ae20416713fc0 /azalea-client/src
parent61e63c08968f7b0f451c4c3b07ea8d4927b14a2f (diff)
downloadazalea-drasl-856a3252f693421df519cbc4d9bc03cfc0f0c212.tar.xz
heightmaps
Diffstat (limited to 'azalea-client/src')
-rw-r--r--azalea-client/src/packet_handling.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/azalea-client/src/packet_handling.rs b/azalea-client/src/packet_handling.rs
index 0522d7e5..25c9757d 100644
--- a/azalea-client/src/packet_handling.rs
+++ b/azalea-client/src/packet_handling.rs
@@ -9,6 +9,7 @@ use azalea_entity::{
Dead, EntityBundle, EntityKind, EntityUpdateSet, LastSentPosition, LoadedBy, LookDirection,
Physics, PlayerBundle, Position, RelativeEntityUpdate,
};
+use azalea_nbt::NbtCompound;
use azalea_protocol::{
connect::{ReadConnection, WriteConnection},
packets::game::{
@@ -578,9 +579,20 @@ pub fn process_packet_events(ecs: &mut World) {
}
}
+ let heightmaps = p
+ .chunk_data
+ .heightmaps
+ .as_compound()
+ .and_then(|c| c.get(""))
+ .and_then(|c| c.as_compound());
+ // necessary to make the unwrap_or work
+ let empty_nbt_compound = NbtCompound::default();
+ let heightmaps = heightmaps.unwrap_or(&empty_nbt_compound);
+
if let Err(e) = partial_world.chunks.replace_with_packet_data(
&pos,
&mut Cursor::new(&p.chunk_data.data),
+ heightmaps,
&mut world.chunks,
) {
error!("Couldn't set chunk data: {}", e);
@@ -632,6 +644,7 @@ pub fn process_packet_events(ecs: &mut World) {
ClientboundGamePacket::SetEntityData(p) => {
debug!("Got set entity data packet {:?}", p);
+ #[allow(clippy::type_complexity)]
let mut system_state: SystemState<(
Commands,
Query<(&EntityIdIndex, &LocalPlayer)>,