Minecraft – How to stop a system from overfilling a chest

minecraft-feed-the-beastminecraft-java-edition

Ok I have a turtle mining, and filling Enderchest(a1) with it's payload.
I have buildcraft pipes emptying Enderchest(a2) into Diamond chest(1).

I wanted to have a second set of pipes emptying Diamond chest(1) into Diamond chest(2) effectivly increasing my mining storage to the size of 2 Diamond Chests. This will work until we have enough items to fill Diamond chest(2) at which point the system continues to pull things out of Diamond chest(1) and spit them onto the ground. How can I circumvent this?

Best Answer

Two options:

First, use buildcraft Gates, that is what they where designed for!

Have one gate detecting if there is space in the destination inventory, have a 2nd aurtatic gate connected by a pipe signal pulling out of the first chest.

A 2nd option, put a turtle between the two chests, you already said you have computer craft, just put a turtle between the two chests and have this simple program run on startup. It sucks 16 stacks of items from the below chest and tries to place it in the above chest.

function suckItems()
  for slot = 1, 16 do
    turtle.select(slot)
    turtle.suckDown()
  end
end

function dropItems()
  for slot = 1, 16 do
    turtle.select(slot)
    turtle.dropUp()
  end
end

while(true) do
  suckItems()
  dropItems()
  os.Sleep(1) --This may be unnecessary
end

for fastest speed I am assuming your layout is

[X] = Chest 2
[T] = Turtle
[X] = Chest 1  (looking at from the front)

You could have it horizontal but you would need to make the turtle turn every time