From 08eec2beb73b3db7312c0eb7cade619db3054bb4 Mon Sep 17 00:00:00 2001 From: paramat Date: Thu, 23 Mar 2017 01:19:33 +0000 Subject: [PATCH] Flora spread: Re-enable dry shrub replacing flora in desert sand Flora is converted to dry shrub in desert sand and silver sand. No conversion in sand to preserve sand dune grasses. Dry shrubs do not spread so this conversion, used by players, is the only way to generate them. --- mods/flowers/init.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index f5955d8c..db7a4eb3 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -107,9 +107,16 @@ function flowers.flower_spread(pos, node) pos.y = pos.y - 1 local under = minetest.get_node(pos) pos.y = pos.y + 1 + -- Replace flora with dry shrub in desert sand and silver sand, + -- as this is the only way to generate them. + -- However, preserve grasses in sand dune biomes. + if minetest.get_item_group(under.name, "sand") == 1 and + under.name ~= "default:sand" then + minetest.set_node(pos, {name = "default:dry_shrub"}) + return + end + if minetest.get_item_group(under.name, "soil") == 0 then - -- Do not replace with dry shrub here as - -- this breaks flower pots and other mods. return end -- 2.25.1