From 16bc214628360413d2f790125410684736dbb3ee Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Fri, 27 Jan 2023 22:32:23 +0100 Subject: [PATCH] reenable worldgen --- src/world/worldgen.rs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/world/worldgen.rs b/src/world/worldgen.rs index 3718009..7101ceb 100644 --- a/src/world/worldgen.rs +++ b/src/world/worldgen.rs @@ -13,26 +13,26 @@ pub fn generate_world(chunk_position: IVec3, seed: u64) -> BlockData { let mut blocks = Box::new([[[Block::Air; CHUNK_SIZE]; CHUNK_SIZE]; CHUNK_SIZE]); - blocks[0][0][0] = Block::Stone; - blocks[0][CHUNK_SIZE - 1][0] = Block::Stone; - blocks[CHUNK_SIZE - 1][0][0] = Block::Stone; - blocks[CHUNK_SIZE - 1][CHUNK_SIZE - 1][0] = Block::Stone; - blocks[0][0][CHUNK_SIZE - 1] = Block::Stone; - blocks[0][CHUNK_SIZE - 1][CHUNK_SIZE - 1] = Block::Stone; - blocks[CHUNK_SIZE - 1][0][CHUNK_SIZE - 1] = Block::Stone; - blocks[CHUNK_SIZE - 1][CHUNK_SIZE - 1][CHUNK_SIZE - 1] = Block::Stone; + // blocks[0][0][0] = Block::Stone; + // blocks[0][CHUNK_SIZE - 1][0] = Block::Stone; + // blocks[CHUNK_SIZE - 1][0][0] = Block::Stone; + // blocks[CHUNK_SIZE - 1][CHUNK_SIZE - 1][0] = Block::Stone; + // blocks[0][0][CHUNK_SIZE - 1] = Block::Stone; + // blocks[0][CHUNK_SIZE - 1][CHUNK_SIZE - 1] = Block::Stone; + // blocks[CHUNK_SIZE - 1][0][CHUNK_SIZE - 1] = Block::Stone; + // blocks[CHUNK_SIZE - 1][CHUNK_SIZE - 1][CHUNK_SIZE - 1] = Block::Stone; - // for x in 0..CHUNK_SIZE { - // for y in 0..CHUNK_SIZE { - // for z in 0..CHUNK_SIZE { - // let position = ivec3(x as i32, y as i32, z as i32) + offset; - // let noise = noise.get_noise3d(position.x as f32, position.y as f32, position.z as f32); - // if (0.7..0.8).contains(&noise) { - // blocks[x][y][z] = Block::Stone; - // } - // } - // } - // } + for x in 0..CHUNK_SIZE { + for y in 0..CHUNK_SIZE { + for z in 0..CHUNK_SIZE { + let position = ivec3(x as i32, y as i32, z as i32) + offset; + let noise = noise.get_noise3d(position.x as f32, position.y as f32, position.z as f32); + if (0.7..0.8).contains(&noise) { + blocks[x][y][z] = Block::Stone; + } + } + } + } blocks }