mod-glass/init.lua

44 lines
730 B
Lua
Raw Normal View History

2017-06-21 00:18:46 -07:00
--[[ LICENSE HEADER
2021-04-19 20:35:43 -07:00
2017-08-14 12:21:25 -07:00
GNU Lesser General Public License version 2.1+
2021-04-19 20:35:43 -07:00
2017-08-14 12:21:25 -07:00
Copyright © 2017 Perttu Ahola (celeron55) <celeron55@gmail.com>
Copyright © 2017 Minetest developers & contributors
2021-04-19 20:35:43 -07:00
2017-08-14 12:21:25 -07:00
See: docs/license-LGPL-2.1.txt
2017-06-21 00:18:46 -07:00
]]
--- Glass initialization script.
--
-- @module init
2017-06-21 00:18:46 -07:00
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