]> git.lizzy.rs Git - are_we_minecraft_yet.git/blob - mod/init.lua
6006e2dd7f75e851d72a347d4b4b98e0070f5248
[are_we_minecraft_yet.git] / mod / init.lua
1 minetest.after(3, function()
2         local set = {}
3         local list = {}
4
5         for name, def in pairs(minetest.registered_items) do
6                 if def.description and not def.groups.not_in_creative_inventory then
7                         local t = minetest.get_translated_string("", def.description)
8                         local idx = t:find("\n")
9
10                         t = minetest.strip_colors(t)
11
12                         if idx then
13                                 t = t:sub(1, idx-1)
14                         end
15
16                         if t ~= "" and not set[t] then
17                                 set[t] = true
18                                 table.insert(list, t)
19                         end
20                 end
21         end
22
23         table.sort(list)
24
25         local f = io.open(minetest.get_worldpath() .. "/items.txt", "w")
26         f:write(table.concat(list, "\n") .. "\n")
27         f:close()
28
29         minetest.request_shutdown()
30 end)