1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Allow restricting detached inventories to one player

This combats the problem of sending the hundreds of
"creative" / "armor" or whatever detached invs that
exist on popular servers to each and every player
on join or on change of said invs.
This commit is contained in:
sfan5 2016-11-26 17:35:25 +01:00
parent 2fe3bf5a18
commit c38985825f
5 changed files with 25 additions and 13 deletions

View file

@ -2,7 +2,7 @@
core.detached_inventories = {}
function core.create_detached_inventory(name, callbacks)
function core.create_detached_inventory(name, callbacks, player_name)
local stuff = {}
stuff.name = name
if callbacks then
@ -15,6 +15,6 @@ function core.create_detached_inventory(name, callbacks)
end
stuff.mod_origin = core.get_current_modname() or "??"
core.detached_inventories[name] = stuff
return core.create_detached_inventory_raw(name)
return core.create_detached_inventory_raw(name, player_name)
end