diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders')
3 files changed, 47 insertions, 38 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java index ce4a6c629a..fbf61598d3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java @@ -31,7 +31,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { return isValid; } public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid) { - this(aExtracting, aEmpty, aFull, aFluid, null, null, null); + this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, null, null); } public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, FluidStack aFluidOut) { @@ -39,7 +39,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { } public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid, Integer aDuration, Integer aEUt) { - this(aExtracting, aEmpty, aFull, aFluid, null, aDuration, aEUt); + this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, aDuration, aEUt); } // Alternative Constructor @@ -68,7 +68,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { if (aExtracting) { aInput = aFull; aOutput = aEmpty; - aFluidInput = null; + aFluidInput = GT_Values.NF; aFluidOutput = aFluidIn; } else { @@ -93,23 +93,34 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { 0); - // Not Valid - if ((aExtracting && (aInput == null || aOutput == null ||(aFluidInput == null && aFluidOutput == null))) || (!aExtracting && (aInput == null || aOutput == null || (aFluidInput == null && aFluidOutput == null)))) { - isValid = false; - disableOptional = aExtracting; - recipe = null; + // Check Valid + boolean aTempValidityCheck = false; + if (aExtracting) { + if (aInput != null && aFluidOutput != null) { + aTempValidityCheck = true; + } } else { + if (aInput != null && aOutput != null && (aFluidInput != null || aFluidOutput != null)) { + aTempValidityCheck = true; + } + } + + + if (aTempValidityCheck) { // Valid Recipe recipe = aRecipe; mRecipeGenMap.add(this); disableOptional = aExtracting; - isValid = true; + isValid = true; + } + else { + isValid = false; + disableOptional = aExtracting; + aRecipe.mEnabled = false; + aRecipe.mHidden = true; + recipe = null; } - - - - } @Override @@ -129,25 +140,23 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { } private final boolean addFluidExtractionRecipe(GT_Recipe aRecipe) { - if (aRecipe != null) { - if ((aRecipe.mDuration = GregTech_API.sRecipeFile.get("fluidextractor", aRecipe.mInputs[0], aRecipe.mDuration)) <= 0) { - return false; - } else { - GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe); - return true; - } + if (aRecipe != null) { + int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); + int aCount2 = aCount1; + GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe); + aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); + return aCount1 > aCount2; } return false; } private final boolean addFluidCannerRecipe(GT_Recipe recipe2) { - if (recipe2 != null) { - if ((recipe2.mDuration = GregTech_API.sRecipeFile.get("fluidcanner", recipe2.mOutputs[0], recipe2.mDuration)) <= 0) { - return false; - } else { - GT_Recipe_Map.sFluidCannerRecipes.addRecipe(recipe2); - return true; - } + if (recipe2 != null) { + int aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size(); + int aCount2 = aCount1; + GT_Recipe_Map.sFluidCannerRecipes.addRecipe(recipe2); + aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size(); + return aCount1 > aCount2; } return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java index 799c6cd63b..2b4e52abb9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java @@ -48,8 +48,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Ingot if (ItemUtils.checkForInvalidItems(material.getIngot(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getIngot(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getIngot(1), // Input material.getFluid(144), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick @@ -63,8 +63,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Plate if (ItemUtils.checkForInvalidItems(material.getPlate(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getPlate(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getPlate(1), // Input material.getFluid(144), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick @@ -78,8 +78,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Double Plate if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getPlateDouble(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getPlateDouble(1), // Input material.getFluid(288), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick @@ -93,8 +93,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Nugget if (ItemUtils.checkForInvalidItems(material.getNugget(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getNugget(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getNugget(1), // Input material.getFluid(16), // Fluid Output 16, // Duration material.vVoltageMultiplier // Eu Tick @@ -108,8 +108,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Block if (ItemUtils.checkForInvalidItems(material.getBlock(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getBlock(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getBlock(1), // Input material.getFluid(144 * 9), // Fluid Output 288, // Duration material.vVoltageMultiplier // Eu Tick diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java index 58db8a473f..84188a44aa 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -137,7 +137,7 @@ public class RecipeGen_Recycling implements Runnable { //Fluid Extractor if (ItemUtils.checkForInvalidItems(tempStack)) { // mValidItems[mSlotIndex++] = tempStack; - if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, null, material.getFluid(mFluidAmount), 30, material.vVoltageMultiplier)) { + if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluid(mFluidAmount), 30, material.vVoltageMultiplier)) { Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " + tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluid(1).getLocalizedName()+"."); } |