<file_sep>package com.drin.mcrc;

import java.util.ArrayList;

public class Recipe {

	private int result;
	private Item output;
	private ArrayList<Item> recipe;
	private ArrayList<Item> raw;
	
	public Recipe(ArrayList<Item> recipe, Item output, int number) {
		this.result = number;
		this.recipe = recipe;
		this.output = output;
		this.raw = generateRaw();
	}
	
	public Recipe(ArrayList<Item> recipe, Item output) {
		this.result = 1;
		this.recipe = recipe;
		this.output = output;
		this.raw = generateRaw();
	}
	
	public ArrayList<Item> generateRaw() {
		
		ArrayList<Item> r = new ArrayList<Item>();
		
		for (Item i : recipe) {
			if (i == null) {
				//do nothing, dont care if theres no crafting required
			} else if (i.getRecipe() == null) {
				r.add(i);
			} else {
				r.addAll(i.getRecipe().getRaw());
			}
		}
		
		return r;
	}
	
	public ArrayList<Item> getRaw() {
		return raw;
	}
	
	public String toString() {
		return recipe.toString();
	}
	
	public Item getOutput() {
		return output;
	}
	
}
<file_sep>MCRC
====

Minecraft Resource Calculator
