Wrench: fix restore of furnace (contents were not restored)
| | |
| | | local data = minetest.deserialize(itemstack:get_metadata()) |
| | | minetest.set_node(pos, {name = data.name, param2 = node.param2}) |
| | | local lists = data.lists |
| | | for listname, list in pairs(lists) do |
| | | inv:set_list(listname, list) |
| | | end |
| | | for name, value in pairs(data.metas) do |
| | | local meta_type = get_meta_type(data.name, name) |
| | | if meta_type == wrench.META_TYPE_INT then |
| | |
| | | meta:set_string(name, value) |
| | | end |
| | | end |
| | | for listname, list in pairs(lists) do |
| | | inv:set_list(listname, list) |
| | | end |
| | | itemstack:take_item() |
| | | return itemstack |
| | | end |