Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function move_items(s_inv, s_listname, d_inv, d_listname)
- local s_size = s_inv:get_size(s_listname)
- local s_index = 1
- while s_index <= s_size do
- local stack = s_inv:get_stack(s_listname, s_index)
- if stack and not stack:is_empty() then
- local leftover = d_inv:add_item(d_listname, stack)
- s_inv:set_stack(s_listname, s_index, leftover)
- end
- s_index = s_index + 1
- end
- end
- minetest.register_tool(":default:asdf", {
- inventory_image = "default_wood.png",
- on_use = function(itemstack, user, pointed_thing)
- local inv = user:get_inventory()
- move_items(inv, "main", inv, "craft")
- end,
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement