Template onetime setup
This commit is contained in:
parent
ff053243dc
commit
9308cd3b82
|
@ -1,4 +1,8 @@
|
|||
|
||||
-- Setting a configuration, switch the order in which the settings shall take precedence. First valid one taken.
|
||||
|
||||
yl_template.external_value = "mod_default" or minetest.settings:get("external_value") or "default"
|
||||
yl_template.external_value = "mod_default" or minetest.settings:get("yl_template.external_value") or "default"
|
||||
|
||||
yl_template.save_path = "yl_template" or minetest.settings:get("yl_template.save_path") or "default"
|
||||
|
||||
yl_template.admin_priv = "admin_priv" or minetest.settings:get("yl_template.admin_priv") or "server"
|
1
init.lua
1
init.lua
|
@ -21,6 +21,7 @@ yl_template.information.name = "yl_template"
|
|||
yl_template.information.additional = "Additional information"
|
||||
|
||||
dofile(yl_template.modpath .. "config.lua")
|
||||
dofile(yl_template.modpath .. "setup.lua")
|
||||
dofile(yl_template.modpath .. "privs.lua")
|
||||
dofile(yl_template.modpath .. "internal.lua")
|
||||
dofile(yl_template.modpath .. "api.lua")
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
local function run_once()
|
||||
local dl = minetest.get_dir_list(yl_template.worldpath, true)
|
||||
local create = true
|
||||
|
||||
for _, v in ipairs(dl) do
|
||||
if v == yl_template.save_path then
|
||||
create = false
|
||||
end
|
||||
end
|
||||
|
||||
if create then
|
||||
minetest.mkdir(yl_template.worldpath .. DIR_DELIM .. yl_template.save_path)
|
||||
end
|
||||
end
|
||||
|
||||
run_once()
|
Loading…
Reference in New Issue