-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinventory.lua
44 lines (39 loc) · 1.2 KB
/
inventory.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
---@diagnostic disable: missing-return
---@meta
---Inventory
------------
---@class mt.InvLocation
---@field type "player"|"node"|"detached"|"undefined"
---@field name string|nil
---@field pos mt.Vector|nil
---@param location mt.InvLocation
---@return mt.InvRef
function minetest.get_inventory(location) end
-- Creates a detached inventory. If it already exists, it is cleared.
--
-- `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.
---@param name string
---@param callbacks mt.DetachedInvDef
---@param player_name string|nil
---@return mt.InvRef
function minetest.create_detached_inventory(name, callbacks, player_name) end
---@param name string
---@return boolean success
function minetest.remove_detached_inventory(name) end
---@param hp_change integer
---@param replace_with_item mt.Item
---@param itemstack mt.Item
---@param user mt.ObjectRef
---@param pointed_thing mt.PointedThing
---@return mt.ItemStack leftover
function minetest.do_item_eat(
hp_change,
replace_with_item,
itemstack,
user,
pointed_thing
)
end