only save modified chunks

This commit is contained in:
griffi-gh 2024-09-02 01:32:25 +02:00
parent 61b99409ce
commit 64a67d0ffe

View file

@ -287,6 +287,8 @@ fn process_state_changes(
if let Some(io) = &io { if let Some(io) = &io {
if let Some(block_data) = &chunk.block_data { if let Some(block_data) = &chunk.block_data {
// Only save the chunk if it has been modified
if chunk.data_modified {
// log::debug!("issue save command"); // log::debug!("issue save command");
io.send(IOCommand::SaveChunk { io.send(IOCommand::SaveChunk {
position, position,
@ -294,6 +296,7 @@ fn process_state_changes(
}); });
} }
} }
}
return false return false
} }