From 715416d4e6b8cf796b47a83020355b5bfe7bf022 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 5 Aug 2016 00:02:34 +0200 Subject: Add mining groups back --- init.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index f235601..ee91698 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,7 @@ doc.sub.items = {} local groupdefs = {} +local mininggroups = {} local miscgroups = {} local forced_items = { ["air"] = true, @@ -334,10 +335,10 @@ doc.new_category("nodes", { local mstring = "This block can be mined by mining tools which match any of the following mining ratings and its mining level.\n" mstring = mstring .. "Mining ratings:\n" local minegroupcount = 0 - for g,name in pairs(groupdefs) do - local rating = data.def.groups[g] + for group,_ in pairs(mininggroups) do + local rating = data.def.groups[group] if rating ~= nil then - mstring = mstring .. "- "..name..": "..rating.."\n" + mstring = mstring .. "- "..groupdefs[group]..": "..rating.."\n" minegroupcount = minegroupcount + 1 end end @@ -613,6 +614,13 @@ function doc.sub.items.add_real_group_names(groupnames) end end +-- Declare groups as mining groups +function doc.sub.items.add_mining_groups(groupnames) + for g=1,#groupnames do + mininggroups[groupnames[g]] = true + end +end + -- Adds groups to be displayed in the generic “misc.” groups -- factoid. Those groups should be neither be used as mining -- groups nor as damage groups and should be relevant to the -- cgit v1.2.3