From c00714e0b607bb84e20463431bc1e55c98ddfbb2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 15 Aug 2016 15:19:22 +0200 Subject: Turn leafdecay into a factoid --- init.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 975d071..b3c1351 100644 --- a/init.lua +++ b/init.lua @@ -128,8 +128,25 @@ local function f_soil(itemstring, def) end end +local function f_leafdecay(itemstring, def) + local formstring = "" + if def.groups.leafdecay ~= nil then + if def.groups.leafdecay_drop ~= nil then + formstring = string.format("This block may drop as an item when no trunk is nearby. This is prevented if any block of the group “Tree Trunks” is nearby (up to a distance of %d), the block is completely surrounded by blocks which are neither air or a liquid or it has been manually placed by a player.", def.groups.leafdecay) + else + if def.drop ~= "" and def.drop ~= nil and def.drop ~= itemstring then + formstring = string.format("This block may decay when no trunk is nearby. When decaying, it disappears and may drop one of its mining drops (but never itself). Decay is prevented if any block of the group “Tree Trunks” is nearby (up to a distance of %d), the block is completely surrounded by blocks which are neither air or a liquid or it has been placed by a player.", def.groups.leafdecay) + else + formstring = string.format("This block may decay and disappear when no trunk is nearby. Decay is prevented if any block of the group “Tree Trunks” is nearby (up to a distance of %d), the block is completely surrounded by blocks which are neither air or a liquid or it has been placed by a player.", def.groups.leafdecay) + end + end + end + return formstring +end + 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_leafdecay) doc.sub.items.register_factoid("nodes", "groups", f_soil) -- Add node aliases -- cgit v1.2.3