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)
- while stack and not stack:is_empty() do
- local oneitem = ItemStack({name=stack:get_name(), count=1})
- if not d_inv:room_for_item(d_listname, oneitem) then
- break
- end
- stack = d_inv:add_item(d_listname, stack)
- end
- s_inv:set_stack(s_listname, s_index, stack)
- s_index = s_index + 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement