1
1
Fork 0
mirror of https://github.com/griffi-gh/kubi.git synced 2025-03-14 11:06:26 -05:00
kubi/kubi-shared/src/worldgen/_02_water.rs
2024-05-02 18:15:18 +02:00

19 lines
494 B
Rust

use glam::ivec3;
use crate::{block::Block, chunk::CHUNK_SIZE};
use super::{WorldGenerator, WorldGenStep};
pub struct WaterStep;
impl WorldGenStep for WaterStep {
fn initialize(_: &WorldGenerator) -> Self { Self }
fn generate(&mut self, gen: &mut WorldGenerator) {
for x in 0..CHUNK_SIZE as i32 {
for z in 0..CHUNK_SIZE as i32 {
for y in 0..gen.local_height(0) {
gen.place_if_empty(ivec3(x, y, z), Block::Water);
}
}
}
}
}