From 79da0248ed14257480f2c434d2f88d507975f8f0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 28 Dec 2016 15:19:28 +0100 Subject: Create hoe soil factoid to auto-generate soil help --- init.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'init.lua') 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) -- cgit v1.2.3