diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-09-06 14:43:38 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-09-06 14:43:38 +1000 |
commit | a86f2fe29fba9173f65a0ef7a6961c17e5d1cc4b (patch) | |
tree | 735e07e76befa35ea237e57883f067cd402f9654 /src/Java/miscutil/xmod/gregtech | |
parent | e12c5cafb9485ae1f62eeeed3a795d239e85cba5 (diff) | |
download | GT5-Unofficial-a86f2fe29fba9173f65a0ef7a6961c17e5d1cc4b.tar.gz GT5-Unofficial-a86f2fe29fba9173f65a0ef7a6961c17e5d1cc4b.tar.bz2 GT5-Unofficial-a86f2fe29fba9173f65a0ef7a6961c17e5d1cc4b.zip |
+ Made Energy Crystal have a different recipe every day. (There is about 300 possible permutations)
% Tried adding another recipe handler for the dehydrator.
> This one combines the mixer input, fluid input, fluid output, with a sifter multi output and chance.
Diffstat (limited to 'src/Java/miscutil/xmod/gregtech')
-rw-r--r-- | src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java | 2 | ||||
-rw-r--r-- | src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java | 47 |
2 files changed, 48 insertions, 1 deletions
diff --git a/src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 06c6dc42e6..10e3b32b58 100644 --- a/src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -50,6 +50,6 @@ public interface IGregtech_RecipeAdder { public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration, int aEUt); public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt); public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt); - + public boolean addDehydratorRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt); } diff --git a/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java index 28cf60334b..2589ceee23 100644 --- a/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -3,6 +3,7 @@ package miscutil.xmod.gregtech.recipes; import gregtech.api.GregTech_API; import gregtech.api.util.Recipe_GT; import miscutil.core.util.Utils; +import miscutil.core.util.item.UtilsItems; import miscutil.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; import miscutil.xmod.gregtech.recipes.machines.RECIPEHANDLER_CokeOven; import miscutil.xmod.gregtech.recipes.machines.RECIPEHANDLER_Dehydrator; @@ -189,5 +190,51 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { RECIPEHANDLER_Dehydrator.debug5(null, null, aFluid, aOutputFluid, aOutputItems, aDuration, aEUt); return true; } + + + + + @Override + public boolean addDehydratorRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt) { + Utils.LOG_INFO("Trying to add a Dehydrator recipe."); + if (aInput1 != null){ + Utils.LOG_INFO("Recipe requires input: "+aInput1.getDisplayName()+" x"+aInput1.stackSize); + } + if (aInput2 != null){ + Utils.LOG_INFO("Recipe requires input: "+aInput2.getDisplayName()+" x"+aInput2.stackSize); + } + if (aFluidInput != null){ + Utils.LOG_INFO("Recipe requires input: "+aFluidInput.getFluid().getName()+" "+aFluidInput.amount+"mb"); + } + if (((aInput1 == null) && (aFluidInput == null)) || ((aOutputItems == null) && (aFluidOutput == null))) { + return false; + } + if ((aOutputItems != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0)) { + return false; + } + if (aOutputItems != null){ + Utils.LOG_INFO("Recipe will output: "+UtilsItems.getArrayStackNames(aOutputItems)); + } + if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + return false; + } + if (aFluidOutput != null){ + Utils.LOG_INFO("Recipe will output: "+aFluidOutput.getFluid().getName()); + } + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + return true; + } + + + + + + + + + + + + } |