pub fn enqueue_chunks_for_worldgen(&mut self, player_close_chunks: &[ChunkPos]) {
        for pos in player_close_chunks {
            if !self.chunks.contains_key(pos) && !self.worldgen_queue.contains(pos) {
                let res = self.worldgen_worker.enqueue(*pos);
                match res {
                    // If the worldgen queue is not full, update chunk status
                    Ok(()) => {
                        self.worldgen_queue.insert(*pos);
                    },
                    // If the worldgen queue is full, stop
                    Err(_) => break,
                }
            }
        }
    }
/// Start the worldgen of a few chunks
Start the worldgen of a few chunks
Start the worldgen of a few chunks
pub fn enqueue_chunks_for_worldgen(&mut self, player_close_chunks: &[ChunkPos]) {
        for pos in player_close_chunks {
            if !self.chunks.contains_key(pos) && !self.worldgen_queue.contains(pos) {
                let res = self.worldgen_worker.enqueue(*pos);
                match res {
                    // If the worldgen queue is not full, update chunk status
                    Ok(()) => {
                        self.worldgen_queue.insert(*pos);
                    },
                    // If the worldgen queue is full, stop
                    Err(_) => break,
                }
            }
        }
    }
pub fn enqueue_chunks_for_worldgen ( & mut self , player_close_chunks : & [ ChunkPos ] ) { for pos in player_close_chunks { if ! self . chunks . contains_key ( pos ) && ! self . worldgen_queue . contains ( pos ) { let res = self . worldgen_worker . enqueue ( * pos ) ; match res { // If the worldgen queue is not full, update chunk status Ok ( ( ) ) => { self . worldgen_queue . insert ( * pos ) ; } , // If the worldgen queue is full, stop Err ( _ ) => break , } } } }
Start the worldgen of a few chunks
Start the worldgen of a few chunks
&mut self
player_close_chunks
&[ChunkPos]
&mut self
player_close_chunks
&[ChunkPos]