diff options
author | Prometheus0000 <prometheus0000000@gmail.com> | 2021-02-11 14:29:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 14:29:19 -0500 |
commit | 3a027e939e2c18e165b2f1405637c92f25736582 (patch) | |
tree | 1d75209cd6c074313f0e3f15bc989f7b258a57bd /src/main/java/gregtech/common/GT_RecipeAdder.java | |
parent | c6324633a4491296c0505e59aa7f8747af0c640a (diff) | |
parent | e0c1f654b17d901d018603912bf32c32bd136bad (diff) | |
download | GT5-Unofficial-3a027e939e2c18e165b2f1405637c92f25736582.tar.gz GT5-Unofficial-3a027e939e2c18e165b2f1405637c92f25736582.tar.bz2 GT5-Unofficial-3a027e939e2c18e165b2f1405637c92f25736582.zip |
Merge pull request #23 from GTNewHorizons/experimental
update
Diffstat (limited to 'src/main/java/gregtech/common/GT_RecipeAdder.java')
-rw-r--r-- | src/main/java/gregtech/common/GT_RecipeAdder.java | 66 |
1 files changed, 13 insertions, 53 deletions
diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 96c1374059..6563b3d368 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -359,7 +359,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { public boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict,int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt){ - for(ItemStack tStack : GT_OreDictUnificator.getOres(aOreDict)){ + for(ItemStack tStack : GT_OreDictUnificator.getOresImmutable(aOreDict)){ if(GT_Utility.isStackValid(tStack)) addAssemblerRecipe(aInput1, GT_Utility.copyAmount(aAmount, tStack), aFluidInput, aOutput1, aDuration, aEUt); } @@ -367,7 +367,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } public boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt){ - for(ItemStack tStack : GT_OreDictUnificator.getOres(aOreDict)){ + for(ItemStack tStack : GT_OreDictUnificator.getOresImmutable(aOreDict)){ if(GT_Utility.isStackValid(tStack)) { ItemStack[] extendedInputs = new ItemStack[aInputs.length + 1]; System.arraycopy(aInputs, 0, extendedInputs, 0, aInputs.length); @@ -379,15 +379,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { - /*if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { - return false; - } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); - return true; - */ return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, null,aOutput1, aDuration, aEUt, false); } @@ -396,17 +387,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { - /*if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { - return false; - } - if (aOutput1 == null) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { - return false; - } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0); - */ return addAssemblerRecipe(aInputs, aFluidInput, aOutput1, aDuration, aEUt, false); } @@ -450,7 +430,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { for (int oreID : OreDictionary.getOreIDs(aInputs[i])) { String odName = OreDictionary.getOreName(oreID); if (odName.contains("circuit")) { - for (ItemStack tStack : GT_OreDictUnificator.getOres(odName)) { + for (ItemStack tStack : GT_OreDictUnificator.getOresImmutable(odName)) { if (!GT_Utility.isStackValid(tStack)) continue; aInputs[i] = new ItemStack(tStack.getItem(),aInputs[i].stackSize,tStack.getItemDamage()); @@ -584,14 +564,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { @Deprecated public boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) { -// if ((aInput1 == null) || (aOutput1 == null)) { -// return false; -// } -// if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput1, aDuration)) <= 0) { -// return false; -// } -// new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, aDuration, aEUt); -// return true; return false; } @@ -889,10 +861,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput) { int aDuration= aFluidOutput == null ? aFluidInput.amount / 62 : aFluidOutput.amount / 62; - if ((aInput != null) && (aOutput != null)) { - if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) { - } - } else { + if (aInput == null || aOutput == null) { return false; } if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) { @@ -906,10 +875,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) { - if ((aInput != null) && (aOutput != null)) { - if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) { - } - } else { + if (aInput == null || aOutput == null) { return false; } if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) { @@ -978,8 +944,12 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addAutoclaveRecipe(aInput, aCircuit, aFluid, aOutput, aChance, aDuration, aEUt, false); } - public boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { - if ((aInput == null) || (aFluid == null) || (aOutput == null)) { + public boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluidIn, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { + return addAutoclaveRecipe(aInput, aCircuit, aFluidIn, null, aOutput, aChance, aDuration, aEUt,aCleanroom); + } + + public boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluidIn, FluidStack aFluidOut, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { + if ((aInput == null) || (aFluidIn == null) || (aOutput == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) { @@ -988,7 +958,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if (!GT_Mod.gregtechproxy.mEnableCleanroom){ aCleanroom = false; } - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput, aCircuit}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluid}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput, aCircuit}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidIn}, new FluidStack[]{aFluidOut}, aDuration, aEUt, aCleanroom ? -200 : 0); return true; } @@ -1208,16 +1178,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { @Override @Deprecated public boolean addCrackingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) { - //if ((aInput == null) || (aOutput == null)) { - // return false; - // } - // if ((aDuration = GregTech_API.sRecipeFile.get("cracking", aInput.getUnlocalizedName(), aDuration)) <= 0) { - // return false; - // } - // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); - // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, GT_ModHandler.getSteam(aInput.amount)}, new FluidStack[]{aOutput, Materials.Hydrogen.getGas(aInput.amount)}, aDuration, aEUt, 0); - // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, Materials.Hydrogen.getGas(aInput.amount)}, new FluidStack[]{new FluidStack(aOutput.getFluid(), (int) (aOutput.amount * 1.3))}, aDuration, aEUt, 0); - // return true; return false; } @@ -1339,7 +1299,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { for (int oreID : OreDictionary.getOreIDs(aInputs[i])) { String odName = OreDictionary.getOreName(oreID); if (odName.contains("circuit")) { - for (ItemStack tStack : GT_OreDictUnificator.getOres(odName)) { + for (ItemStack tStack : GT_OreDictUnificator.getOresImmutable(odName)) { if (!GT_Utility.isStackValid(tStack)) continue; aInputs[i] = new ItemStack(tStack.getItem(),aInputs[i].stackSize,tStack.getItemDamage()); |