CHUNK LOADING KINDA WORKS

This commit is contained in:
lukas0008 committed 2024-08-12 20:22:59 +02:00
1 parent b4abc6b297
commit a991ce214b
19 files changed
+273205 -264

No files matched your search

+5 -25
View File
@@ -1,26 +1,6 @@
use std::{fs::File, path::Path};
use fastanvil::Region;
pub mod chunk;
pub struct World {
pub region: Region<File>,
}
impl World {
pub fn load<P: AsRef<Path>>(path: P) -> Self {
let file = std::fs::File::open(path).unwrap();
let region = Region::from_stream(file).unwrap();
Self { region }
}
/* pub fn load_chunk(&mut self, x: usize, y: usize) -> Chunk {
let data = self.region.read_chunk(x, y).unwrap().unwrap();
let complete_chunk = complete::Chunk::from_bytes(&data).unwrap();
}
*/
}
pub mod dimension;
pub const WORLD_HEIGHT: usize = 384;
pub const WORLD_Y_START_AT: i32 = -64; // TODO: make sure where it actually starts at (i think its at -64 but not sure)
mod world;
mod block_registry;