From 80635cd596e8be47dd66af96985716d553af21c9 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sat, 18 Feb 2023 00:58:31 +0100 Subject: [PATCH] river generation --- kubi-shared/src/block.rs | 8 ++++++++ kubi-shared/src/worldgen.rs | 33 +++++++++++++++++++++++++++------ kubi/src/prefabs.rs | 1 + 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/kubi-shared/src/block.rs b/kubi-shared/src/block.rs index 558e1df..c428078 100644 --- a/kubi-shared/src/block.rs +++ b/kubi-shared/src/block.rs @@ -19,6 +19,7 @@ pub enum BlockTexture { GrassSideSnow, Cobblestone, Planks, + WaterSolid, } #[derive(Encode, Decode, Clone, Copy, Debug, PartialEq, Eq, EnumIter)] @@ -36,6 +37,7 @@ pub enum Block { Torch, Wood, Leaf, + Water, } impl Block { @@ -118,6 +120,12 @@ impl Block { collision: CollisionType::Solid, raycast_collision: true, }, + Self::Water => BlockDescriptor { + name: "water", + render: RenderType::BinaryTransparency(CubeTexture::all(BlockTexture::WaterSolid)), + collision: CollisionType::None, + raycast_collision: false, + }, } } } diff --git a/kubi-shared/src/worldgen.rs b/kubi-shared/src/worldgen.rs index 382b094..09cb993 100644 --- a/kubi-shared/src/worldgen.rs +++ b/kubi-shared/src/worldgen.rs @@ -125,11 +125,13 @@ pub fn generate_world(chunk_position: IVec3, seed: u64) -> (BlockData, Vec (BlockData, Vec "grass_side_snow.png", Self::Cobblestone => "cobblestone.png", Self::Planks => "planks.png", + Self::WaterSolid => "solid_water.png", } } }