This machine sorts your stuff and puts it in its own chest. I hope you enjoy & don't forget to vote.
Step 1: What You Need
What you need is
4 trapped chests
4 Redstone repeaters
4 Redstone comparators
4 Redstone torches
24 blocks (of your choice)
8 Redstone dust
23 of each of the 4 things you want to sort (in my case diamonds, iron, gold, emeralds,)
4 item frames
So to start go up 4 blocks and place 5 hoppers pointing to the left. Then place 4 more hoppers pointing to the back. (like you see in the picture)
Now place another row of hoppers pointing forwards.
Now in front of the row of hoppers you just placed make a platform that is
2 X 4 then behind the hoppers make what you see in the 2nd picture. Then underneath it place your 4 repeaters.
Now go over the repeaters on the blocks and place 4 Redstone comparators and put them on subtract mode the put your 8 Redstone like you see in the picture. Then underneath the bottom row of hoppers place your 4 Redstone torches.
Now on the platform you made earlier place your chests and trapped chests. first a normal then a trapped and so on. Then above the first hopper you place the one that does not have anything under it place a normal chest. Now following the picture place a chest at the end of the top row of hoppers.
Now go to the second row of hoppers and in each one put 18 of the thing you want it to sort (I put diamonds emeralds, iron, gold,) in the first slot and 1 in each other slot. You should have 1 of each item left.
Now place your item frames underneath your chests and put in them the things you want them to sort. by what hopper you put them in.
Step 9: How It Works
How it works is you put your stuff in the top chest it goes into the hoppers and the hoppers sort them into there own chest and if you put something that does not belong it goes into the other chest. You can make it as big a you want.