Skip to content

Commit 08eec2b

Browse files
committedMar 26, 2017
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.
1 parent 9b45e7b commit 08eec2b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
 

Diff for: ‎mods/flowers/init.lua

+9-2
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,16 @@ function flowers.flower_spread(pos, node)
107107
pos.y = pos.y - 1
108108
local under = minetest.get_node(pos)
109109
pos.y = pos.y + 1
110+
-- Replace flora with dry shrub in desert sand and silver sand,
111+
-- as this is the only way to generate them.
112+
-- However, preserve grasses in sand dune biomes.
113+
if minetest.get_item_group(under.name, "sand") == 1 and
114+
under.name ~= "default:sand" then
115+
minetest.set_node(pos, {name = "default:dry_shrub"})
116+
return
117+
end
118+
110119
if minetest.get_item_group(under.name, "soil") == 0 then
111-
-- Do not replace with dry shrub here as
112-
-- this breaks flower pots and other mods.
113120
return
114121
end
115122

0 commit comments

Comments
 (0)
Please sign in to comment.