From 59749af69c37dc949e41b96f9bdada064f384ce1 Mon Sep 17 00:00:00 2001 From: lukas0008 Date: Tue, 13 Aug 2024 14:14:19 +0200 Subject: [PATCH] Remove unnecessary logs and loading - Load chunk (0,0) only in debug mode. This prevents crashes when the chunk for (0,0) does not exist, since this is only used for checking the size of the chunk packet. - Remove log: `Getting chunks x, from region file y` --- pumpkin-world/src/world.rs | 5 ----- pumpkin/src/server.rs | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pumpkin-world/src/world.rs b/pumpkin-world/src/world.rs index 28a9d905..6f705c17 100644 --- a/pumpkin-world/src/world.rs +++ b/pumpkin-world/src/world.rs @@ -97,11 +97,6 @@ impl Level { chunks: Vec<(i32, i32)>, ) -> Vec<((i32, i32), Result)> { // dbg!(at); - println!( - "Getting chunks {:?}, from region file {}", - &chunks, - region_file.to_str().unwrap_or("") - ); // return different error when file is not found (because that means that the chunks have just not been generated yet) let mut region_file = match File::open(region_file).await { Ok(f) => f, diff --git a/pumpkin/src/server.rs b/pumpkin/src/server.rs index 7df712b1..e8234ca9 100644 --- a/pumpkin/src/server.rs +++ b/pumpkin/src/server.rs @@ -351,6 +351,7 @@ impl Server { }); chunks.iter().for_each(|chunk| { + #[cfg(debug_assertions)] if chunk.0 == (0, 0) { let mut test = ByteBuffer::empty(); CChunkData(chunk.1.as_ref().unwrap()).write(&mut test);