]> git.lizzy.rs Git - are_we_minecraft_yet.git/blob - mod/init.lua
Move call to strip_colors
[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.strip_colors(minetest.get_translated_string("", def.description))
8                         local idx = t:find("\n")
9                         if idx then
10                                 t = t:sub(1, idx-1)
11                         end
12
13                         if t ~= "" and not set[t] then
14                                 set[t] = true
15                                 table.insert(list, t)
16                         end
17                 end
18         end
19
20         table.sort(list)
21
22         local f = io.open(minetest.get_worldpath() .. "/items.txt", "w")
23         f:write(table.concat(list, "\n") .. "\n")
24         f:close()
25
26         minetest.request_shutdown()
27 end)