From 4a0d5e7e96a795e3c30deb49723e4cc3d730e37c Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 8 Oct 2022 01:01:54 -0500 Subject: handle SectionBlocksUpdate packet --- azalea-client/src/client.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'azalea-client/src') diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 0e13415c..aaaa0308 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -1,7 +1,7 @@ use crate::{movement::MoveDirection, Account, Player}; use azalea_auth::game_profile::GameProfile; use azalea_chat::component::Component; -use azalea_core::{ChunkPos, ResourceLocation, Vec3}; +use azalea_core::{BlockPos, ChunkPos, ResourceLocation, Vec3}; use azalea_protocol::{ connect::{Connection, ConnectionError, ReadConnection, WriteConnection}, packets::{ @@ -631,7 +631,10 @@ impl Client { } ClientboundGamePacket::SectionBlocksUpdate(p) => { debug!("Got section blocks update packet {:?}", p); - // TODO: update world + let mut dimension = client.dimension.lock(); + for state in &p.states { + dimension.set_block_state(&(p.section_pos + state.pos), state.state); + } } ClientboundGamePacket::GameEvent(p) => { debug!("Got game event packet {:?}", p); -- cgit v1.2.3