mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-26 09:13:53 +01:00
Add modlib.minetest.set_privs
This commit is contained in:
parent
20a6bb37d0
commit
490e50c181
@ -27,6 +27,7 @@ for filename, comps in pairs{
|
|||||||
"nodename_matcher",
|
"nodename_matcher",
|
||||||
"playerdata",
|
"playerdata",
|
||||||
"connected_players",
|
"connected_players",
|
||||||
|
"set_privs",
|
||||||
"register_on_leaveplayer",
|
"register_on_leaveplayer",
|
||||||
"get_mod_info",
|
"get_mod_info",
|
||||||
"get_mod_load_order"
|
"get_mod_load_order"
|
||||||
|
@ -222,6 +222,10 @@ function connected_players()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function set_privs(name, privs)
|
||||||
|
return minetest.set_player_privs(name, modlib.table.add_all(minetest.get_player_privs(name), privs))
|
||||||
|
end
|
||||||
|
|
||||||
function register_on_leaveplayer(func)
|
function register_on_leaveplayer(func)
|
||||||
return minetest["register_on_" .. (minetest.is_singleplayer() and "shutdown" or "leaveplayer")](func)
|
return minetest["register_on_" .. (minetest.is_singleplayer() and "shutdown" or "leaveplayer")](func)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user