diff --git a/azalea-client/src/chunks.rs b/azalea-client/src/chunks.rs index fe82bad3..0267c164 100644 --- a/azalea-client/src/chunks.rs +++ b/azalea-client/src/chunks.rs @@ -8,6 +8,7 @@ use std::{ time::{Duration, Instant}, }; +use azalea_core::position::ChunkPos; use azalea_protocol::packets::game::{ c_level_chunk_with_light::ClientboundLevelChunkWithLight, s_chunk_batch_received::ServerboundChunkBatchReceived, @@ -75,7 +76,7 @@ pub fn handle_receive_chunk_events( mut query: Query<&mut InstanceHolder>, ) { for event in events.read() { - let pos = event.packet.pos; + let pos = ChunkPos::new(event.packet.x, event.packet.z); let local_player = query.get_mut(event.entity).unwrap(); diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index 8b3cafdb..73442804 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -604,7 +604,7 @@ pub fn process_packet_events(ecs: &mut World) { // debug!("Got light update packet {p:?}"); } ClientboundGamePacket::LevelChunkWithLight(p) => { - debug!("Got chunk with light packet {:?}", p.pos); + debug!("Got chunk with light packet {} {}", p.x, p.z); let mut system_state: SystemState> = SystemState::new(ecs); diff --git a/azalea-client/src/test_simulation.rs b/azalea-client/src/test_simulation.rs index d974ed09..5afd8b00 100644 --- a/azalea-client/src/test_simulation.rs +++ b/azalea-client/src/test_simulation.rs @@ -253,7 +253,8 @@ pub fn make_basic_empty_chunk( sections.azalea_write(&mut chunk_bytes).unwrap(); ClientboundLevelChunkWithLight { - pos, + x: pos.x, + z: pos.z, chunk_data: ClientboundLevelChunkPacketData { heightmaps: Nbt::None, data: chunk_bytes, diff --git a/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs b/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs index 8043f3d2..9166e0eb 100755 --- a/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs +++ b/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs @@ -1,5 +1,4 @@ use azalea_buf::AzBuf; -use azalea_core::position::ChunkPos; use azalea_protocol_macros::ClientboundGamePacket; use simdnbt::owned::Nbt; @@ -7,7 +6,9 @@ use super::c_light_update::ClientboundLightUpdatePacketData; #[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundLevelChunkWithLight { - pub pos: ChunkPos, + // this can't be a ChunkPos since that reads z first and then x + pub x: i32, + pub z: i32, pub chunk_data: ClientboundLevelChunkPacketData, pub light_data: ClientboundLightUpdatePacketData, }