Some work on EMC mappings. Lots still to do.
This commit is contained in:
parent
eb633a3695
commit
f73271d6b6
|
@ -1,8 +1,10 @@
|
|||
package ee3.core;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
import ee3.item.ItemPhilosopherStone;
|
||||
import ee3.item.ModItems;
|
||||
|
@ -38,12 +40,12 @@ public class RecipesPhilStone {
|
|||
|
||||
|
||||
public static void initRecipes() {
|
||||
//determineBaseMaterials();
|
||||
initTransmutationRecipes();
|
||||
initEquivalenceRecipes();
|
||||
initReconstructiveRecipes();
|
||||
initDestructorRecipes();
|
||||
initPortableSmeltingRecipes();
|
||||
determineBaseMaterials();
|
||||
//initTransmutationRecipes();
|
||||
//initEquivalenceRecipes();
|
||||
//initReconstructiveRecipes();
|
||||
//initDestructorRecipes();
|
||||
//initPortableSmeltingRecipes();
|
||||
}
|
||||
|
||||
public static void determineBaseMaterials() {
|
||||
|
@ -55,28 +57,51 @@ public class RecipesPhilStone {
|
|||
ShapelessRecipes shapelessRecipe;
|
||||
|
||||
ItemStack[] shapedInputs;
|
||||
List shapelessInputs;
|
||||
List<ItemStack> shapelessInputs;
|
||||
|
||||
ItemStack recipeOutput = null;
|
||||
Iterator<IRecipe> recipeIter = recipeList.iterator();
|
||||
|
||||
|
||||
ItemStack[] recipeInputs = null;
|
||||
Vector<Integer> inputs = new Vector<Integer>();
|
||||
Vector<Integer> outputs = new Vector<Integer>();
|
||||
|
||||
try {
|
||||
while (recipeIter.hasNext()) {
|
||||
recipe = recipeIter.next();
|
||||
|
||||
if (recipe instanceof ShapedRecipes) {
|
||||
shapedRecipe = (ShapedRecipes) recipe;
|
||||
shapedInputs = mod_EE3.proxy.getPrivateValue(ShapedRecipes.class, shapedRecipe, "recipeItems");
|
||||
|
||||
System.out.println("Shaped");
|
||||
System.out.println(shapedInputs.toString());
|
||||
//shapedInputs = mod_EE3.proxy.getPrivateValue(ShapedRecipes.class, shapedRecipe, "recipeItems");
|
||||
recipeInputs = mod_EE3.proxy.getPrivateValue(ShapedRecipes.class, shapedRecipe, "recipeItems");
|
||||
recipeOutput = mod_EE3.proxy.getPrivateValue(ShapedRecipes.class, shapedRecipe, "recipeOutput");
|
||||
System.out.println("Shaped Recipe");
|
||||
}
|
||||
else if (recipe instanceof ShapelessRecipes) {
|
||||
shapelessRecipe = (ShapelessRecipes) recipe;
|
||||
shapelessInputs = mod_EE3.proxy.getPrivateValue(ShapelessRecipes.class, shapelessRecipe, "recipeItems");
|
||||
|
||||
System.out.println("Shapeless");
|
||||
System.out.println(shapelessInputs.toString());
|
||||
recipeInputs = shapelessInputs.toArray(new ItemStack[0]);
|
||||
recipeOutput = mod_EE3.proxy.getPrivateValue(ShapelessRecipes.class, shapelessRecipe, "recipeOutput");
|
||||
System.out.println("Shapeless Recipe");
|
||||
}
|
||||
System.out.println("Output: " + recipeOutput.toString());
|
||||
outputs.add(recipeOutput.getItem().shiftedIndex);
|
||||
for (ItemStack itemStack : recipeInputs) {
|
||||
if (itemStack != null) {
|
||||
System.out.println("Input: " + itemStack.toString());
|
||||
if (!inputs.contains(new Integer(itemStack.getItem().shiftedIndex)))
|
||||
inputs.add(new Integer(itemStack.getItem().shiftedIndex));
|
||||
}
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
//for (int i = 0; i < outputs.size(); i++) {
|
||||
// System.out.println("i: " + i + ", item: " + outputs.get(i));
|
||||
//}
|
||||
inputs.removeAll(outputs);
|
||||
for (int i = 0; i < inputs.size(); i++) {
|
||||
System.out.println(i + "," + inputs.get(i) + "," + Item.itemsList[inputs.get(i)].getItemName());
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
|
57
ee3_common/ee3/emc/EMCList.java
Normal file
57
ee3_common/ee3/emc/EMCList.java
Normal file
|
@ -0,0 +1,57 @@
|
|||
package ee3.emc;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
||||
public class EMCList {
|
||||
|
||||
private HashMap<Integer, HashMap<Integer, EMCValue>> emcMap;
|
||||
|
||||
public EMCList() {
|
||||
emcMap = new HashMap<Integer, HashMap<Integer, EMCValue>>();
|
||||
}
|
||||
|
||||
public void initEMCList() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Helper functions */
|
||||
|
||||
private void printEMCList() {
|
||||
System.out.println("\n*** Starting Debug Dump of EMC List ***");
|
||||
System.out.println("*** End of EMC List ***\n");
|
||||
}
|
||||
|
||||
private void addEMCValue(Block block, EMCValue emc) {
|
||||
this.addEMCValue(block.blockID, 0, emc);
|
||||
}
|
||||
|
||||
private void addEMCValue(Block block, int meta, EMCValue emc) {
|
||||
this.addEMCValue(block.blockID, meta, emc);
|
||||
}
|
||||
|
||||
private void addEMCValue(Item item, EMCValue emc) {
|
||||
this.addEMCValue(item.shiftedIndex, 0, emc);
|
||||
}
|
||||
|
||||
private void addEMCValue(ItemStack itemStack, EMCValue emc) {
|
||||
this.addEMCValue(itemStack.itemID, itemStack.getItemDamage(), emc);
|
||||
}
|
||||
|
||||
private void addEMCValue(int id, EMCValue emc) {
|
||||
this.addEMCValue(id, 0, emc);
|
||||
}
|
||||
|
||||
private void addEMCValue(int id, int meta, EMCValue emc) {
|
||||
HashMap<Integer, EMCValue> tempMap = new HashMap<Integer, EMCValue>();
|
||||
if(emcMap.get(id) != null) {
|
||||
tempMap = emcMap.get(id);
|
||||
}
|
||||
tempMap.put(meta, emc);
|
||||
emcMap.put(id, tempMap);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package ee3.core;
|
||||
package ee3.emc;
|
||||
|
||||
/**
|
||||
* TODO Class Description
|
|
@ -2,6 +2,7 @@ package ee3.item;
|
|||
|
||||
import ee3.core.interfaces.IItemChargeable;
|
||||
import ee3.core.interfaces.IItemModal;
|
||||
import net.minecraft.src.EnumRarity;
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
||||
/**
|
||||
|
@ -21,6 +22,10 @@ public class ItemPhilosopherStone extends ItemEE implements IItemChargeable, IIt
|
|||
maxCharge = 4;
|
||||
maxMode = 2;
|
||||
}
|
||||
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getMaxCharge() {
|
||||
|
|
|
@ -6,6 +6,7 @@ import ee3.core.RecipesPhilStone;
|
|||
import ee3.core.ServerClientProxy;
|
||||
import ee3.core.Version;
|
||||
import ee3.core.interfaces.IProxy;
|
||||
import ee3.emc.EMCList;
|
||||
import ee3.gui.GuiHandler;
|
||||
import ee3.item.ModItems;
|
||||
import ee3.lib.ItemIds;
|
||||
|
@ -25,10 +26,12 @@ public class mod_EE3 extends NetworkMod {
|
|||
|
||||
public static mod_EE3 instance;
|
||||
public static IProxy proxy;
|
||||
public static EMCList emcList;
|
||||
public static ConfigurationManager config = new ConfigurationManager(Reference.CONFIG_FILE);
|
||||
|
||||
public mod_EE3() {
|
||||
instance = this;
|
||||
emcList = new EMCList();
|
||||
proxy = ServerClientProxy.getProxy();
|
||||
|
||||
// Forge version check
|
||||
|
@ -59,6 +62,8 @@ public class mod_EE3 extends NetworkMod {
|
|||
RecipesPhilStone.initRecipes();
|
||||
|
||||
BuildCraftAddon.init();
|
||||
|
||||
emcList.initEMCList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue