summaryrefslogtreecommitdiff
path: root/technic_chests
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-04-09 17:16:25 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-04-09 20:35:11 -0400
commitaf39221df9d2436cffedaca25365ae55489d6e48 (patch)
tree75bf8cd6f53a00008215b6a210dc9985ada450cc /technic_chests
parent72c536c04eb98aae29e983acd761bc94d7d26ca9 (diff)
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)
Diffstat (limited to 'technic_chests')
-rw-r--r--technic_chests/common.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/technic_chests/common.lua b/technic_chests/common.lua
index 32b34eb..1241c5e 100644
--- a/technic_chests/common.lua
+++ b/technic_chests/common.lua
@@ -13,7 +13,8 @@ technic.chests.tube = {
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
- return inv:room_for_item("main",stack)
+ local onestack = stack:peek_item(1)
+ return inv:room_for_item("main", onestack)
end,
input_inventory = "main",
connect_sides = {left=1, right=1, front=1, back=1, top=1, bottom=1},