From 75dd4470447444f43ea8330156c8c5538111d502 Mon Sep 17 00:00:00 2001 From: pahimar Date: Sat, 1 Feb 2014 11:01:56 -0500 Subject: [PATCH] Added RecipesAludel support to RecipeRegistry, so that items can have their values assigned via DynEmc --- .../java/com/pahimar/ee3/EquivalentExchange3.java | 2 -- .../ee3/addon/AddonEquivalentExchange3.java | 15 --------------- .../pahimar/ee3/item/crafting/RecipeAludel.java | 12 ++++++++++++ .../com/pahimar/ee3/recipe/RecipeRegistry.java | 13 +++++++++++++ .../com/pahimar/ee3/recipe/RecipesAludel.java | 3 +-- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/pahimar/ee3/EquivalentExchange3.java b/src/main/java/com/pahimar/ee3/EquivalentExchange3.java index 07d4d7b2..d9befd33 100644 --- a/src/main/java/com/pahimar/ee3/EquivalentExchange3.java +++ b/src/main/java/com/pahimar/ee3/EquivalentExchange3.java @@ -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 diff --git a/src/main/java/com/pahimar/ee3/addon/AddonEquivalentExchange3.java b/src/main/java/com/pahimar/ee3/addon/AddonEquivalentExchange3.java index c399b277..6df756aa 100644 --- a/src/main/java/com/pahimar/ee3/addon/AddonEquivalentExchange3.java +++ b/src/main/java/com/pahimar/ee3/addon/AddonEquivalentExchange3.java @@ -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() diff --git a/src/main/java/com/pahimar/ee3/item/crafting/RecipeAludel.java b/src/main/java/com/pahimar/ee3/item/crafting/RecipeAludel.java index 16f256c6..da3d28e0 100644 --- a/src/main/java/com/pahimar/ee3/item/crafting/RecipeAludel.java +++ b/src/main/java/com/pahimar/ee3/item/crafting/RecipeAludel.java @@ -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 getRecipeInputsAsWrappedStacks() + { + List recipeInputs = new ArrayList(); + recipeInputs.add(new WrappedStack(inputStack)); + recipeInputs.add(new WrappedStack(dustStack)); + return recipeInputs; + } + @Override public boolean equals(Object object) { diff --git a/src/main/java/com/pahimar/ee3/recipe/RecipeRegistry.java b/src/main/java/com/pahimar/ee3/recipe/RecipeRegistry.java index 208ce383..502f011b 100644 --- a/src/main/java/com/pahimar/ee3/recipe/RecipeRegistry.java +++ b/src/main/java/com/pahimar/ee3/recipe/RecipeRegistry.java @@ -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 recipeInputs = recipeAludel.getRecipeInputsAsWrappedStacks(); + + if (!recipeMap.get(recipeOutput).contains(recipeInputs)) + { + recipeMap.put(recipeOutput, recipeInputs); + } + } + // Add recipes gathered via IMC for (WrappedStack outputStack : RecipesIMC.getIMCRecipes().keySet()) { diff --git a/src/main/java/com/pahimar/ee3/recipe/RecipesAludel.java b/src/main/java/com/pahimar/ee3/recipe/RecipesAludel.java index ec0bf8ec..1b8a1402 100644 --- a/src/main/java/com/pahimar/ee3/recipe/RecipesAludel.java +++ b/src/main/java/com/pahimar/ee3/recipe/RecipesAludel.java @@ -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 getRecipeMap() + public List getRecipes() { return aludelRecipes; }