2013-09-02 16:16:14 -07:00
|
|
|
-- Areas mod by ShadowNinja
|
|
|
|
-- Based on node_ownership
|
2019-09-07 06:04:56 -07:00
|
|
|
-- License: LGPLv3+
|
2013-09-02 16:16:14 -07:00
|
|
|
|
|
|
|
areas = {}
|
|
|
|
|
2022-07-24 00:51:52 -07:00
|
|
|
local S = minetest.get_translator("areas")
|
2021-08-13 09:48:38 -07:00
|
|
|
|
|
|
|
areas.S = S
|
2021-04-24 03:55:20 -07:00
|
|
|
|
|
|
|
areas.adminPrivs = {areas = true}
|
2013-09-02 16:16:14 -07:00
|
|
|
areas.startTime = os.clock()
|
|
|
|
|
|
|
|
areas.modpath = minetest.get_modpath("areas")
|
|
|
|
dofile(areas.modpath.."/settings.lua")
|
|
|
|
dofile(areas.modpath.."/api.lua")
|
|
|
|
dofile(areas.modpath.."/internal.lua")
|
|
|
|
dofile(areas.modpath.."/chatcommands.lua")
|
|
|
|
dofile(areas.modpath.."/pos.lua")
|
|
|
|
dofile(areas.modpath.."/interact.lua")
|
2013-09-26 07:30:36 -07:00
|
|
|
dofile(areas.modpath.."/hud.lua")
|
2019-09-08 12:20:32 -07:00
|
|
|
dofile(areas.modpath.."/protector.lua")
|
2013-09-02 16:16:14 -07:00
|
|
|
|
|
|
|
areas:load()
|
|
|
|
|
2014-11-14 10:21:09 -08:00
|
|
|
minetest.register_privilege("areas", {
|
2021-04-24 03:55:20 -07:00
|
|
|
description = S("Can administer areas."),
|
|
|
|
give_to_singleplayer = false
|
2014-11-14 10:21:09 -08:00
|
|
|
})
|
|
|
|
minetest.register_privilege("areas_high_limit", {
|
2021-04-24 03:55:20 -07:00
|
|
|
description = S("Can protect more, bigger areas."),
|
|
|
|
give_to_singleplayer = false
|
2014-11-14 10:21:09 -08:00
|
|
|
})
|
2013-09-02 16:16:14 -07:00
|
|
|
|
2014-11-17 18:16:59 -08:00
|
|
|
if not minetest.registered_privileges[areas.config.self_protection_privilege] then
|
|
|
|
minetest.register_privilege(areas.config.self_protection_privilege, {
|
2021-08-13 09:48:38 -07:00
|
|
|
description = S("Can protect areas.")
|
2013-11-18 18:01:24 -08:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2019-07-10 11:26:42 -07:00
|
|
|
if minetest.settings:get_bool("log_mods") then
|
2013-09-02 16:16:14 -07:00
|
|
|
local diffTime = os.clock() - areas.startTime
|
2021-08-13 09:48:38 -07:00
|
|
|
minetest.log("action", "areas loaded in " .. diffTime .. "s.")
|
2013-09-02 16:16:14 -07:00
|
|
|
end
|