// Path: src/main/java/mods/ocminecart/common/assemble/util/General.java
// public class General {
// 	public static Object[] validate(IInventory inventory, int maxcomplexity){
// 		String need = ComponentCheck.checkRequiredComponents(inventory);
// 		if(need!=null){
// 			IChatComponent[] warnings = new IChatComponent[]{ new ChatComponentText(need+"!") };
// 			return new Object[]{false, new ChatComponentText(EnumChatFormatting.RED+need), warnings};
// 		}
// 		if(Complexity.calculate(inventory)>maxcomplexity){
// 			return new Object[]{false, new ChatComponentText(EnumChatFormatting.RED+"Complexity: "+Complexity.calculate(inventory)+" / "+maxcomplexity)};
// 		}
// 		return new Object[]{true, new ChatComponentText("Complexity: "+Complexity.calculate(inventory)+" / "+maxcomplexity)};
// 	}
// 	
// 	public static ItemStack createItemStack(int tier, HashMap<Integer,ItemStack> components){
// 		ItemStack stack = new  ItemStack(ModItems.item_ComputerCart,1);
// 		ComputerCartData data = new ComputerCartData();
// 		data.setComponents(components);
// 		data.setTier(tier);
// 		data.setEnergy(Settings.ComputerCartCreateEnergy);
// 		
// 		ItemComputerCart.setData(stack, data);
// 		return stack;
// 	}
// 	
// 	public static Object[] assemble(IInventory inventory, int tier){
// 		HashMap<Integer, ItemStack> comp = new HashMap<Integer, ItemStack>();
// 		int size = inventory.getSizeInventory();
// 		for(int i=1;i<size;i+=1){
// 			if(inventory.getStackInSlot(i)!=null) comp.put(i-1,inventory.getStackInSlot(i));
// 		}
// 		
// 		int energy = (tier<3) ? Settings.ComputerCartBaseCost+Settings.ComputerCartComplexityCost * Complexity.calculate(inventory) : 0;
// 		
// 		return new Object[]{General.createItemStack(tier, comp), energy};
// 	}
// }
// 
// Path: src/main/java/mods/ocminecart/common/items/ModItems.java
// public class ModItems {
// 	
// 	public static Item item_ComputerCart;
// 	public static Item item_ComputerCartCase;
// 	public static Item item_CartRemoteModule;
// 	public static Item item_CartRemoteAnalyzer;
// 	public static Item item_LinkingUpgrade;
// 	
// 	public static void init(){
// 		item_ComputerCart=new ItemComputerCart().setCreativeTab(OCMinecart.itemGroup);
// 		item_ComputerCartCase=new ComputerCartCase().setCreativeTab(OCMinecart.itemGroup);
// 		item_CartRemoteModule = new ItemCartRemoteModule().setCreativeTab(OCMinecart.itemGroup);
// 		item_CartRemoteAnalyzer = new ItemRemoteAnalyzer().setCreativeTab(OCMinecart.itemGroup);
// 		item_LinkingUpgrade = new ItemLinkingUpgrade().setCreativeTab(OCMinecart.itemGroup);
// 		
// 		GameRegistry.registerItem(item_ComputerCart,"itemcomputercart");
// 		GameRegistry.registerItem(item_ComputerCartCase,"itemcomputercartcase");
// 		GameRegistry.registerItem(item_CartRemoteModule,"itemcartremotemodule");
// 		GameRegistry.registerItem(item_CartRemoteAnalyzer,"itemcartremoteanalyzer");
// 		GameRegistry.registerItem(item_LinkingUpgrade,"linkingupgrade");
// 	}
// }


import li.cil.oc.api.driver.item.Slot;
import li.cil.oc.common.Tier;
import mods.ocminecart.common.assemble.util.General;
import mods.ocminecart.common.items.ModItems;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
package mods.ocminecart.common.assemble;



public class ComputerCartT2Template {
	private static final int MAX_COMPLEXITY = 100;
	
	public static boolean select(ItemStack stack){
		return stack.getItem().equals(ModItems.item_ComputerCartCase) && stack.getItemDamage()==1;
	}
	
	public static Object[] validate(IInventory inventory){
		return General.validate(inventory, MAX_COMPLEXITY);
	}
	
	public static Object[] assemble(IInventory inventory){
		return General.assemble(inventory, 1);
	}
	
	public static int[] getContainerTier(){
		return new int[]{2,1,0};
	}
	
	public static int[] getUpgradeTier(){
		return new int[]{1,1,1,0,0,0};
	}
	
	public static Iterable<Pair<String, Integer>> getComponentSlots(){
		ArrayList<Pair<String, Integer>> list = new ArrayList<Pair<String, Integer>>();
		list.add(Pair.of(Slot.Card, 1));
		list.add(Pair.of(Slot.Card, 0));
		list.add(Pair.of(Slot.None, -1));
		
		list.add(Pair.of(Slot.CPU, 1));
		list.add(Pair.of(Slot.Memory, 1));
		list.add(Pair.of(Slot.Memory, 1));
		
		list.add(Pair.of("eeprom", Tier.Any()));
// Path: src/main/java/mods/ocminecart/common/assemble/util/General.java
// public class General {
// 	public static Object[] validate(IInventory inventory, int maxcomplexity){
// 		String need = ComponentCheck.checkRequiredComponents(inventory);
// 		if(need!=null){
// 			IChatComponent[] warnings = new IChatComponent[]{ new ChatComponentText(need+"!") };
// 			return new Object[]{false, new ChatComponentText(EnumChatFormatting.RED+need), warnings};
// 		}
// 		if(Complexity.calculate(inventory)>maxcomplexity){
// 			return new Object[]{false, new ChatComponentText(EnumChatFormatting.RED+"Complexity: "+Complexity.calculate(inventory)+" / "+maxcomplexity)};
// 		}
// 		return new Object[]{true, new ChatComponentText("Complexity: "+Complexity.calculate(inventory)+" / "+maxcomplexity)};
// 	}
// 	
// 	public static ItemStack createItemStack(int tier, HashMap<Integer,ItemStack> components){
// 		ItemStack stack = new  ItemStack(ModItems.item_ComputerCart,1);
// 		ComputerCartData data = new ComputerCartData();
// 		data.setComponents(components);
// 		data.setTier(tier);
// 		data.setEnergy(Settings.ComputerCartCreateEnergy);
// 		
// 		ItemComputerCart.setData(stack, data);
// 		return stack;
// 	}
// 	
// 	public static Object[] assemble(IInventory inventory, int tier){
// 		HashMap<Integer, ItemStack> comp = new HashMap<Integer, ItemStack>();
// 		int size = inventory.getSizeInventory();
// 		for(int i=1;i<size;i+=1){
// 			if(inventory.getStackInSlot(i)!=null) comp.put(i-1,inventory.getStackInSlot(i));
// 		}
// 		
// 		int energy = (tier<3) ? Settings.ComputerCartBaseCost+Settings.ComputerCartComplexityCost * Complexity.calculate(inventory) : 0;
// 		
// 		return new Object[]{General.createItemStack(tier, comp), energy};
// 	}
// }
// 
// Path: src/main/java/mods/ocminecart/common/items/ModItems.java
// public class ModItems {
// 	
// 	public static Item item_ComputerCart;
// 	public static Item item_ComputerCartCase;
// 	public static Item item_CartRemoteModule;
// 	public static Item item_CartRemoteAnalyzer;
// 	public static Item item_LinkingUpgrade;
// 	
// 	public static void init(){
// 		item_ComputerCart=new ItemComputerCart().setCreativeTab(OCMinecart.itemGroup);
// 		item_ComputerCartCase=new ComputerCartCase().setCreativeTab(OCMinecart.itemGroup);
// 		item_CartRemoteModule = new ItemCartRemoteModule().setCreativeTab(OCMinecart.itemGroup);
// 		item_CartRemoteAnalyzer = new ItemRemoteAnalyzer().setCreativeTab(OCMinecart.itemGroup);
// 		item_LinkingUpgrade = new ItemLinkingUpgrade().setCreativeTab(OCMinecart.itemGroup);
// 		
// 		GameRegistry.registerItem(item_ComputerCart,"itemcomputercart");
// 		GameRegistry.registerItem(item_ComputerCartCase,"itemcomputercartcase");
// 		GameRegistry.registerItem(item_CartRemoteModule,"itemcartremotemodule");
// 		GameRegistry.registerItem(item_CartRemoteAnalyzer,"itemcartremoteanalyzer");
// 		GameRegistry.registerItem(item_LinkingUpgrade,"linkingupgrade");
// 	}
// }


// Path: src/main/java/mods/ocminecart/common/assemble/ComputerCartT2Template.java
import li.cil.oc.api.driver.item.Slot;
import li.cil.oc.common.Tier;
import mods.ocminecart.common.assemble.util.General;
import mods.ocminecart.common.items.ModItems;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;

package mods.ocminecart.common.assemble;



public class ComputerCartT2Template {
	private static final int MAX_COMPLEXITY = 100;
	
	public static boolean select(ItemStack stack){
		return stack.getItem().equals(ModItems.item_ComputerCartCase) && stack.getItemDamage()==1;
	}
	
	public static Object[] validate(IInventory inventory){
		return General.validate(inventory, MAX_COMPLEXITY);
	}
	
	public static Object[] assemble(IInventory inventory){
		return General.assemble(inventory, 1);
	}
	
	public static int[] getContainerTier(){
		return new int[]{2,1,0};
	}
	
	public static int[] getUpgradeTier(){
		return new int[]{1,1,1,0,0,0};
	}
	
	public static Iterable<Pair<String, Integer>> getComponentSlots(){
		ArrayList<Pair<String, Integer>> list = new ArrayList<Pair<String, Integer>>();
		list.add(Pair.of(Slot.Card, 1));
		list.add(Pair.of(Slot.Card, 0));
		list.add(Pair.of(Slot.None, -1));
		
		list.add(Pair.of(Slot.CPU, 1));
		list.add(Pair.of(Slot.Memory, 1));
		list.add(Pair.of(Slot.Memory, 1));
		
		list.add(Pair.of("eeprom", Tier.Any()));
		list.add(Pair.of(Slot.HDD, 1));