aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-03 18:03:10 +0000
committermat <github@matdoes.dev>2022-05-03 18:03:10 +0000
commit477c367fc44a2b5c139845f7e8307c6c276d95ee (patch)
treeec7f3d2432a4f16d4dbdc205b37d68d54cabda2b /azalea-world/src
parent0bd798045c4328208667df37348e9affb37e384f (diff)
downloadazalea-drasl-477c367fc44a2b5c139845f7e8307c6c276d95ee.tar.xz
mor echunk stuff
Diffstat (limited to 'azalea-world/src')
-rw-r--r--azalea-world/src/lib.rs28
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 {