From 53eec5fdf6b48518c8c27922e6e3da654f279444 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 29 May 2017 01:53:58 +0200 Subject: Update dry shrub creating rule --- init.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index ef614f7..306abb6 100644 --- a/init.lua +++ b/init.lua @@ -192,7 +192,19 @@ end local function f_flora(itemstring, def) if def.groups.flora == 1 then local groupname = doc.sub.items.get_group_name("flora") - return S("This block belongs to the @1 group. It a living organism which likes to grow and spread on dirt with grass or dirt with dry grass when it is in light. Spreading will stop when the surrounding area is too crammed with @2 blocks. On desert sand, it will wither and die and turn into a dry shrub.", groupname, groupname) + -- Dry shrub rule not complete; flora dies on group:sand except default:sand. But that's okay. + -- The missing nodes will be covered on their own entries by the f_and_dry_shrub factoid. + return S("This block belongs to the @1 group. It a living organism which likes to grow and spread on dirt with grass or dirt with dry grass when it is in light. Spreading will stop when the surrounding area is too crammed with @2 blocks. On silver sand and desert sand, it will wither and die and turn into a dry shrub.", groupname, groupname) + else + return "" + end +end + +-- sand nodes which turn flora blocks into dry shrub (e.g. silver sand, desert sand) +local function f_sand_dry_shrub(itemstring, def) + if def.groups.sand == 1 and itemstring ~= "default:sand" then + + return S("Flowers and other blocks in the @1 group will slowly turn into dry shrubs when placed on this block.", doc.sub.items.get_group_name("flora")) else return "" end @@ -265,6 +277,7 @@ doc.sub.items.register_factoid("nodes", "use", f_hoe_soil) doc.sub.items.register_factoid("nodes", "groups", f_cools_lava) doc.sub.items.register_factoid("nodes", "groups", f_fire) doc.sub.items.register_factoid("nodes", "groups", f_flora) +doc.sub.items.register_factoid("nodes", "groups", f_sand_dry_shrub) doc.sub.items.register_factoid("nodes", "groups", f_leafdecay) doc.sub.items.register_factoid("nodes", "groups", f_soil) doc.sub.items.register_factoid("nodes", "groups", f_spreading_dirt_type) -- cgit v1.2.3