aboutsummaryrefslogtreecommitdiff
path: root/builtin/game/detached_inventory.lua
blob: e8f03b56ce3b43466b759f3425d72c4cf7faf19a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Minetest: builtin/detached_inventory.lua

core.detached_inventories = {}

function core.create_detached_inventory(name, callbacks)
	local stuff = {}
	stuff.name = name
	if callbacks then
		stuff.allow_move = callbacks.allow_move
		stuff.allow_put = callbacks.allow_put
		stuff.allow_take = callbacks.allow_take
		stuff.on_move = callbacks.on_move
		stuff.on_put = callbacks.on_put
		stuff.on_take = callbacks.on_take
	end
	core.detached_inventories[name] = stuff
	return core.create_detached_inventory_raw(name)
end