summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 89b0f10..67c8ab8 100644
--- a/init.lua
+++ b/init.lua
@@ -52,7 +52,7 @@ local groups_to_string = function(grouptable, filter)
local gstring = ""
local groups_count = 0
for id, value in pairs(grouptable) do
- if groupdefs[id] ~= nil and (filter == nil or filter[id] == true) then
+ if (filter == nil or filter[id] == true) then
-- Readable group name
if groups_count > 0 then
-- List seperator
@@ -1064,6 +1064,24 @@ local function gather_descs()
end
end
+ -- ... and gather all groups which appear in crafting recipes
+ for id, def in pairs(minetest.registered_items) do
+ local crafts = minetest.get_all_craft_recipes(id)
+ if crafts ~= nil then
+ for c=1,#crafts do
+ for k,v in pairs(crafts[c].items) do
+ if string.sub(v,1,6) == "group:" then
+ local groupstring = string.sub(v,7,-1)
+ local groups = string.split(groupstring, ",")
+ for g=1, #groups do
+ miscgroups[groups[g]] = true
+ end
+ end
+ end
+ end
+ end
+ end
+
-- 2nd pass: Add entries
-- Set default air text