From b95be7fb2abe7eb6f025f2cf82bac9b577ae7dd0 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Thu, 25 Apr 2024 19:14:56 +0200 Subject: [PATCH] add logging to blk queue --- kubi-server/src/world.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kubi-server/src/world.rs b/kubi-server/src/world.rs index 7401238..9719822 100644 --- a/kubi-server/src/world.rs +++ b/kubi-server/src/world.rs @@ -213,6 +213,7 @@ fn process_block_queue( mut chunk_manager: UniqueViewMut, mut queue: UniqueViewMut, ) { + let initial_len = queue.queue.len(); queue.queue.retain(|item| { let chunk_position = item.position.div_euclid(IVec3::splat(CHUNK_SIZE as i32)); let block_position = item.position.rem_euclid(IVec3::splat(CHUNK_SIZE as i32)); @@ -225,6 +226,9 @@ fn process_block_queue( blocks[block_position.x as usize][block_position.y as usize][block_position.z as usize] = item.block_type; false }); + if initial_len != queue.queue.len() { + log::debug!("queue processed {}/{} items", initial_len - queue.queue.len(), initial_len); + } } /// init local block queue and chunk manager