mod-glass/init.lua

39 lines
645 B
Lua
Raw Normal View History

2017-06-21 00:18:46 -07:00
--- Glass initialization script.
--
-- @module init
2017-06-21 00:18:46 -07:00
if not core.global_exists("sounds") and not core.global_exists("default") then
error("this mod requires either \"sounds\" or \"default\"")
end
2017-08-14 10:44:41 -07:00
glass = {}
2021-05-26 18:16:38 -07:00
glass.modname = core.get_current_modname()
glass.modpath = core.get_modpath(glass.modname)
function glass.log(lvl, msg)
if not msg then
msg = lvl
lvl = nil
end
msg = "[" .. glass.modname .. "] " .. msg
if not lvl then
core.log(msg)
else
core.log(lvl, msg)
end
end
2017-08-14 11:54:50 -07:00
local scripts = {
2021-05-26 18:16:38 -07:00
--"functions",
2021-05-26 17:53:22 -07:00
"nodes",
2021-05-26 18:16:38 -07:00
--"crafting",
2017-08-14 11:54:50 -07:00
}
for _, s in ipairs(scripts) do
2021-05-26 18:16:38 -07:00
dofile(glass.modpath .. "/" .. s .. ".lua")
2017-08-14 11:54:50 -07:00
end