/// Returns the set of all chunk positions
/// within the server view distance of a given
/// chunk.
Returns the set of all chunk positions
within the server view distance of a given
chunk.
Returns the set of all chunk positions within the server view distance of a given chunk .
fn chunks_within_view_distance(config: &Config, chunk: ChunkPosition) -> HashSet<ChunkPosition> {
    let view_distance = i32::from(config.server.view_distance);
    let mut results = HashSet::with_capacity((view_distance * view_distance) as usize);
    for x in -view_distance..=view_distance {
        for z in -view_distance..=view_distance {
            results.insert(ChunkPosition::new(chunk.x + x, chunk.z + z));
        }
    }
    results
}
fn chunks_within_view_distance ( config : & Config , chunk : ChunkPosition ) -> HashSet < ChunkPosition > { let view_distance = i32 :: from ( config . server . view_distance ) ; let mut results = HashSet :: with_capacity ( ( view_distance * view_distance ) as usize ) ; for x in - view_distance ..= view_distance { for z in - view_distance ..= view_distance { results . insert ( ChunkPosition :: new ( chunk . x + x , chunk . z + z ) ) ; } } results }
Returns the set of all chunk positions
within the server view distance of a given
chunk.
Returns the set of all chunk positions within the server view distance of a given chunk .
config
&Config
chunk
ChunkPosition