From 7ceccfecc39bf2d59372d8c2952c942670fb9b38 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 21 Aug 2019 19:18:16 +0100 Subject: [PATCH] Added cacti --- world/src/block/mod.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index b33043c98d..22e9d530e4 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -154,7 +154,7 @@ impl<'a> BlockGen<'a> { //cliffs, cliff_hill, close_cliffs, - //temp, + temp, .. } = &z_cache?.sample; @@ -257,6 +257,7 @@ impl<'a> BlockGen<'a> { saturate_srgb(col, 0.45).map(|e| (e * 255.0) as u8), )) } else if (wposf.z as f32) < height + 0.9 + && temp < CONFIG.desert_temp && (wposf.z as f32 > water_height + 3.0) && marble > 0.68 && marble_small > 0.65 @@ -286,6 +287,18 @@ impl<'a> BlockGen<'a> { }, Rgb::broadcast(0), )) + } else if (wposf.z as f32) < height + 0.9 + && temp > CONFIG.desert_temp + && (marble * 4423.5).fract() < 0.0005 + { + Some(Block::new( + if (height * 1271.0).fract() < 0.5 { + BlockKind::LargeCactus + } else { + BlockKind::BarrelCactus + }, + Rgb::broadcast(0), + )) } else { None };