mtinfo/textures.lua
2020-02-20 12:37:23 +01:00

19 lines
612 B
Lua

local count = 0
local size = 0
for _, modname in ipairs(minetest.get_modnames()) do
local modpath = minetest.get_modpath(modname)
local destination_path = mtinfo.basepath .. "/textures"
minetest.mkdir(destination_path)
if modpath then
local texturepath = modpath .. "/textures"
local dir_list = minetest.get_dir_list(texturepath)
for _, filename in pairs(dir_list) do
count = count + 1
size = size + mtinfo.copyfile(texturepath .. "/" .. filename, destination_path .. "/" .. filename)
end
end
end
print("[mtinfo] exported " .. count .. " textures (" .. size .. " bytes)")