From: paramat Date: Thu, 23 Mar 2017 01:19:33 +0000 (+0000) Subject: Flora spread: Re-enable dry shrub replacing flora in desert sand X-Git-Tag: 0.4.16~43 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=08eec2beb73b3db7312c0eb7cade619db3054bb4;p=oweals%2Fminetest_game.git 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. --- 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