Turn leafdecay into a factoid

master
Wuzzy 2016-08-15 15:19:22 +02:00
parent 8e1429cb1a
commit c00714e0b6
2 changed files with 18 additions and 1 deletions

View File

@ -23,7 +23,7 @@ local slabdesc = "Slabs are half as high as their full block counterparts. Slabs
local stairdesc = "Stairs are useful to climb up without needing to jump."
local leavesdesc = "Leaves and needles are solid blocks usually found at trees, but they can be placed anywhere just like every other block. When grown naturally, these blocks may decay when no trunk is nearby. Leaf decay is prevented if any block of the group “Tree Trunks” is nearby or the block is completely surrounded by blocks which are neither air or a liquid. Blocks which have been placed by a player will never decay."
local leavesdesc = "Leaves and needles are solid blocks usually found at trees, but they can be placed anywhere just like every other block."
local signdesc = "A sign is placed at walls. You can write something want on it."
local signuse = "Rightclick the sign to edit the text."

View File

@ -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