diff options
author | Wuzzy <almikes@aol.com> | 2016-12-28 15:19:28 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-12-28 15:19:28 +0100 |
commit | 79da0248ed14257480f2c434d2f88d507975f8f0 (patch) | |
tree | 33d23681f4dc4945432a97bcac02c0f66ff03d8e /init.lua | |
parent | 7377943cee3dd679c354e2bdcf5070109d332310 (diff) |
Create hoe soil factoid to auto-generate soil help
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -232,6 +232,23 @@ local function f_spreading_dirt_type(itemstring, def) end end +local function f_hoe_soil(itemstring, def) + if def.soil then + local name, node + nodedef = minetest.registered_nodes[def.soil.dry] + if nodedef then + name = nodedef.description + end + if name then + return S("This block can be turned into @1 with a hoe.", name) + else + return S("This block can be cultivated by a hoe.") + end + else + return "" + end +end + --[[ Node defines skeleton key and key callbacks which probably implies that it can be unlocked by keys ]] local function f_key(itemstring, def) @@ -243,6 +260,7 @@ local function f_key(itemstring, def) end doc.sub.items.register_factoid("nodes", "use", f_key) +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) |