@Override
public boolean importRecipe(TileEntity tile, ItemIdentifierInventory inventory) {
if (!(tile instanceof TileAssemblyTable))
return false;
TileAssemblyTable table = (TileAssemblyTable) tile;
//current pipe inputs/outputs
final ItemIdentifierInventory inputs = new ItemIdentifierInventory(inventory.getSizeInventory() - 2, "AssemblyTableDummyInv", 64, false);
for(int i = 0; i< inventory.getSizeInventory() - 2; i++)
inputs.setInventorySlotContents(i, inventory.getIDStackInSlot(i));
ItemStack output = inventory.getStackInSlot(inventory.getSizeInventory() - 2);
//see if there's a recipe planned in the table that matches the current pipe settings, if yes take the next, otherwise take the first
FlexibleRecipe<ItemStack> firstRecipe = null;
FlexibleRecipe<ItemStack> nextRecipe = null;
boolean takeNext = false;
for (IFlexibleRecipe<ItemStack> r : AssemblyRecipeManager.INSTANCE.getRecipes()) {
if(!(r instanceof FlexibleRecipe)) continue;
if(!((FlexibleRecipe<ItemStack>)r).inputFluids.isEmpty()) continue;
if(table.isPlanned(r)) {
if(firstRecipe == null) {
firstRecipe = (FlexibleRecipe<ItemStack>) r;
}
if(takeNext) {
nextRecipe = (FlexibleRecipe<ItemStack>) r;