Artifact a0d38cfe10b6c5551b87a4f460f2bc222c9136cc18d2674dfaa4d4297fec0f1e:
- File lib/node.lua — part of check-in [f7f6898cbd] at 2020-08-21 11:52:17 on branch trunk — add force field emitters, generators, rework leyline distribution algorithm, add utility function for automatically dumping out inventories when an item is dug, add draconium and tyrannium alloys (tentatively), various fixes (user: lexi, size: 474) [annotate] [blame] [check-ins using]
return { purge_container = function(pos,node,meta,user) local offset = function(pos,range) local r = function(min,max) return (math.random() * (max - min)) + min end return { x = pos.x + r(0 - range, range); y = pos.y; z = pos.z + r(0 - range, range); } end for name, inv in pairs(meta.inventory) do for _, item in pairs(inv) do if not item:is_empty() then minetest.add_item(offset(pos,0.4), item) end end end end; }