@Override
public boolean importRecipe(TileEntity tile, ItemIdentifierInventory inventory) {
if (!(tile instanceof TileAdvancedCraftingTable))
return false;
TileAdvancedCraftingTable bench = (TileAdvancedCraftingTable) tile;
ItemStack result = bench.getOutputSlot().getStackInSlot(0);
if (result == null)
return false;
inventory.setInventorySlotContents(9, result);
// Import
for (int i = 0; i < bench.getCraftingSlots().getSizeInventory(); i++) {
if (i >= inventory.getSizeInventory() - 2) {
break;
}
final ItemStack newStack = bench.getCraftingSlots().getStackInSlot(i) == null ? null : bench.getCraftingSlots().getStackInSlot(i).copy();
inventory.setInventorySlotContents(i, newStack);
}
// Compact
for (int i = 0; i < inventory.getSizeInventory() - 2; i++) {