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

@ -2310,8 +2310,11 @@ and `minetest.auth_reload` call the authetification handler.
* `{type="player", name="celeron55"}`
* `{type="node", pos={x=, y=, z=}}`
* `{type="detached", name="creative"}`
* `minetest.create_detached_inventory(name, callbacks)`: returns an `InvRef`
* `minetest.create_detached_inventory(name, callbacks, [player_name])`: returns an `InvRef`
* callbacks: See "Detached inventory callbacks"
* player_name: Make detached inventory available to one player exclusively,
by default they will be sent to every player (even if not used).
Note that this parameter is mostly just a workaround and will be removed in future releases.
* Creates a detached inventory. If it already exists, it is cleared.
* `minetest.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)`:
returns left over ItemStack