2013-09-03 01:16:14 +02:00
|
|
|
-- Areas mod by ShadowNinja
|
|
|
|
-- Based on node_ownership
|
2013-09-17 18:38:29 +02:00
|
|
|
-- License: LGPLv2+
|
2013-09-03 01:16:14 +02:00
|
|
|
|
|
|
|
areas = {}
|
|
|
|
|
2020-09-05 18:49:17 +02:00
|
|
|
areas.factions_available = minetest.get_modpath("playerfactions") and true
|
2019-09-21 15:33:42 +02:00
|
|
|
|
2014-07-13 01:06:05 +02:00
|
|
|
areas.adminPrivs = {areas=true}
|
2013-09-03 01:16:14 +02:00
|
|
|
areas.startTime = os.clock()
|
|
|
|
|
|
|
|
areas.modpath = minetest.get_modpath("areas")
|
|
|
|
dofile(areas.modpath.."/settings.lua")
|
|
|
|
dofile(areas.modpath.."/api.lua")
|
2024-10-25 12:25:16 +02:00
|
|
|
|
|
|
|
local async_dofile = core.register_async_dofile or dofile
|
|
|
|
async_dofile(areas.modpath.."/async.lua")
|
|
|
|
|
2013-09-03 01:16:14 +02:00
|
|
|
dofile(areas.modpath.."/internal.lua")
|
|
|
|
dofile(areas.modpath.."/chatcommands.lua")
|
|
|
|
dofile(areas.modpath.."/pos.lua")
|
|
|
|
dofile(areas.modpath.."/interact.lua")
|
|
|
|
dofile(areas.modpath.."/legacy.lua")
|
2013-09-26 16:30:36 +02:00
|
|
|
dofile(areas.modpath.."/hud.lua")
|
2013-09-03 01:16:14 +02:00
|
|
|
|
|
|
|
areas:load()
|
|
|
|
|
2020-09-07 17:47:18 +02:00
|
|
|
local S = minetest.get_translator("areas")
|
|
|
|
|
2014-11-14 19:21:09 +01:00
|
|
|
minetest.register_privilege("areas", {
|
2020-09-07 17:47:18 +02:00
|
|
|
description = S("Can administer areas."),
|
2020-09-05 18:49:17 +02:00
|
|
|
give_to_singleplayer = false
|
2014-11-14 19:21:09 +01:00
|
|
|
})
|
|
|
|
minetest.register_privilege("areas_high_limit", {
|
2020-09-07 17:47:18 +02:00
|
|
|
description = S("Can protect more, bigger areas."),
|
2020-09-05 18:49:17 +02:00
|
|
|
give_to_singleplayer = false
|
2014-11-14 19:21:09 +01:00
|
|
|
})
|
2013-09-03 01:16:14 +02:00
|
|
|
|
2014-11-18 03:16:59 +01:00
|
|
|
if not minetest.registered_privileges[areas.config.self_protection_privilege] then
|
|
|
|
minetest.register_privilege(areas.config.self_protection_privilege, {
|
2020-09-07 17:47:18 +02:00
|
|
|
description = S("Can protect areas."),
|
2013-11-19 03:01:24 +01:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2019-07-10 20:26:42 +02:00
|
|
|
if minetest.settings:get_bool("log_mods") then
|
2013-09-03 01:16:14 +02:00
|
|
|
local diffTime = os.clock() - areas.startTime
|
2013-11-19 03:01:24 +01:00
|
|
|
minetest.log("action", "areas loaded in "..diffTime.."s.")
|
2013-09-03 01:16:14 +02:00
|
|
|
end
|