summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-12-28 15:19:28 +0100
committerWuzzy <almikes@aol.com>2016-12-28 15:19:28 +0100
commit79da0248ed14257480f2c434d2f88d507975f8f0 (patch)
tree33d23681f4dc4945432a97bcac02c0f66ff03d8e /init.lua
parent7377943cee3dd679c354e2bdcf5070109d332310 (diff)
Create hoe soil factoid to auto-generate soil help
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 06ec80e..9afbff3 100644
--- a/init.lua
+++ b/init.lua
@@ -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)