aboutsummaryrefslogtreecommitdiff
path: root/mod/init.lua
blob: 6006e2dd7f75e851d72a347d4b4b98e0070f5248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
minetest.after(3, function()
	local set = {}
	local list = {}

	for name, def in pairs(minetest.registered_items) do
		if def.description and not def.groups.not_in_creative_inventory then
			local t = minetest.get_translated_string("", def.description)
			local idx = t:find("\n")

			t = minetest.strip_colors(t)

			if idx then
				t = t:sub(1, idx-1)
			end

			if t ~= "" and not set[t] then
				set[t] = true
				table.insert(list, t)
			end
		end
	end

	table.sort(list)

	local f = io.open(minetest.get_worldpath() .. "/items.txt", "w")
	f:write(table.concat(list, "\n") .. "\n")
	f:close()

	minetest.request_shutdown()
end)