forked from VoxeLibre/VoxeLibre
New function to load mod files
This commit is contained in:
parent
b26d4e78a5
commit
0ce870a9de
|
@ -18,3 +18,15 @@ end
|
|||
|
||||
_G.table.copy = table.copy
|
||||
_G.table.merge = table.merge
|
||||
|
||||
function voxelibre.load_mod_files(modpath)
|
||||
if not modpath then
|
||||
return
|
||||
end
|
||||
|
||||
for _, file in pairs(minetest.get_dir_list(modpath, false)) do
|
||||
if file:sub(-4) == ".lua" and file ~= "init.lua" then
|
||||
dofile(modpath.."/"..file)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
building = {}
|
||||
building.translator = minetest.get_translator(minetest.get_current_modname())
|
||||
local modname = minetest.get_current_modname()
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
|
||||
dofile(minetest.get_modpath(minetest.get_current_modname()).."/structural.lua")
|
||||
building = {}
|
||||
building.translator = minetest.get_translator(modname)
|
||||
|
||||
voxelibre.load_mod_files(modpath)
|
||||
|
|
Loading…
Reference in New Issue