-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathinit.lua
72 lines (58 loc) · 2.02 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--[[
Allows players to request from another player to be teleported to them.
Includes many more teleporting features. Built for Minetest.
Copyright (C) 2014-2024 ChaosWormz and contributors
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
----------------------------------------------------------------------------
Originally made by Traxie21 and released under the WTFPL license.
Forum link: https://forum.minetest.net/viewtopic.php?t=4457
--]]
local MP = minetest.get_modpath(minetest.get_current_modname())
local S = minetest.get_translator(minetest.get_current_modname())
tp = {
S = S,
tpr_list = { },
tphr_list = { },
tpc_list = { },
tpn_list = { },
tpf_update_time = { }
}
-- Clear requests when the player leaves
minetest.register_on_leaveplayer(function(name)
if tp.tpr_list[name] then
tp.tpr_list[name] = nil
return
end
if tp.tphr_list[name] then
tp.tphr_list[name] = nil
return
end
-- Area requests
if tp.tpc_list[name] then
tp.tpc_list[name] = nil
return
end
if tp.tpn_list[name] then
tp.tpn_list[name] = nil
return
end
end)
dofile(MP .. "/privileges.lua")
dofile(MP .. "/config.lua")
dofile(MP .. "/functions.lua")
dofile(MP .. "/commands.lua")
-- Log
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "[MOD] Teleport Request v" .. tp.version .. " loaded!")
end