2012-07-24 19:36:54 -04:00
|
|
|
-- Minetest: builtin/detached_inventory.lua
|
|
|
|
|
2014-04-27 21:02:48 -04:00
|
|
|
core.detached_inventories = {}
|
2012-07-24 19:36:54 -04:00
|
|
|
|
2014-04-27 21:02:48 -04:00
|
|
|
function core.create_detached_inventory(name, callbacks)
|
2012-07-24 19:36:54 -04:00
|
|
|
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
|
2015-08-11 22:27:54 -04:00
|
|
|
stuff.mod_origin = core.get_current_modname() or "??"
|
2014-04-27 21:02:48 -04:00
|
|
|
core.detached_inventories[name] = stuff
|
|
|
|
return core.create_detached_inventory_raw(name)
|
2012-07-24 19:36:54 -04:00
|
|
|
end
|
|
|
|
|