Improve detection of unbreakable blocks.

This commit is contained in:
Wuzzy 2016-08-29 13:37:50 +02:00
parent a961539931
commit 0becb68bf2

View File

@ -439,14 +439,16 @@ doc.new_category("nodes", {
formstring = formstring .. "\n" formstring = formstring .. "\n"
--[[ Check if there are no groups at all, helps for finding undiggable nodes, -- Mining groups
-- but this approach might miss some of these; still better than nothing. ]] if data.def.pointable ~= false and (data.def.liquid_type == "none" or data.def.liquid_type == nil) then
-- Check if there are no mining groups at all
local nogroups = true local nogroups = true
for k,v in pairs(data.def.groups) do for groupname,_ in pairs(mininggroups) do
-- If this is reached once, we know the groups table is not empty if data.def.groups[groupname] ~= nil or groupname == dig_immediate then
nogroups = false nogroups = false
break break
end end
end
-- dig_immediate -- dig_immediate
if data.def.drop ~= "" then if data.def.drop ~= "" then
if data.def.groups.dig_immediate == 2 then if data.def.groups.dig_immediate == 2 then
@ -490,6 +492,7 @@ doc.new_category("nodes", {
end end
formstring = formstring .. "\n" formstring = formstring .. "\n"
end end
end
-- Custom factoids are inserted here -- Custom factoids are inserted here
for i=1,#factoid_generators.nodes do for i=1,#factoid_generators.nodes do