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`
This commit is contained in:
parent
b68e9b809f
commit
59749af69c
@ -97,11 +97,6 @@ impl Level {
|
|||||||
chunks: Vec<(i32, i32)>,
|
chunks: Vec<(i32, i32)>,
|
||||||
) -> Vec<((i32, i32), Result<ChunkData, WorldError>)> {
|
) -> Vec<((i32, i32), Result<ChunkData, WorldError>)> {
|
||||||
// dbg!(at);
|
// 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)
|
// 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 {
|
let mut region_file = match File::open(region_file).await {
|
||||||
Ok(f) => f,
|
Ok(f) => f,
|
||||||
|
|||||||
@ -351,6 +351,7 @@ impl Server {
|
|||||||
});
|
});
|
||||||
|
|
||||||
chunks.iter().for_each(|chunk| {
|
chunks.iter().for_each(|chunk| {
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
if chunk.0 == (0, 0) {
|
if chunk.0 == (0, 0) {
|
||||||
let mut test = ByteBuffer::empty();
|
let mut test = ByteBuffer::empty();
|
||||||
CChunkData(chunk.1.as_ref().unwrap()).write(&mut test);
|
CChunkData(chunk.1.as_ref().unwrap()).write(&mut test);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user