mirror of
https://github.com/minetest-mods/technic.git
synced 2025-06-30 15:20:37 +02:00
only reject part of itemtack from chest/machine/etc., if possible
(e.g. if there's room for 50 of some item, and you send a stack of 99, 50 are added to the chest and a stack of 49 is rejected and sent on to the next destination)
This commit is contained in:
@ -103,7 +103,8 @@ minetest.register_node("technic:tool_workshop", {
|
||||
allow_metadata_inventory_take = technic.machine_inventory_take,
|
||||
tube = {
|
||||
can_insert = function (pos, node, stack, direction)
|
||||
return minetest.get_meta(pos):get_inventory():room_for_item("src", stack)
|
||||
local onestack = stack:peek_item(1)
|
||||
return minetest.get_meta(pos):get_inventory():room_for_item("src", onestack)
|
||||
end,
|
||||
insert_object = function (pos, node, stack, direction)
|
||||
return minetest.get_meta(pos):get_inventory():add_item("src", stack)
|
||||
|
Reference in New Issue
Block a user