Change file inclusion method

This commit is contained in:
LoneWolfHT 2019-11-10 12:37:21 -08:00
parent 90c594ddbd
commit 938cc6d6f9
3 changed files with 36 additions and 13 deletions

View File

@ -5,14 +5,19 @@ minetest.set_mapgen_setting("mgflat_spflags", "hills, lakes", true)
minetest.set_mapgen_setting("mgflat_hill_threshhold", "0.75", true)
minetest.set_mapgen_setting("mgflat_np_terrain", "noise_params_2d 0, 1, (600, 600, 600), 7244, 5, 0.6, 2.5, eased", true)
local dirs = minetest.get_dir_list(minetest.get_modpath("mapgen"), false) -- Include all .lua files
mapgen = {
structures = minetest.deserialize(minetest.get_mod_storage():get_string("structures") ~= "" or "{}") or {}
}
--
--- Include the rest of the mod's lua files
--
local dirs = {
"biomes.lua",
"structures.lua",
} -- Lua files to include
for _, filename in ipairs(dirs) do
if filename:find(".lua") and filename ~= "init.lua" then
dofile(minetest.get_modpath("mapgen").."/"..filename)
end
dofile(minetest.get_modpath("mapgen").."/"..filename)
end

View File

@ -1,9 +1,19 @@
nodes = {}
local dirs = minetest.get_dir_list(minetest.get_modpath("nodes"), false) -- Include all .lua files
--
--- Include the rest of the mod's lua files
--
local dirs = { -- Lua files to include
"posts.lua",
"doors.lua",
"stairs.lua",
"map.lua",
"structure_nodes.lua",
"special.lua",
"stations.lua",
}
for _, filename in ipairs(dirs) do
if filename:find(".lua") and filename ~= "init.lua" then
dofile(minetest.get_modpath("nodes").."/"..filename)
end
dofile(minetest.get_modpath("nodes").."/"..filename)
end

View File

@ -1,7 +1,15 @@
local dirs = minetest.get_dir_list(minetest.get_modpath("player"), false) -- Include all .lua files
player = {
party = {},
}
--
--- Include the rest of the mod's lua files
--
local dirs = { -- Lua files to include
"inventory.lua",
}
for _, filename in ipairs(dirs) do
if filename:find(".lua") and filename ~= "init.lua" then
dofile(minetest.get_modpath("player").."/"..filename)
end
dofile(minetest.get_modpath("player").."/"..filename)
end