package net.viddeno.technical.machine.recipes;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.viddeno.technical.block.TechnicalBlock;
import net.viddeno.technical.item.TechnicalItem;
import net.viddeno.technical.machine.Tier;

public class CentrifugeRecipes extends MachineRecipes {

	protected static final CentrifugeRecipes smeltingBase = new CentrifugeRecipes();

	public static CentrifugeRecipes smelting() {
		return smeltingBase;
	}

	private CentrifugeRecipes() {
		
		this.addRecipe(new ItemStack[] { new ItemStack(TechnicalItem.BauxiteDust, 20), null, null },
				new ItemStack[] { new ItemStack(TechnicalItem.GibbsiteDust, 5), new ItemStack(TechnicalItem.BoehmiteDust, 5),
						new ItemStack(TechnicalItem.DiasporeDust, 5), new ItemStack(TechnicalItem.GoethiteDust, 2), new ItemStack(TechnicalItem.HematiteDust2, 2),
						new ItemStack(TechnicalItem.AnataseDust, 1) }, Tier.medium);
		this.addRecipe(new ItemStack[] { new ItemStack(TechnicalItem.ColtanDust, 2), null, null},
				new ItemStack[] { new ItemStack(TechnicalItem.ColumbiteDust, 1), new ItemStack(TechnicalItem.TantaliteDust, 1) }, Tier.advanced);
		this.addRecipe(new ItemStack[] { new ItemStack(TechnicalBlock.DirtGold, 14), new ItemStack(Items.water_bucket, 1), null },
				new ItemStack[] { new ItemStack(Blocks.dirt, 14), new ItemStack(Items.gold_nugget, 1), new ItemStack(Items.bucket, 1) }, Tier.normal);
		this.addRecipe(new ItemStack[] { new ItemStack(Blocks.dirt, 14), new ItemStack(Items.water_bucket, 1), null },
				new ItemStack[] { new ItemStack(Blocks.dirt, 14), new ItemStack(Items.bucket, 1) }, Tier.normal);
	}

	public static boolean isItemUsedInRecipe(ItemStack itemStack) {
		Item[] itemsUsed = new Item[] { TechnicalItem.BauxiteDust, TechnicalItem.ColtanDust };
		for(Item item : itemsUsed)
			if(item == itemStack.getItem())
				return true;
		return false;
	}
}