Added RecipesAludel support to RecipeRegistry, so that items can have their values assigned via DynEmc

This commit is contained in:
pahimar 2014-02-01 11:01:56 -05:00
parent 748f6ca593
commit 75dd447044
5 changed files with 26 additions and 19 deletions

View file

@ -15,7 +15,6 @@ import com.pahimar.ee3.lib.Reference;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.network.PacketHandler;
import com.pahimar.ee3.proxy.IProxy;
import com.pahimar.ee3.recipe.RecipesAludel;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
@ -160,7 +159,6 @@ public class EquivalentExchange3
public void postInit(FMLPostInitializationEvent event)
{
// NOOP
RecipesAludel.getInstance().debugDumpMap();
}
@EventHandler

View file

@ -2,7 +2,6 @@ package com.pahimar.ee3.addon;
import com.pahimar.ee3.block.ModBlocks;
import com.pahimar.ee3.item.ModItems;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
public class AddonEquivalentExchange3
@ -20,20 +19,6 @@ public class AddonEquivalentExchange3
* Chalk
*/
AddonHandler.sendAddRecipe(new ItemStack(ModItems.chalk, 4), new ItemStack(ModBlocks.chalk));
/**
* Infused Cloth
*/
AddonHandler.sendAddRecipe(new ItemStack(ModBlocks.infusedCloth.blockID, 1, 0), new ItemStack(Block.cloth), new ItemStack(ModItems.alchemicalDust.itemID, 1, 1));
AddonHandler.sendAddRecipe(new ItemStack(ModBlocks.infusedCloth.blockID, 1, 1), new ItemStack(Block.cloth), new ItemStack(ModItems.alchemicalDust.itemID, 1, 2));
AddonHandler.sendAddRecipe(new ItemStack(ModBlocks.infusedCloth.blockID, 1, 2), new ItemStack(Block.cloth), new ItemStack(ModItems.alchemicalDust.itemID, 1, 3));
/**
* Infused Wood
*/
AddonHandler.sendAddRecipe(new ItemStack(ModBlocks.infusedWood.blockID, 1, 0), new ItemStack(Block.wood), new ItemStack(ModItems.alchemicalDust.itemID, 4, 1));
AddonHandler.sendAddRecipe(new ItemStack(ModBlocks.infusedWood.blockID, 1, 1), new ItemStack(Block.wood), new ItemStack(ModItems.alchemicalDust.itemID, 4, 2));
AddonHandler.sendAddRecipe(new ItemStack(ModBlocks.infusedWood.blockID, 1, 2), new ItemStack(Block.wood), new ItemStack(ModItems.alchemicalDust.itemID, 4, 3));
}
private static void addPreAssignmentEmcValues()

View file

@ -1,8 +1,12 @@
package com.pahimar.ee3.item.crafting;
import com.pahimar.ee3.api.WrappedStack;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.List;
public class RecipeAludel
{
private ItemStack recipeOutput;
@ -36,6 +40,14 @@ public class RecipeAludel
return new ItemStack[]{inputStack, dustStack};
}
public List<WrappedStack> getRecipeInputsAsWrappedStacks()
{
List<WrappedStack> recipeInputs = new ArrayList<WrappedStack>();
recipeInputs.add(new WrappedStack(inputStack));
recipeInputs.add(new WrappedStack(dustStack));
return recipeInputs;
}
@Override
public boolean equals(Object object)
{

View file

@ -3,6 +3,7 @@ package com.pahimar.ee3.recipe;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import com.pahimar.ee3.api.WrappedStack;
import com.pahimar.ee3.item.crafting.RecipeAludel;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -72,6 +73,18 @@ public class RecipeRegistry
}
}
// Add Aludel recipes
for (RecipeAludel recipeAludel : RecipesAludel.getInstance().getRecipes())
{
WrappedStack recipeOutput = new WrappedStack(recipeAludel.getRecipeOutput());
List<WrappedStack> recipeInputs = recipeAludel.getRecipeInputsAsWrappedStacks();
if (!recipeMap.get(recipeOutput).contains(recipeInputs))
{
recipeMap.put(recipeOutput, recipeInputs);
}
}
// Add recipes gathered via IMC
for (WrappedStack outputStack : RecipesIMC.getIMCRecipes().keySet())
{

View file

@ -1,7 +1,6 @@
package com.pahimar.ee3.recipe;
import com.pahimar.ee3.block.ModBlocks;
import com.pahimar.ee3.helper.ItemHelper;
import com.pahimar.ee3.helper.LogHelper;
import com.pahimar.ee3.item.ModItems;
import com.pahimar.ee3.item.crafting.RecipeAludel;
@ -114,7 +113,7 @@ public class RecipesAludel
return null;
}
public List<RecipeAludel> getRecipeMap()
public List<RecipeAludel> getRecipes()
{
return aludelRecipes;
}