From 4f20ab19500de2a5f329881891c9bb96278abde4 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 31 Aug 2017 02:06:35 +0200 Subject: [PATCH] Simplify leafdecay stuff, add leafdecay factoid --- mods/HELP/mcl_doc/init.lua | 12 ++++++++++++ mods/ITEMS/mcl_core/functions.lua | 17 ++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/mods/HELP/mcl_doc/init.lua b/mods/HELP/mcl_doc/init.lua index 7c4f36c3..67a98cae 100644 --- a/mods/HELP/mcl_doc/init.lua +++ b/mods/HELP/mcl_doc/init.lua @@ -46,6 +46,18 @@ doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) return datastring end) +doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) + local formstring = "" + if def.groups.leafdecay ~= nil then + if def.drop ~= "" and def.drop ~= nil and def.drop ~= itemstring then + formstring = string.format("This block quickly decays when there is no wood block of any species within a distance of %d. When decaying, it disappears and may drop one of its regular drops. The block does not decay when the block has been placed by a player.", def.groups.leafdecay) + else + formstring = string.format("This block quickly decays and disappears when there is no wood block of any species within a distance of %d. The block does not decay when the block has been placed by a player.", def.groups.leafdecay) + end + end + return formstring +end) + -- nodes which have flower placement rules doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) local datastring = "" diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 91e08d20..42188167 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -930,8 +930,6 @@ end -- If param2 of the node is ~= 0, the node will always be preserved. Thus, if -- the player places a node of that kind, you will want to set param2=1 or so. -- --- If the node is in the leafdecay_drop group then the it will always be dropped --- as an item mcl_core.leafdecay_trunk_cache = {} mcl_core.leafdecay_enable_cache = true @@ -997,15 +995,12 @@ minetest.register_abm({ -- Drop stuff other than the node itself local itemstacks = minetest.get_node_drops(n0.name) for _, itemname in ipairs(itemstacks) do - if minetest.get_item_group(n0.name, "leafdecay_drop") ~= 0 or - itemname ~= n0.name then - local p_drop = { - x = p0.x - 0.5 + math.random(), - y = p0.y - 0.5 + math.random(), - z = p0.z - 0.5 + math.random(), - } - minetest.add_item(p_drop, itemname) - end + local p_drop = { + x = p0.x - 0.5 + math.random(), + y = p0.y - 0.5 + math.random(), + z = p0.z - 0.5 + math.random(), + } + minetest.add_item(p_drop, itemname) end -- Remove node minetest.remove_node(p0)