Skip to content

Commit

Permalink
Flora spread: Re-enable dry shrub replacing flora in desert sand
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
paramat committed Mar 26, 2017
1 parent 9b45e7b commit 08eec2b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mods/flowers/init.lua
Expand Up @@ -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

Expand Down

0 comments on commit 08eec2b

Please sign in to comment.