summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua17
1 files changed, 17 insertions, 0 deletions
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