pub fn enqueue_chunks_for_lighting(&mut self, player_close_chunks: &[ChunkPos]) {
        for pos in player_close_chunks {
            if let Some(server_chunk) = self.chunks.get(&pos) {
                if server_chunk.needs_light_update && !server_chunk.is_in_light_queue {
                    let res = self.light_worker.enqueue(self.create_chunk_lighting_data(*pos));
                    match res {
                        // If the lighting queue is not full, update chunk status
                        Ok(()) => {
                            let server_chunk = self.chunks.get_mut(&pos).expect("Logic error");
                            server_chunk.needs_light_update = false;
                            server_chunk.is_in_light_queue = true;
                        },
                        // If the lighting queue is full, stop
                        Err(_) => break,
                    }
                }
            }
        }
    }
/// Start the lighting of a few chunks
Start the lighting of a few chunks
Start the lighting of a few chunks
pub fn enqueue_chunks_for_lighting(&mut self, player_close_chunks: &[ChunkPos]) {
        for pos in player_close_chunks {
            if let Some(server_chunk) = self.chunks.get(&pos) {
                if server_chunk.needs_light_update && !server_chunk.is_in_light_queue {
                    let res = self.light_worker.enqueue(self.create_chunk_lighting_data(*pos));
                    match res {
                        // If the lighting queue is not full, update chunk status
                        Ok(()) => {
                            let server_chunk = self.chunks.get_mut(&pos).expect("Logic error");
                            server_chunk.needs_light_update = false;
                            server_chunk.is_in_light_queue = true;
                        },
                        // If the lighting queue is full, stop
                        Err(_) => break,
                    }
                }
            }
        }
    }
pub fn enqueue_chunks_for_lighting ( & mut self , player_close_chunks : & [ ChunkPos ] ) { for pos in player_close_chunks { if let Some ( server_chunk ) = self . chunks . get ( & pos ) { if server_chunk . needs_light_update && ! server_chunk . is_in_light_queue { let res = self . light_worker . enqueue ( self . create_chunk_lighting_data ( * pos ) ) ; match res { // If the lighting queue is not full, update chunk status Ok ( ( ) ) => { let server_chunk = self . chunks . get_mut ( & pos ) . expect ( " " ) ; server_chunk . needs_light_update = false ; server_chunk . is_in_light_queue = true ; } , // If the lighting queue is full, stop Err ( _ ) => break , } } } } }
Start the lighting of a few chunks
Start the lighting of a few chunks
&mut self
player_close_chunks
&[ChunkPos]
&mut self
player_close_chunks
&[ChunkPos]