refactor(server): drop unused synchronous get_chunk path
This commit is contained in:
parent
e6895de451
commit
12390d3008
|
|
@ -30,8 +30,6 @@ pub struct StreamStats {
|
|||
/// The server's authoritative representation of the world.
|
||||
#[derive(Resource)]
|
||||
pub struct ServerWorld {
|
||||
/// Deterministic voxel source used to generate missing chunks on demand.
|
||||
generator: Arc<VoxelGenerator>,
|
||||
/// Currently resident chunks, keyed by chunk-space position.
|
||||
chunks: HashMap<ChunkPos, Chunk>,
|
||||
/// Sending end of the job channel; the main thread pushes positions that require generation.
|
||||
|
|
@ -82,7 +80,6 @@ impl ServerWorld {
|
|||
drop(result_tx);
|
||||
|
||||
Self {
|
||||
generator,
|
||||
chunks: HashMap::new(),
|
||||
job_tx,
|
||||
result_rx,
|
||||
|
|
@ -91,13 +88,6 @@ impl ServerWorld {
|
|||
}
|
||||
}
|
||||
|
||||
/// Retrieves a reference to the chunk at the given position, generating it if necessary.
|
||||
pub fn get_chunk(&mut self, pos: ChunkPos) -> &Chunk {
|
||||
self.chunks
|
||||
.entry(pos)
|
||||
.or_insert_with(|| self.generator.generate_chunk(pos))
|
||||
}
|
||||
|
||||
/// Number of chunks currently resident in memory.
|
||||
#[must_use]
|
||||
pub fn loaded_count(&self) -> usize {
|
||||
|
|
|
|||
Loading…
Reference in a new issue