diff options
| author | mat <github@matdoes.dev> | 2022-05-03 18:03:10 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-05-03 18:03:10 +0000 |
| commit | 477c367fc44a2b5c139845f7e8307c6c276d95ee (patch) | |
| tree | ec7f3d2432a4f16d4dbdc205b37d68d54cabda2b /azalea-world/src/lib.rs | |
| parent | 0bd798045c4328208667df37348e9affb37e384f (diff) | |
| download | azalea-drasl-477c367fc44a2b5c139845f7e8307c6c276d95ee.tar.xz | |
mor echunk stuff
Diffstat (limited to 'azalea-world/src/lib.rs')
| -rw-r--r-- | azalea-world/src/lib.rs | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/azalea-world/src/lib.rs b/azalea-world/src/lib.rs index 51bc0764..ea7798f8 100644 --- a/azalea-world/src/lib.rs +++ b/azalea-world/src/lib.rs @@ -38,17 +38,11 @@ impl World { ); return Ok(()); } - let existing_chunk = &self.storage[pos]; - if let Some(existing_chunk) = existing_chunk { - existing_chunk - .lock() - .expect("Couldn't get lock on existing chunk") - .replace_with_packet_data(data)?; - } else { - let chunk = Arc::new(Mutex::new(Chunk::read_with_world(data, self)?)); - println!("Loaded chunk {:?}", chunk); - self.storage[pos] = Some(chunk); - } + // let existing_chunk = &self.storage[pos]; + + let chunk = Arc::new(Mutex::new(Chunk::read_with_world(data, self)?)); + println!("Loaded chunk {:?}", chunk); + self.storage[pos] = Some(chunk); Ok(()) } @@ -131,18 +125,6 @@ impl Chunk { } Ok(Chunk { sections }) } - - fn replace_with_packet_data(&mut self, data: &mut impl Read) -> Result<(), String> { - let section_count = self.sections.len(); - - // this should also replace block entities and set the heightmap - - for i in 0..section_count { - self.sections[i] = Section::read_into(data)?; - } - - Ok(()) - } } impl McBufWritable for Chunk { |
