-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
49 lines (37 loc) · 737 Bytes
/
init.lua
File metadata and controls
49 lines (37 loc) · 737 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
server_shop = {}
local ss = server_shop
ss.modname = core.get_current_modname()
ss.modpath = core.get_modpath(ss.modname)
local debug_mods = core.settings:get_bool("debug_mods", false)
function ss.log(lvl, msg)
if not msg then
msg = lvl
lvl = nil
end
msg = "[" .. ss.modname .. "] " .. msg
if lvl == "debug" then
if not debug_mods then return end
msg = "[DEBUG] " .. msg
lvl = nil
end
if not lvl then
core.log(msg)
else
core.log(lvl, msg)
end
end
local scripts = {
"settings",
"api",
"deposit",
"formspec",
"node",
"command",
}
for _, script in ipairs(scripts) do
dofile(ss.modpath .. "/" .. script .. ".lua")
end
ss.file_load()
core.register_on_mods_loaded(function()
ss.prune_shops(true)
end)