forked from MinetestForFun/ignore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
38 lines (27 loc) · 1 KB
/
init.lua
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
--[[
Ignore
A Minetest mod to manage ignore lists
Code by: Mg
Version: 00.01.18
License: WTFPL
Last Modification: 01/18/16 @ 9:31PM UTC+1
]]--
-- Da namespace
ignore = {}
ignore.config = {}
ignore.config.save_dir = minetest.get_worldpath() .. "/ignore"
ignore.config.enabled = not(minetest.settings:get_bool("disable_ignore") or false)
ignore.config.queue_interval = tonumber(minetest.settings:get("ignore_queue_interval")) or 30
dofile(minetest.get_modpath("ignore") .. "/lists.lua")
dofile(minetest.get_modpath("ignore") .. "/queues.lua")
dofile(minetest.get_modpath("ignore") .. "/chatcommand.lua")
minetest.mkdir(ignore.config.save_dir)
if ignore.config.enabled then
minetest.log("action", "[Ignore] This session is loaded with the ignore callback")
dofile(minetest.get_modpath("ignore") .. "/callback.lua")
else
minetest.log("action", "[Ignore] This session is loaded without the ignore callback")
end
minetest.register_on_leaveplayer(function(player)
ignore.del_list(player:get_player_name())
end)