aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-02-05 19:28:32 +0900
committerGitHub <noreply@github.com>2023-02-05 11:28:32 +0100
commit93d1e6e1351937b1a328b537e3cdc3446b351cc3 (patch)
tree0da501ced2dfe9e2561e5cf9e4e0bb339211967d
parentbb9da48b9975cb27e3b7c538bff2853a34b36fcd (diff)
downloadGT5-Unofficial-93d1e6e1351937b1a328b537e3cdc3446b351cc3.tar.gz
GT5-Unofficial-93d1e6e1351937b1a328b537e3cdc3446b351cc3.tar.bz2
GT5-Unofficial-93d1e6e1351937b1a328b537e3cdc3446b351cc3.zip
Cleanup recipe adder (#530)
* Cleanup recipe adder * Remove redundant public * consistent returns
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java21
-rw-r--r--src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java138
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java315
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java1026
4 files changed, 212 insertions, 1288 deletions
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index 3bf145f0b3..6912d3508e 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -315,24 +315,6 @@ public class RECIPES_GREGTECH {
}
private static void fusionRecipes() {
-
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInput1 = first Input (not null, and respects StackSize)
- * @param aInput2 = second Input (not null, and respects StackSize)
- * @param aOutput = Output of the Fusion (can be null, and respects StackSize)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aFusionEnergyPerTick = The EU generated per Tick (can even be negative!)
- * @param aEnergyNeededForStartingFusion = EU needed for heating the Reactor up (must be >= 0)
- */
-
- // Hydrogen Plasma
- /*
- * CORE.RA.addFusionReactorRecipe( Particle.getIon("Hydrogen", 0), Particle.getIon("Hydrogen", 0),
- * Materials.Hydrogen.getPlasma(1), 5000, 16, 4096, 40000000);
- */
-
// Hypogen Creation
GT_Values.RA.addFusionReactorRecipe(
ELEMENT.STANDALONE.DRAGON_METAL.getFluidStack(144),
@@ -1476,12 +1458,9 @@ public class RECIPES_GREGTECH {
ThermalFuel.addSteamTurbineFuel(FluidUtils.getFluidStack("steam", 1024));
- // CORE.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel",
- // 0, 1), null, 112, 0);
GT_Values.RA.addFuel(ItemUtils.getSimpleStack(Items.lava_bucket), null, 32, 2);
GT_Values.RA.addFuel(ItemUtils.getIC2Cell(2), null, 32, 2);
GT_Values.RA.addFuel(ItemUtils.getIC2Cell(11), null, 24, 2);
- // System.exit(1);
}
private static void extractorRecipes() {
diff --git a/src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java b/src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
index 3bd507fb38..d08f98259d 100644
--- a/src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
+++ b/src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
@@ -1,18 +1,13 @@
package gtPlusPlus.core.util.reflect;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import gregtech.api.enums.GT_Values;
-import gregtech.api.interfaces.internal.IGT_RecipeAdder;
import gregtech.api.util.GT_Recipe;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
public final class AddGregtechRecipe {
@@ -73,139 +68,8 @@ public final class AddGregtechRecipe {
int TIME = timeInSeconds * 20;
int TIMEPYRO = TIME + (TIME / 5);
// Even though it says coke and pyrolyse, ICO recipes are imported from pyrolyse by #importPyroRecipe
- PyrolyseOven(input1, inputFluid1, circuitNumber, output1, outputFluid1, TIMEPYRO, euTick);
-
- return false;
- }
-
- public static boolean PyrolyseOven(final ItemStack p0, final FluidStack p1, final int p2, final ItemStack p3,
- final FluidStack p4, final int p5, final int p6) {
-
- try {
- IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
- if (IGT_RecipeAdder != null) {
- Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
- Method addRecipe = classRA.getMethod(
- "addPyrolyseRecipe",
- ItemStack.class,
- FluidStack.class,
- int.class,
- ItemStack.class,
- FluidStack.class,
- int.class,
- int.class);
- if (addRecipe != null) {
- return (boolean) addRecipe.invoke(IGT_RecipeAdder, p0, p1, p2, p3, p4, p5, p6);
- }
- }
- } catch (SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- return false;
- }
- return false;
- }
-
- public static boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs,
- FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) {
- /*
- * try { IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA; if (IGT_RecipeAdder != null){ Class<? extends
- * IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass(); for(Method current : classRA.getDeclaredMethods()){
- * //Utils.LOG_INFO("-----------------------------------------------");
- * ////Utils.LOG_INFO("Found method: "+current.getName()); //Utils.LOG_INFO("With Parameters: ");
- * //Utils.LOG_INFO("==============================================="); for (Class<?> P :
- * current.getParameterTypes()){ //Utils.LOG_INFO(""+P.getName()); //Utils.LOG_INFO(""+P.getClass().getName());
- * } //Utils.LOG_INFO("==============================================="); } try { Method testRA =
- * GT_Values.RA.getClass().getMethod("addAssemblylineRecipe", GT_Values.RA.getClass(), aResearchItem.getClass(),
- * int.class, aInputs.getClass(), aFluidInputs.getClass(), aOutput.getClass(), int.class, int.class);
- * testRA.invoke(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt); } catch
- * (Throwable masndj){ masndj.printStackTrace(); } Method addRecipe = classRA.getDeclaredMethod(
- * "addAssemblylineRecipe", ItemStack.class, int.class, ItemStack.class, FluidStack.class, ItemStack.class,
- * int.class, int.class); if (addRecipe != null){ return (boolean) addRecipe.invoke(aResearchItem,
- * aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt); } } } catch (SecurityException |
- * NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- * Utils.LOG_INFO("[Assembly Line] - Failed to add recipe, due to GT not being .09 branch. Research: "
- * +aResearchItem.getDisplayName()+" | Result: "+aOutput.getDisplayName()); e.printStackTrace(); return false; }
- * Utils.LOG_INFO("[Assembly Line] - Failed to add recipe. Research: "+aResearchItem.getDisplayName()
- * +" | Result: "+aOutput.getDisplayName());
- */ return false;
- }
-
- public static boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput,
- int aDuration, int aEUt) {
- try {
- IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
- if (IGT_RecipeAdder != null) {
- Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
- Method addRecipe = classRA.getMethod(
- "addCircuitAssemblerRecipe",
- ItemStack.class,
- FluidStack.class,
- ItemStack.class,
- int.class,
- int.class);
- if (addRecipe != null) {
- if (aFluidInput.isFluidEqual(FluidUtils.getFluidStack("molten.tin", 1))) {
- boolean[] didAdd = new boolean[3];
- FluidStack moltenMetal = FluidUtils.getFluidStack("molten.tin", 144);
- // Tin
- didAdd[0] = (boolean) addRecipe
- .invoke(IGT_RecipeAdder, aInputs, moltenMetal, aOutput, aDuration, aEUt);
- moltenMetal = FluidUtils.getFluidStack("molten.lead", 144);
- // Lead
- didAdd[1] = (boolean) addRecipe
- .invoke(IGT_RecipeAdder, aInputs, moltenMetal, aOutput, aDuration, aEUt);
- moltenMetal = FluidUtils.getFluidStack("molten.solderingalloy", 144 / 2);
- // Soldering Alloy
- didAdd[2] = (boolean) addRecipe
- .invoke(IGT_RecipeAdder, aInputs, moltenMetal, aOutput, aDuration, aEUt);
+ GT_Values.RA.addPyrolyseRecipe(input1, inputFluid1, circuitNumber, output1, outputFluid1, TIMEPYRO, euTick);
- if (didAdd[0] && didAdd[1] && didAdd[2]) {
- return true;
- } else {
- return false;
- }
- } else {
- return (boolean) addRecipe
- .invoke(IGT_RecipeAdder, aInputs, aFluidInput, aOutput, aDuration, aEUt);
- }
- }
- }
- } catch (SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- return false;
- }
return false;
}
-
- public static boolean addChemicalRecipeForBasicMachineOnly(final ItemStack p0, final ItemStack p1,
- final FluidStack p2, final FluidStack p3, final ItemStack p4, final ItemStack p5, final int p6,
- final int p7) {
-
- try {
- IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
- if (IGT_RecipeAdder != null) {
- Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
- // final ItemStack p0, final ItemStack p1, final FluidStack p2, final FluidStack p3, final ItemStack
- // p4, final ItemStack p5, final int p6, final int p7
- Method addRecipe = classRA.getMethod(
- "addChemicalRecipeForBasicMachineOnly",
- ItemStack.class,
- ItemStack.class,
- FluidStack.class,
- FluidStack.class,
- ItemStack.class,
- ItemStack.class,
- int.class,
- int.class);
- if (addRecipe != null) {
- return (boolean) addRecipe.invoke(IGT_RecipeAdder, p0, p1, p2, p3, p4, p5, p6, p7);
- }
- }
- } catch (SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
-
- }
-
- return GT_Values.RA.addChemicalRecipe(p0, p1, p2, p3, p4, p6);
- }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
index 094e151fc8..680206596b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -6,13 +6,14 @@ import net.minecraftforge.fluids.FluidStack;
import gregtech.api.enums.Materials;
import gtPlusPlus.core.material.Material;
+@SuppressWarnings("UnusedReturnValue")
public interface IGregtech_RecipeAdder {
/**
* Adds a Coke Oven Recipe
*
* @param aInput1 = first Input (not null, and respects StackSize)
- * @param aInputb = second Input (can be null, and respects StackSize)
+ * @param aInput2 = second Input (can be null, and respects StackSize)
* @param aFluidOutput = Output of the Creosote (not null, and respects StackSize)
* @param aFluidInput = fluid Input (can be null, and respects StackSize)
* @param aOutput = Output of the Coal/coke (can be null, and respects StackSize)
@@ -20,19 +21,15 @@ public interface IGregtech_RecipeAdder {
* @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- // public boolean addCokeOvenRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial,
- // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue);
- public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput,
- FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt);
+ boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput,
+ ItemStack aOutput, int aDuration, int aEUt);
- public boolean addCokeOvenRecipe(int aCircuit, ItemStack aInput2, FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt);
+ boolean addCokeOvenRecipe(int aCircuit, ItemStack aInput2, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs, int aDuration, int aEUt);
- public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack[] aFluidInputs,
+ boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack[] aFluidInputs,
FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt);
- public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType);
-
/**
* Adds a Matter Fabricator Recipe
*
@@ -42,43 +39,7 @@ public interface IGregtech_RecipeAdder {
* @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
-
- /**
- * Adds a Matter Fabricator Recipe
- *
- * @param aItemInput = ItemStack Input, can be null I assume.
- * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
- public boolean addMatterFabricatorRecipe(ItemStack aItemInput, FluidStack aFluidInput, FluidStack aFluidOutput,
- int aDuration, int aEUt);
-
- /**
- * Adds a Recipe for the Dehydrator. (up to 9 Outputs)
- *
- * @param aInput = Input itemstack (not null, and respects StackSize)
- * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aOutputItems = Itemstack[] (not null, and respects StackSize)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
-
- // public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration,
- // int aEUt);
- /*
- * public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, 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);
- */
+ boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
/**
* Adds a Recipe for the Dehydrator. (up to 9 Outputs)
@@ -92,68 +53,68 @@ public interface IGregtech_RecipeAdder {
* @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput,
+ boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput,
ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt);
/**
* Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
*
- * @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
- * @param aChances = Output Chance (can be == 0)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU per tick needed for heating up (must be >= 0)
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aOutput = Output of the Molten Metal (not null, and respects StackSize)
+ * @param aChance = Output Chance (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU per tick needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt);
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt);
/**
* Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
*
- * @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
- * @param aChances = Output Chance (can be == 0)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU per tick needed for heating up (must be >= 0)
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aInputFluid = Input of a fluid (can be null, and respects StackSize)
+ * @param aOutput = Output of the Molten Metal (not null, and respects StackSize)
+ * @param aChance = Output Chance (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU per tick needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance,
int aDuration, int aEUt);
/**
* Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs, More than 1 Fluids)
*
- * @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = FluidStack[] (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
- * @param aChances = Output Chance (can be == 0)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU per tick needed for heating up (must be >= 0)
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aInputFluid = FluidStack[] (can be null, and respects StackSize)
+ * @param aOutput = Output of the Molten Metal (not null, and respects StackSize)
+ * @param aChance = Output Chance (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU per tick needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, int aChance,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, int aChance,
int aDuration, int aEUt);
/**
* Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
*
* @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
+ * @param aInputFluid = Input of a fluid (can be null, and respects StackSize)
+ * @param aOutput = Output of the Molten Metal (not null, and respects StackSize)
* @param aOutputStack = Item Output (Can be null)
- * @param aChances = Output Chance (can be == 0)
+ * @param aChance = Output Chance (can be == 0)
* @param aDuration = Duration (must be >= 0)
* @param aEUt = EU per tick needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput,
ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt);
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance,
int aDuration, int aEUt, int aSpecialValue);
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput,
ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue,
boolean aOptimizeRecipe);
@@ -161,21 +122,21 @@ public interface IGregtech_RecipeAdder {
* Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs, More than 1 fluids)
*
* @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = FluidStack[] (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
+ * @param aInputFluid = FluidStack[] (can be null, and respects StackSize)
+ * @param aOutput = Output of the Molten Metal (not null, and respects StackSize)
* @param aOutputStack = Item Output (Can be null)
- * @param aChances = Output Chance (can be == 0)
+ * @param aChance = Output Chance (can be == 0)
* @param aDuration = Duration (must be >= 0)
* @param aEUt = EU per tick needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput,
ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt);
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, int aChance,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, int aChance,
int aDuration, int aEUt, int aSpecialValue);
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput,
ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue,
boolean aOptimizeRecipe);
@@ -183,16 +144,16 @@ public interface IGregtech_RecipeAdder {
* Adds a Recipe for the LFTRr. (up to 9 Inputs)
*
* @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Salts (not null, and respects StackSize)
+ * @param aInputFluid = Input of a fluid (can be null, and respects StackSize)
+ * @param aOutput = Output of the Molten Salts (not null, and respects StackSize)
* @param aOutputStack = Item Output (Can be null)
- * @param aChances = Output Chance (can be == 0)
+ * @param aChance = Output Chance (can be == 0)
* @param aDuration = Duration (must be >= 0)
* @param aEUt = EU per tick needed for heating up (must be >= 0)
* @param aSpecialValue = Power produced in EU/t per dynamo
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput,
ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue);
/**
@@ -200,32 +161,25 @@ public interface IGregtech_RecipeAdder {
*
*
**/
- public boolean addQuantumTransformerRecipe(ItemStack[] aInput, FluidStack[] aFluidInput, FluidStack[] aFluidOutput,
+ boolean addQuantumTransformerRecipe(ItemStack[] aInput, FluidStack[] aFluidInput, FluidStack[] aFluidOutput,
ItemStack[] aOutputStack, int[] aChances, int aDuration, int aEUt, int aSpecialValue);
/**
* Adds a Recipe for the LFTRr. (up to 9 Inputs, More than 1 fluids)
*
* @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = FluidStack[] (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Salts (not null, and respects StackSize)
+ * @param aInputFluid = FluidStack[] (can be null, and respects StackSize)
+ * @param aOutput = Output of the Molten Salts (not null, and respects StackSize)
* @param aOutputStack = Item Output (Can be null)
- * @param aChances = Output Chance (can be == 0)
+ * @param aChance = Output Chance (can be == 0)
* @param aDuration = Duration (must be >= 0)
* @param aEUt = EU per tick needed for heating up (must be >= 0)
* @param aSpecialValue = Power produced in EU/t per dynamo
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput,
+ boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput,
ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue);
- public boolean addLFTRRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt);
-
- public boolean addLFTRRecipe(ItemStack aInput1, FluidStack aInput2, ItemStack aOutput1, FluidStack aOutput2,
- int aDuration, int aEUt);
-
- public boolean addLFTRRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt);
-
/**
* Adds a custom Semifluid fuel for the GT++ SemiFluid Generators.
*
@@ -233,7 +187,7 @@ public interface IGregtech_RecipeAdder {
* @param aFuelValue - Fuel value in thousands (1 = 1000)
* @return - Was the Fuel added?
*/
- public boolean addSemifluidFuel(FluidStack aFuelItem, int aFuelValue);
+ boolean addSemifluidFuel(FluidStack aFuelItem, int aFuelValue);
/**
* Adds a custom Semifluid fuel for the GT++ SemiFluid Generators.
@@ -242,23 +196,23 @@ public interface IGregtech_RecipeAdder {
* @param aFuelValue - Fuel value in thousands (1 = 1000)
* @return - Was the Fuel added?
*/
- public boolean addSemifluidFuel(ItemStack aFuelItem, int aFuelValue);
+ boolean addSemifluidFuel(ItemStack aFuelItem, int aFuelValue);
- public boolean addFissionFuel(FluidStack aInput1, FluidStack aInput2, FluidStack aInput3, FluidStack aInput4,
+ boolean addFissionFuel(FluidStack aInput1, FluidStack aInput2, FluidStack aInput3, FluidStack aInput4,
FluidStack aInput5, FluidStack aInput6, FluidStack aInput7, FluidStack aInput8, FluidStack aInput9,
FluidStack aOutput1, FluidStack aOutput2, int aDuration, int aEUt);
- public boolean addFissionFuel(boolean aOptimise, FluidStack aInput1, FluidStack aInput2, FluidStack aInput3,
+ boolean addFissionFuel(boolean aOptimise, FluidStack aInput1, FluidStack aInput2, FluidStack aInput3,
FluidStack aInput4, FluidStack aInput5, FluidStack aInput6, FluidStack aInput7, FluidStack aInput8,
FluidStack aInput9, FluidStack aOutput1, FluidStack aOutput2, int aDuration, int aEUt);
- public boolean addCyclotronRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs,
- FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt, int aSpecialValue);
+ boolean addCyclotronRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidOutput,
+ int[] aChances, int aDuration, int aEUt, int aSpecialValue);
boolean addCyclotronRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack[] aOutput,
FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt, int aSpecialValue);
- public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4,
+ boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4,
FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3,
ItemStack aOutput4, int aDuration, int aEUt);
@@ -272,37 +226,31 @@ public interface IGregtech_RecipeAdder {
* @param aEUt = EU per tick needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1,
- int aDuration, int aEUt);
-
- public boolean addMultiblockCentrifugeRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial);
-
- public boolean addMultiblockElectrolyzerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial);
+ boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration,
+ int aEUt);
- public boolean addAdvancedFreezerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs,
+ boolean addMultiblockCentrifugeRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs,
ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial);
- public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2,
- ItemStack aOutput, int a1, int a2);
+ boolean addMultiblockElectrolyzerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial);
- public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2,
- FluidStack aInputFluid, ItemStack aOutput, int a1, int a2);
+ boolean addAdvancedFreezerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial);
- public boolean addSixSlotAssemblingRecipe(ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1,
- int aDuration, int aEUt);
+ boolean addSixSlotAssemblingRecipe(ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1, int aDuration,
+ int aEUt);
/**
* Adds an Assemblyline Recipe
*
* @param aInputs must be != null, 4-16 inputs
* @param aFluidInputs 0-4 fluids
- * @param aOutput1 must be != null
+ * @param aOutput must be != null
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
- public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs,
+ boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs,
FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt);
/**
@@ -314,145 +262,98 @@ public interface IGregtech_RecipeAdder {
boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs,
FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt);
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid,
+ boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid,
ItemStack output, int time, int eu);
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid,
+ boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid,
ItemStack output, Object object, int time, int eu);
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid,
+ boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid,
ItemStack output, ItemStack object, int time);
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, int aCircuit, FluidStack inputFluid,
+ boolean addChemicalRecipe(ItemStack input1, ItemStack input2, int aCircuit, FluidStack inputFluid,
FluidStack outputFluid, ItemStack output, ItemStack output2, int time, int eu);
- public boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks,
- FluidStack[] fluidStacks2, ItemStack[] outputs, int time, int eu);
+ boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks, FluidStack[] fluidStacks2,
+ ItemStack[] outputs, int time, int eu);
- public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt);
+ boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt);
- public boolean addBrewingRecipe(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu,
+ boolean addBrewingRecipe(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu,
boolean aHidden);
- public boolean addBrewingRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu,
- boolean aHidden);
+ boolean addBrewingRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden);
- public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput);
+ boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput);
- public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu);
+ boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu);
- public boolean addFluidExtractionRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut,
- int aTime, int aEu);
+ boolean addFluidExtractionRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut, int aTime,
+ int aEu);
- public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn);
+ boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn);
- public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn,
+ boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn,
FluidStack rFluidOut);
- public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn,
+ boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn,
FluidStack rFluidOut, int aTime, int aEu);
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInput1 = first Input (not null, and respects StackSize)
- * @param aInput2 = second Input (not null, and respects StackSize)
- * @param plasma = Output of the Fusion (can be null, and respects StackSize)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aEu = The EU generated per Tick (can even be negative!)
- * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma,
- int aFusionDurationInTicks, int aEu, int aSpecial);
-
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInput1 = first Input (not null, and respects StackSize)
- * @param aInput2 = second Input (not null, and respects StackSize)
- * @param plasma = Output of the Fusion (can be null, and respects StackSize)
- * @param aOutputChance = chance to output plasma (can be 0)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aEu = The EU generated per Tick (can even be negative!)
- * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- public boolean addFusionReactorRecipe(FluidStack aInputStackA, FluidStack aInputStackB, FluidStack plasma,
- int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial);
-
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInput1 = first Input (not null, and respects StackSize)
- * @param aInput2 = second Input (not null, and respects StackSize)
- * @param plasma = Output of the Fusion (can be null, and respects StackSize)
- * @param aOutputChance = chance to output plasma (can be 0)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aEu = The EU generated per Tick (can even be negative!)
- * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma,
- int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial);
-
- public boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput,
+ boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput,
FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel);
- public boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs,
+ boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs,
FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aLevel);
- public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu);
+ boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu);
- public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu);
-
- public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs,
+ boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs,
FluidStack[] aFluidOutputs, int time, long eu, int aTier);
- public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs,
+ boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs,
FluidStack[] aFluidOutputs, int[] aChances, int time, long eu, int aTier);
- public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs,
+ boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs,
FluidStack[] aFluidOutputs, int time, long eu, int aHeat);
- public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput,
+ boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput,
FluidStack aFluidOutput, int aDuration, int aEUt);
- public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt);
+ boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt);
- public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aChance, int aDuration, int aEUt);
+ boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aChance, int aDuration, int aEUt);
- public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput,
- ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden);
+ boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput,
+ int aDuration, int aEUt, boolean aHidden);
- public boolean addPulverisationRecipe(final ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
+ boolean addPulverisationRecipe(final ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
final ItemStack aOutput3);
- public boolean addMillingRecipe(Materials aMat, int aEU);
+ boolean addMillingRecipe(Materials aMat, int aEU);
- public boolean addMillingRecipe(Material aMat, int aEU);
+ boolean addMillingRecipe(Material aMat, int aEU);
- public boolean addFlotationRecipe(Materials aMat, ItemStack aXanthate, FluidStack[] aInputFluids,
+ boolean addFlotationRecipe(Materials aMat, ItemStack aXanthate, FluidStack[] aInputFluids,
FluidStack[] aOutputFluids, int aTime, int aEU);
- public boolean addFlotationRecipe(Material aMat, ItemStack aXanthate, FluidStack[] aInputFluids,
+ boolean addFlotationRecipe(Material aMat, ItemStack aXanthate, FluidStack[] aInputFluids,
FluidStack[] aOutputFluids, int aTime, int aEU);
- public boolean addpackagerRecipe(ItemStack aRecipeType, ItemStack aInput1, ItemStack aInput2,
- ItemStack aOutputStack1);
+ boolean addpackagerRecipe(ItemStack aRecipeType, ItemStack aInput1, ItemStack aInput2, ItemStack aOutputStack1);
- public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage);
+ boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage);
- public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs,
+ boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs,
int[] aChances, FluidStack aFluidOutput, int aTime, int aEU);
- public boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput,
+ boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput,
ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU);
- public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration,
- int aEUt);
+ boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt);
- public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU);
+ boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU);
- public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU);
+ boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU);
- public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU,
- int aAmps);
+ boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU, int aAmps);
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
index 6620813386..45a0c27bc9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -4,31 +4,26 @@ import static gregtech.api.enums.GT_Values.RA;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.oredict.OreDictionary;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
-import gregtech.api.interfaces.internal.IGT_RecipeAdder;
import gregtech.api.util.*;
import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.data.ArrayUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG;
@@ -42,112 +37,32 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addCokeOvenRecipe(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
final FluidStack aFluidOutput, final ItemStack aOutput, int aDuration, final int aEUt) {
- try {
- try {
- // RECIPEHANDLER_CokeOven.debug1();
- if (((aInput1 == null) /* && (aFluidInput == null) */)
- || ((aOutput == null) || (aFluidOutput == null))) {
- // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+"
- // aInput2:"+aInput2.toString()+"
- // aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Something was null, returning false");
- return false;
- }
-
- } catch (final NullPointerException e) {
- e.getStackTrace();
- }
- try {
- // RECIPEHANDLER_CokeOven.debug2(aInput1, aInput2, aFluidInput,
- // aFluidOutput, aOutput, aDuration, aEUt);
- if ((aOutput != null)
- && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) {
- // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+"
- // aInput2:"+aInput2.toString()+"
- // aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Something was null, returning false");
- return false;
- }
-
- } catch (final NullPointerException e) {
- e.getStackTrace();
- }
- try {
- // RECIPEHANDLER_CokeOven.debug3(aInput1, aInput2, aFluidInput,
- // aFluidOutput, aOutput, aDuration, aEUt);
- if ((aFluidOutput == null) || ((aDuration = GregTech_API.sRecipeFile
- .get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
- // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+"
- // aInput2:"+aInput2.toString()+"
- // aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Something was null, returning false");
- return false;
- }
-
- } catch (final NullPointerException e) {
- e.getStackTrace();
- }
- try {
-
- GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
- true,
- new ItemStack[] { aInput1, aInput2 },
- new ItemStack[] { aOutput },
- null,
- new int[] {},
- new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput },
- Math.max(1, aDuration),
- Math.max(1, aEUt),
- 0);
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size();
- int aSize2 = aSize;
- GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.add(aSpecialRecipe);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size();
-
- // RECIPEHANDLER_CokeOven.debug4(aInput1, aInput2, aFluidInput,
- // aFluidOutput, aOutput, aDuration, aEUt);
- /*
- * if (aFluidInput == null && aInput2 != null) {
- * GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 },
- * new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, aEUt,
- * 0); } else if (aFluidInput == null && aInput2 == null) {
- * GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1 }, new
- * ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); }
- * else { GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1,
- * aInput2 }, new ItemStack[] { aOutput }, null, null, new FluidStack[] { aFluidInput }, new
- * FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); }
- */
- // RECIPEHANDLER_CokeOven.debug5(aInput1, aInput2, aFluidInput,
- // aFluidOutput, aOutput, aDuration, aEUt);
-
- return aSize > aSize2;
-
- } catch (final NullPointerException e) {
- Logger.WARNING("Something was null, returning false");
- return false;
- }
- } catch (final Throwable e) {
- // Logger.WARNING("aInput1:"+aInput1.toString()+"
- // aInput2:"+aInput2.toString()+"
- // aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Failed.");
- e.getStackTrace();
+ if (aInput1 == null || (aOutput == null || aFluidOutput == null)) {
+ Logger.WARNING("Something was null, returning false");
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0) {
+ Logger.WARNING("Something was null, returning false");
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0) {
+ Logger.WARNING("Something was null, returning false");
return false;
}
+
+ GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
+ true,
+ new ItemStack[] { aInput1, aInput2 },
+ new ItemStack[] { aOutput },
+ null,
+ new int[] {},
+ new FluidStack[] { aFluidInput },
+ new FluidStack[] { aFluidOutput },
+ aDuration,
+ Math.max(1, aEUt),
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.add(aSpecialRecipe);
+ return true;
}
@Override
@@ -177,241 +92,55 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
Math.max(1, aDuration),
Math.max(1, aEUt),
0);
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size();
GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.add(aSpecialRecipe);
- return GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size() > aSize;
+ return true;
}
@Override
public boolean addMatterFabricatorRecipe(final FluidStack aFluidInput, final FluidStack aFluidOutput,
final int aDuration, final int aEUt) {
- try {
- try {
- // RECIPEHANDLER_MatterFabricator.debug1();
- if (aFluidOutput == null) {
- // Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Something was null, returning false");
- return false;
- }
-
- } catch (final NullPointerException e) {
- e.getStackTrace();
- }
- try {
-
- // RECIPEHANDLER_MatterFabricator.debug4(aFluidInput,
- // aFluidOutput, aDuration, aEUt);
- if (aFluidInput == null) {
- // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true,
- // null, new FluidStack[]{aFluidOutput}, aDuration, aEUt,
- // 0);
-
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {},
- new FluidStack[] { aFluidOutput },
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
- } else {
- // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true,
- // new FluidStack[]{aFluidInput}, new
- // FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput },
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
- }
- RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
-
- return true;
-
- } catch (final NullPointerException e) {
- return false;
- }
- } catch (final Throwable e) {
- // Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Failed.");
- e.getStackTrace();
- return false;
- }
- }
-
- @Override
- public boolean addMatterFabricatorRecipe(final ItemStack aInputStack, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final int aDuration, final int aEUt) {
- try {
- try {
- if ((aFluidOutput == null) || (aInputStack == null)) {
- return false;
- }
- } catch (final NullPointerException e) {}
- try {
- if (aFluidInput == null) {
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] { aInputStack },
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {},
- new FluidStack[] { aFluidOutput },
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
- } else {
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] { aInputStack },
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput },
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
- }
- RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
- return true;
- } catch (final NullPointerException e) {
- return false;
- }
- } catch (final Throwable e) {
- return false;
- }
- }
-
- @Override
- public boolean addFuel(final ItemStack aInput1, final ItemStack aOutput1, final int aEU, final int aType) {
- if (aInput1 == null) {
- Logger.WARNING("Fuel Input is Invalid.");
+ if (aFluidOutput == null) {
+ Logger.WARNING("Something was null, returning false");
return false;
}
- // new GregtechRecipe(aInput1, aOutput1,
- // GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ aFluidInput == null ? new FluidStack[] {} : new FluidStack[] { aFluidInput },
+ new FluidStack[] { aFluidOutput },
+ aDuration,
+ aEUt,
+ 0);
+ GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
+ RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
return true;
}
- /*
- * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[]
- * aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt) { if ((aItemA == null) || (aItemB == null) ||
- * (aOutputItems == null)) { return false; } for (ItemStack tStack : aOutputItems) { if (tStack != null) { if
- * ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) { return false; }
- * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB},
- * aOutputItems, null, null, null, aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, aFluid,
- * aOutputFluid, aOutputItems, aDuration, aEUt); return true; } } return false; }
- * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int
- * aDuration, int aEUt) { if ((aItemA == null) || (aItemB == null) || (aOutputItems == null)) { return false; } if
- * ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) { return false; }
- * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB},
- * aOutputItems, null, null, null, aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, null, null,
- * aOutputItems, aDuration, aEUt); return true; }
- * @Override public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[]
- * aOutputItems, int aDuration, int aEUt){ if ((aFluid == null) || (aOutputFluid == null || aOutputItems == null)) {
- * return false; } if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluid.getUnlocalizedName(),
- * aDuration)) <= 0) { return false; } Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
- * null, aOutputItems, null, new FluidStack[]{aFluid}, new FluidStack[]{aOutputFluid}, aDuration, aEUt, 0);
- * RECIPEHANDLER_Dehydrator.debug5(null, null, aFluid, aOutputFluid, aOutputItems, aDuration, aEUt); return true; }
- */
-
- /*
- * @Override public boolean addDehydratorRecipe(final ItemStack aInput, final FluidStack aFluid, final ItemStack[]
- * aOutput, int aDuration, final int aEUt) { Logger.WARNING("Trying to add a Dehydrator recipe."); try { if ((aInput
- * == null) || (aFluid == null) || (aOutput == null)) { return false; } if ((aDuration =
- * GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) { return false; } GTPP_Recipe aRecipe = new
- * GTPP_Recipe( false, new ItemStack[] { aInput }, aOutput, null, new int[] {}, new FluidStack[] { aFluid }, new
- * FluidStack[] {}, aDuration, aEUt, 0); GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(aRecipe);
- * // RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, // aOutput, aDuration, aEUt); return true; } catch
- * (final NullPointerException e) { Logger.WARNING("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); return false;
- * } }
- */
-
@Override
public boolean addDehydratorRecipe(final ItemStack[] aInput, final FluidStack aFluidInput,
final FluidStack aFluidOutput, final ItemStack[] aOutputItems, final int[] aChances, int aDuration,
final int aEUt) throws IndexOutOfBoundsException {
- Logger.WARNING("Trying to add a Dehydrator recipe.");
- try {
- if (aInput != null && aInput.length > 0) {
- if (aInput[0] != null) {
- Logger.WARNING("Recipe requires input: " + aInput[0].getDisplayName() + " x" + aInput[0].stackSize);
- }
- if (aInput.length > 1) {
- if (aInput[1] != null) {
- Logger.WARNING(
- "Recipe requires input: " + aInput[1].getDisplayName() + " x" + aInput[1].stackSize);
- }
- }
- }
- if (aFluidInput != null) {
- Logger.WARNING(
- "Recipe requires input: " + aFluidInput.getFluid().getName()
- + " "
- + aFluidInput.amount
- + "mbs");
- }
- if (((aInput == null || aInput.length == 0) && (aFluidInput == null))
- || ((aOutputItems == null || aOutputItems.length == 0) && (aFluidOutput == null))) {
- return false;
- }
- if (aOutputItems != null) {
- Logger.WARNING("Recipe will output: " + ItemUtils.getArrayStackNames(aOutputItems));
- }
- if (aFluidOutput != null) {
- Logger.WARNING("Recipe will output: " + aFluidOutput.getFluid().getName());
- }
-
- GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
- true,
- aInput,
- aOutputItems,
- null,
- aChances,
- new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput },
- Math.max(1, aDuration),
- Math.max(1, aEUt),
- 0);
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.mRecipeList.size();
- int aSize2 = aSize;
- GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.add(aSpecialRecipe);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.mRecipeList.size();
-
- /*
- * if (aInput.length == 1) { Logger.WARNING("Dehydrator recipe only has a single input item.");
- * GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null,
- * aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); }
- * else { Logger.WARNING("Dehydrator recipe has two input items.");
- * GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null,
- * aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); }
- */
-
- return aSize > aSize2;
- } catch (final NullPointerException e) {
- Logger.WARNING("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
+ if (((aInput == null || aInput.length == 0) && (aFluidInput == null))
+ || ((aOutputItems == null || aOutputItems.length == 0) && (aFluidOutput == null))) {
return false;
}
+
+ GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
+ true,
+ aInput,
+ aOutputItems,
+ null,
+ aChances,
+ new FluidStack[] { aFluidInput },
+ new FluidStack[] { aFluidOutput },
+ Math.max(1, aDuration),
+ Math.max(1, aEUt),
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.add(aSpecialRecipe);
+ return true;
}
@Override
@@ -458,13 +187,13 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput,
- ItemStack[] aOutputStack, final int aChance[], int aDuration, final int aEUt) {
+ ItemStack[] aOutputStack, final int[] aChance, int aDuration, final int aEUt) {
return addBlastSmelterRecipe(aInput, aInputFluid, aOutput, aOutputStack, aChance, aDuration, aEUt, 3700);
}
@Override
public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput,
- ItemStack[] aOutputStack, final int aChance[], int aDuration, final int aEUt) {
+ ItemStack[] aOutputStack, final int[] aChance, int aDuration, final int aEUt) {
return addBlastSmelterRecipe(aInput, aInputFluid, aOutput, aOutputStack, aChance, aDuration, aEUt, 3700);
}
@@ -561,24 +290,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
return false;
}
- for (int das = 0; das < aInput.length; das++) {
- if (aInput[das] != null) {
- Logger.WARNING(
- "tMaterial[" + das
- + "]: "
- + aInput[das].getDisplayName()
- + ", Amount: "
- + aInput[das].stackSize);
- }
- }
-
aInput = ArrayUtils.removeNulls(aInput);
if (aInput.length <= 1) {
return false;
}
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size();
- int aSize2 = aSize;
GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(
aOptimizeRecipe,
aInput,
@@ -587,12 +303,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aChance,
aInputFluid,
new FluidStack[] { aOutput },
- Math.max(1, aDuration),
+ aDuration,
Math.max(1, aEUt),
aSpecialValue);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size();
-
- return aSize > aSize2;
+ return true;
}
@Override
@@ -601,31 +315,16 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
if (aInput == null) {
aInput = new ItemStack[0];
}
-
if (aFluidInput == null) {
aFluidInput = new FluidStack[0];
}
-
- // if (aInput.length + aFluidInput.length < 1) {
- // return false;
- // }
-
if (aOutputStack == null) {
aOutputStack = new ItemStack[0];
}
-
if (aFluidOutput == null) {
aFluidOutput = new FluidStack[0];
}
- // if (aOutputStack.length + aFluidOutput.length < 4) {
- // return false;
- // }
-
- // if (aChances == null || aChances.length != aOutputStack.length + aFluidOutput.length) {
- // return false;
- // }
-
GTPP_Recipe.GTPP_Recipe_Map.sQuantumForceTransformerRecipes.add(
new GT_Recipe(
false,
@@ -638,36 +337,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aDuration,
aEUt,
aSpecialValue));
-
- return true;
- }
-
- @Override
- public boolean addLFTRRecipe(final ItemStack aInput1, final FluidStack aInput2, final ItemStack aOutput1,
- final FluidStack aOutput2, final int aDuration, final int aEUt) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean addLFTRRecipe(final ItemStack aInput1, final ItemStack aInput2, final ItemStack aOutput1,
- final int aDuration, final int aEUt) {
- return false;
- }
-
- @Override
- public boolean addLFTRRecipe(final FluidStack aInput1, final FluidStack aInput2, final FluidStack aOutput1,
- final int aDuration, final int aEUt) {
- if ((aInput1 == null) || (aInput2 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) {
- return false;
- }
- GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(
- null,
- new FluidStack[] { aInput1, aInput2 },
- new FluidStack[] { aOutput1 },
- aDuration,
- aEUt,
- 16000);
return true;
}
@@ -698,15 +367,12 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
final FluidStack aInput3, final FluidStack aInput4, final FluidStack aInput5, final FluidStack aInput6,
final FluidStack aInput7, final FluidStack aInput8, final FluidStack aInput9, final FluidStack aOutput1,
final FluidStack aOutput2, final int aDuration, final int aEUt) {
-
if ((aInput1 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) {
return false;
}
- final FluidStack inputs[] = { aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9 };
- final FluidStack outputs[] = { aOutput1, aOutput2 };
+ final FluidStack[] inputs = { aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9 };
+ final FluidStack[] outputs = { aOutput1, aOutput2 };
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size();
- int aSize2 = aSize;
GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.addRecipe(
aOptimise,
new ItemStack[] {},
@@ -715,16 +381,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
new int[] {},
inputs,
outputs,
- Math.max(1, aDuration),
- Math.max(1, aEUt),
+ aDuration,
+ aEUt,
0);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size();
-
- if (aSize > aSize2) {
- Logger.INFO("Added Nuclear Fuel Recipe.");
- return true;
- }
- return false;
+ return true;
}
@Override
@@ -760,28 +420,18 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
Math.max(1, aDuration),
Math.max(1, aEUt),
aSpecialValue);
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.mRecipeList.size();
- int aSize2 = aSize;
GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.add(aSpecialRecipe);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.mRecipeList.size();
-
- if (aSize > aSize2) {
- Logger.INFO("Added Cyclotron Recipe.");
- return true;
- }
-
- Logger.INFO("Failed to add Cyclotron Recipe. Output: " + ItemUtils.getArrayStackNames(aOutput));
- return false;
+ return true;
}
@Override
public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4,
FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3,
ItemStack aOutput4, int aDuration, int aEUt) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) {
+ if ((aInput1 == null && aFluidInput == null) || (aOutput1 == null && aFluidOutput == null)) {
return false;
}
+
GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
true,
new ItemStack[] { aInput1, aInput2, aInput3, aInput4 },
@@ -793,10 +443,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
Math.max(1, aDuration),
Math.max(1, aEUt),
0);
-
- int aSize = GT_Recipe_Map.sMixerRecipes.mRecipeList.size();
GT_Recipe_Map.sMixerRecipes.add(aSpecialRecipe);
- return GT_Recipe_Map.sMixerRecipes.mRecipeList.size() > aSize;
+ return true;
}
// Machine Component Assembler
@@ -835,9 +483,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aEUtick,
aSpecial);
GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.addRecipe(aRecipe);
-
- // GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes.addRecipe(true, aInputs, aOutputs, null, aChances,
- // aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
return true;
}
@@ -869,8 +514,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aEUtick,
aSpecial);
GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.addRecipe(aRecipe);
- // GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances,
- // aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
return true;
}
@@ -902,10 +545,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aEUtick,
aSpecial);
GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.addRecipe(aRecipe);
- /*
- * if (GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances,
- * aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial) != null) { return true; }
- */
return false;
}
@@ -970,242 +609,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
return true;
}
- public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2,
- ItemStack aOutput, int a1, int a2) {
- if (aInput1 instanceof String || aInput2 instanceof String) {
- int mCompleted = 0;
- if (aInput1 instanceof String && aInput2 instanceof String) {
- List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
- List<ItemStack> x1 = OreDictionary.getOres((String) aInput2, false);
- if (x != null && x.size() > 0 && x1 != null && x1.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- for (ItemStack r1 : x1) {
- r1.stackSize = aAmount2;
- if (GT_Values.RA.addAssemblerRecipe(r, r1, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
- }
- } else if (aInput1 instanceof String) {
- List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
- if (x != null && x.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- if (GT_Values.RA.addAssemblerRecipe(r, (ItemStack) aInput2, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
-
- } else {
- List<ItemStack> x = OreDictionary.getOres((String) aInput2, false);
- if (x != null && x.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- if (GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, r, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
- }
- return mCompleted > 0;
- } else {
- return GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, (ItemStack) aInput2, aOutput, a1, a2);
- }
- }
-
- public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2,
- FluidStack aInputFluid, ItemStack aOutput, int a1, int a2) {
- if (aInput1 instanceof String || aInput2 instanceof String) {
- int mCompleted = 0;
- if (aInput1 instanceof String && aInput2 instanceof String) {
- List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
- List<ItemStack> x1 = OreDictionary.getOres((String) aInput2, false);
- if (x != null && x.size() > 0 && x1 != null && x1.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- for (ItemStack r1 : x1) {
- r1.stackSize = aAmount2;
- if (GT_Values.RA.addAssemblerRecipe(r, r1, aInputFluid, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
- }
- } else if (aInput1 instanceof String) {
- List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
- if (x != null && x.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- if (GT_Values.RA.addAssemblerRecipe(r, (ItemStack) aInput2, aInputFluid, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
-
- } else {
- List<ItemStack> x = OreDictionary.getOres((String) aInput2, false);
- if (x != null && x.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- if (GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, r, aInputFluid, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
- }
- return mCompleted > 0;
- } else {
- return GT_Values.RA
- .addAssemblerRecipe((ItemStack) aInput1, (ItemStack) aInput2, aInputFluid, aOutput, a1, a2);
- }
- }
-
- /*
- * Reflection Based Recipe Additions with Fallbacks
- */
-
- private static final Method mSixSlotAssembly;
- private static final Method mAssemblyLine;
- private static final Method mScannerTT;
- private static final Method[] mChemicalRecipe = new Method[3];
- private static final Method mLargeChemReactor;
- private static final Method mPyroOven;
-
- static {
-
- // Get GT's RA class;
- Class<? extends IGT_RecipeAdder> clazz = GT_Values.RA.getClass();
-
- mChemicalRecipe[0] = ReflectionUtils.getMethod(
- clazz,
- "addChemicalRecipe",
- ItemStack.class,
- ItemStack.class,
- FluidStack.class,
- FluidStack.class,
- ItemStack.class,
- int.class);
-
- // 6 Slot Assembler
- mSixSlotAssembly = ReflectionUtils.getMethod(
- clazz,
- "addAssemblerRecipe",
- ItemStack[].class,
- FluidStack.class,
- ItemStack.class,
- int.class,
- int.class);
- // Assembly Line
- mAssemblyLine = ReflectionUtils.getMethod(
- clazz,
- "addAssemblylineRecipe",
- ItemStack.class,
- int.class,
- ItemStack[].class,
- FluidStack[].class,
- ItemStack.class,
- int.class,
- int.class);
-
- Method T = null;
- if (LoadedMods.TecTech) {
- Class TTRecipeAdder = ReflectionUtils.getClass("com.github.technus.tectech.recipe.TT_recipeAdder");
- if (TTRecipeAdder != null) {
- Method ttTest = ReflectionUtils.getMethod(
- TTRecipeAdder,
- "addResearchableAssemblylineRecipe",
- ItemStack.class,
- int.class,
- int.class,
- int.class,
- int.class,
- Object[].class,
- FluidStack[].class,
- ItemStack.class,
- int.class,
- int.class);
- if (ttTest != null) {
- T = ttTest;
- } else {
- Method[] aDump = TTRecipeAdder.getDeclaredMethods();
- for (Method m : aDump) {
- if (m != null) {
- Logger.INFO(
- "Found " + m.getName()
- + " | "
- + m.getModifiers()
- + " | "
- + ArrayUtils.toString(m.getParameters(), "EMPTY")
- + "");
- if (m.getName().toLowerCase().equals("addresearchableassemblylinerecipe")) {
- Logger.INFO("Types: " + ArrayUtils.toString(m.getParameterTypes()));
- }
- }
- }
- }
- }
- } else {
- T = null;
- }
- mScannerTT = T;
-
- mChemicalRecipe[1] = ReflectionUtils.getMethod(
- clazz,
- "addChemicalRecipe",
- ItemStack.class,
- ItemStack.class,
- FluidStack.class,
- FluidStack.class,
- ItemStack.class,
- int.class,
- int.class);
- mChemicalRecipe[2] = ReflectionUtils.getMethod(
- clazz,
- "addChemicalRecipe",
- ItemStack.class,
- ItemStack.class,
- FluidStack.class,
- FluidStack.class,
- ItemStack.class,
- ItemStack.class,
- int.class);
-
- mLargeChemReactor = ReflectionUtils.getMethod(
- clazz,
- "addMultiblockChemicalRecipe",
- ItemStack[].class,
- FluidStack[].class,
- FluidStack[].class,
- ItemStack[].class,
- int.class,
- int.class);
-
- mPyroOven = ReflectionUtils.getMethod(
- clazz,
- "addPyrolyseRecipe",
- ItemStack.class,
- FluidStack.class,
- int.class,
- ItemStack.class,
- FluidStack.class,
- int.class,
- int.class);
-
- }
-
public boolean addSixSlotAssemblingRecipe(ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1,
int aDuration, int aEUt) {
- if (mSixSlotAssembly != null) {
- try {
- return (boolean) mSixSlotAssembly.invoke(GT_Values.RA, aInputs, aInputFluid, aOutput1, aDuration, aEUt);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
- return CORE.RA.addComponentMakerRecipe(aInputs, aInputFluid, aOutput1, aDuration, aEUt);
+ return RA.addAssemblerRecipe(aInputs, aInputFluid, aOutput1, aDuration, aEUt);
}
@Override
@@ -1220,46 +626,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
return RA.addAssemblylineRecipe(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt);
}
- private boolean tryAddTecTechScannerRecipe(ItemStack aResearchItem, Object[] aInputs, FluidStack[] aFluidInputs,
- ItemStack aOutput, int assDuration, int assEUt) {
- if (!LoadedMods.TecTech) {
- return true;
- } else {
-
- int compSec = (GT_Utility.getTier(assEUt) + 1) * 16;
- int compMax = (GT_Utility.getTier(assEUt) + 1) * 10000;
-
- if (mScannerTT != null) {
- try {
- boolean aResult = (boolean) mScannerTT.invoke(
- null,
- aResearchItem,
- compMax,
- compSec,
- (assEUt / 2),
- 16,
- aInputs,
- aFluidInputs,
- aOutput,
- assDuration,
- assEUt);
- Logger.INFO(
- "Added TecTech Scanner Recipe for " + ItemUtils.getItemName(aResearchItem)
- + "? "
- + aResult);
- return aResult;
-
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.INFO(
- "Failed to generate TecTech recipe for " + ItemUtils.getItemName(aResearchItem)
- + ", please report this to Alkalus. [Severe]");
- e.printStackTrace();
- }
- }
- }
- return false;
- }
-
public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid,
ItemStack output, int time, int eu) {
return addChemicalRecipe(input1, input2, inputFluid, outputFluid, output, null, time, eu);
@@ -1268,23 +634,13 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid,
ItemStack output, Object object, int time, int eu) {
- try {
- return (boolean) mChemicalRecipe[1]
- .invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time, eu);
- } catch (Throwable t) {
- return false;
- }
+ return RA.addChemicalRecipe(input1, input2, inputFluid, outputFluid, output, time, eu);
}
@Override
public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid,
ItemStack output, ItemStack output2, int time) {
- try {
- return (boolean) mChemicalRecipe[2]
- .invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, output2, time);
- } catch (Throwable t) {
- return false;
- }
+ return RA.addChemicalRecipe(input1, input2, inputFluid, outputFluid, output, output2, time);
}
@Override
@@ -1310,15 +666,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks,
FluidStack[] fluidStacks2, ItemStack[] outputs, int time, int eu) {
- if (mLargeChemReactor == null) {
- return false;
- }
- try {
- return (boolean) mLargeChemReactor
- .invoke(GT_Values.RA, itemStacks, fluidStacks, fluidStacks2, outputs, time, eu);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
+ return RA.addMultiblockChemicalRecipe(itemStacks, fluidStacks, fluidStacks2, outputs, time, eu);
}
private boolean areItemsAndFluidsBothNull(final ItemStack[] items, final FluidStack[] fluids) {
@@ -1348,7 +696,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
if ((aInput1 == null) || (aOutput1 == null)) {
return false;
}
- if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("compressor", aInput1, aDuration)) <= 0)) {
+ if ((aDuration = GregTech_API.sRecipeFile.get("compressor", aInput1, aDuration)) <= 0) {
return false;
}
GT_Recipe.GT_Recipe_Map.sCompressorRecipes.addRecipe(
@@ -1373,7 +721,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addBrewingRecipe(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu,
boolean aHidden) {
- if ((aIngredient == null) || (aInput == null) || (aOutput == null)) {
+ if (aIngredient == null || aInput == null || aOutput == null) {
return false;
}
if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) {
@@ -1389,7 +737,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aTime,
aEu,
0);
- if ((aHidden) && (tRecipe != null)) {
+ if (aHidden && tRecipe != null) {
tRecipe.mHidden = true;
}
return true;
@@ -1410,30 +758,13 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu) {
-
- boolean aRecipe = RA
- .addFluidSmelterRecipe(GT_Utility.copyAmount(1, input), null, output, 10000, aTime, aEu, false);
- if (aRecipe) {
- Logger.INFO(
- "Added Fluid Extractor Recipe: " + input.getDisplayName()
- + " and obtain "
- + output.amount
- + "mb of "
- + output.getLocalizedName()
- + ". Time: "
- + aTime
- + ", Voltage: "
- + aEu);
- }
- return aRecipe;
-
- // return MaterialGenerator.addFluidExtractionRecipe(GT_Values.NI, input, output, aTime, aEu);
+ return RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, input), null, output, 10000, aTime, aEu, false);
}
@Override
public boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration,
int aEU) {
- boolean aRecipe = RA.addFluidSmelterRecipe(
+ return RA.addFluidSmelterRecipe(
GT_Utility.copyAmount(1, aEmpty),
aRemains,
aFluid,
@@ -1441,8 +772,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aDuration,
aEU,
false);
- return aRecipe;
- // return MaterialGenerator.addFluidExtractionRecipe(aEmpty, aRemains, aFluid, aDuration, aEU);
}
@Override
@@ -1462,94 +791,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
return MaterialGenerator.addFluidCannerRecipe(container, aFullContainer, rFluidIn, rFluidOut, aTime, aEu);
}
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInputStackA = first Input (not null, and respects StackSize)
- * @param aInputStackB = second Input (not null, and respects StackSize)
- * @param plasma = Output of the Fusion (can be null, and respects StackSize)
- * @param aOutputChance = chance to output plasma (can be 0)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aEu = The EU generated per Tick (can even be negative!)
- * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- @Override
- public boolean addFusionReactorRecipe(FluidStack aInputStackA, FluidStack aInputStackB, FluidStack plasma,
- int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial) {
- if (aInputStackA == null || aInputStackB == null
- || plasma == null
- || aFusionDurationInTicks < 1
- || aEu < 1
- || aSpecial < 1) {
- return false;
- }
- GTPP_Recipe aFusionCustom = new GTPP_Recipe(
- true,
- null,
- null,
- null,
- new int[] { aOutputChance },
- new FluidStack[] { aInputStackA, aInputStackB },
- new FluidStack[] { plasma },
- aFusionDurationInTicks,
- aEu,
- aSpecial);
- GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(aFusionCustom);
- return true;
- }
-
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInputStackA = first Input (not null, and respects StackSize)
- * @param aInputStackB = second Input (not null, and respects StackSize)
- * @param plasma = Output of the Fusion (can be null, and respects StackSize)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aEu = The EU generated per Tick (can even be negative!)
- * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- @Override
- public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma,
- int aFusionDurationInTicks, int aEu, int aSpecial) {
- return addFusionReactorRecipe(aInputStackA, aInputStackB, plasma, 10000, aFusionDurationInTicks, aEu, aSpecial);
- }
-
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInputStackA = first Input (not null, and respects StackSize)
- * @param aInputStackB = second Input (not null, and respects StackSize)
- * @param plasma = Output of the Fusion (can be null, and respects StackSize)
- * @param aOutputChance = chance to output plasma (can be 0)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aEu = The EU generated per Tick (can even be negative!)
- * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- @Override
- public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma,
- int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial) {
- if (aInputStackA == null || aInputStackB == null
- || plasma == null
- || aFusionDurationInTicks < 1
- || aEu < 1
- || aSpecial < 1) {
- return false;
- }
- GTPP_Recipe aFusionCustom = new GTPP_Recipe(
- true,
- new ItemStack[] { aInputStackA, aInputStackB },
- null,
- null,
- new int[] { aOutputChance },
- null,
- new FluidStack[] { plasma },
- aFusionDurationInTicks,
- aEu,
- aSpecial);
- GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(aFusionCustom);
- return true;
- }
-
@Override
public boolean addSemifluidFuel(ItemStack aFuelItem, int aFuelValue) {
return SemiFluidFuelHandler.addSemiFluidFuel(aFuelItem, aFuelValue);
@@ -1581,8 +822,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
public boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs,
FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aLevel) {
if (aInputs != null && aOutputs != null) {
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size();
- int aSize2 = aSize;
GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.addRecipe(
false,
aInputs,
@@ -1594,8 +833,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aDuration,
aEUt,
aLevel);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size();
- return aSize > aSize2;
+ return true;
} else {
return false;
}
@@ -1619,11 +857,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
}
@Override
- public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu) {
- return addUvLaserRecipe(aInput1, aOutput, time, eu);
- }
-
- @Override
public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs,
FluidStack[] aFluidOutputs, int time, long eu, int aTier) {
return addChemicalPlantRecipe(aInputs, aInputFluids, aOutputs, aFluidOutputs, new int[] {}, time, eu, aTier);
@@ -1632,7 +865,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs,
FluidStack[] aFluidOutputs, int[] aChances, int time, long eu, int aTier) {
-
if (aInputs.length > 4 || aInputFluids.length > 4 || aOutputs.length > 4 || aFluidOutputs.length > 2) {
Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(aInputs));
Logger.INFO("Fluid Inputs: " + ItemUtils.getArrayStackNames(aInputFluids));
@@ -1641,8 +873,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
CORE.crash();
}
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size();
- int aSize2 = aSize;
GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.addRecipe(
false,
aInputs,
@@ -1654,8 +884,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
time,
(int) eu,
aTier);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size();
- return aSize > aSize2;
+ return true;
}
@Override
@@ -1673,25 +902,14 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
(int) eu,
aHeat);
- int aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
- int aSize2 = aSize;
GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(aSpecialRecipe);
- aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
- return aSize > aSize2;
+ return true;
}
@Override
public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput,
FluidStack aFluidOutput, int aDuration, int aEUt) {
- if (mPyroOven == null) {
- return false;
- }
- try {
- return (boolean) mPyroOven
- .invoke(GT_Values.RA, aInput, aFluidInput, intCircuit, aOutput, aFluidOutput, aDuration, aEUt);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
+ return RA.addPyrolyseRecipe(aInput, aFluidInput, intCircuit, aOutput, aFluidOutput, aDuration, aEUt);
}
@Override
@@ -1706,7 +924,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
true,
new ItemStack[] { aCircuit },
new ItemStack[] { aSolidOutput },
- (Object) null,
+ null,
new FluidStack[] { aInput },
new FluidStack[] { aOutput },
aDuration,
@@ -1741,9 +959,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aDuration,
aEUt,
0);
- int aSize = GT_Recipe_Map.sExtractorRecipes.mRecipeList.size();
GT_Recipe_Map.sExtractorRecipes.add(aRecipe);
- return GT_Recipe_Map.sExtractorRecipes.mRecipeList.size() > aSize;
+ return true;
} else {
return false;
}
@@ -1752,22 +969,16 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
ItemStack aOutput3) {
- // return GT_Values.RA.addPulveriserRecipe(arg0, arg1, arg2, arg3, arg4)
-
aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
aOutput3 = GT_OreDictUnificator.get(true, aOutput3);
- if ((GT_Utility.isStackInvalid(aInput)) || (GT_Utility.isStackInvalid(aOutput1))) {
+ if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) {
return false;
}
if (GT_Utility.getContainerItem(aInput, false) == null) {
if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, true)) {
- GT_Utility.addSimpleIC2MachineRecipe(
- aInput,
- GT_ModHandler.getMaceratorRecipeList(),
- null,
- new Object[] { aOutput1 });
+ GT_Utility.addSimpleIC2MachineRecipe(aInput, GT_ModHandler.getMaceratorRecipeList(), null, aOutput1);
}
GT_Values.RA.addPulveriserRecipe(
aInput,
@@ -1823,9 +1034,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aOutputsCrushed2 };
int[] aTime = new int[] { 2400, 3000, 1200, 1500 };
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mRecipeList.size();
- int aSize2 = aSize;
-
for (int i = 0; i < 4; i++) {
GTPP_Recipe aOreRecipe = new GTPP_Recipe(
false,
@@ -1840,9 +1048,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
0);
GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.add(aOreRecipe);
}
-
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mRecipeList.size();
- return aSize > aSize2;
+ return true;
}
@Override
@@ -1863,9 +1069,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
FlotationRecipeHandler.registerOreType(aMat);
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.mRecipeList.size();
- int aSize2 = aSize;
-
GT_Recipe aRecipe = new GTPP_Recipe(
false,
new ItemStack[] { ItemUtils.getSimpleStack(aXanthate, 32), aMat.getMilled(64), aMat.getMilled(64),
@@ -1878,33 +1081,21 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aTime,
aEU,
0);
-
GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.add(aRecipe);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.mRecipeList.size();
-
- return aSize > aSize2;
+ return true;
}
@Override
public boolean addpackagerRecipe(ItemStack aRecipeType, ItemStack aSmallDust, ItemStack aTinyDust,
ItemStack aOutputStack1) {
- AutoMap<Boolean> aResults = new AutoMap<Boolean>();
+ AutoMap<Boolean> aResults = new AutoMap<>();
// Dust 1
aResults.put(
- GT_Values.RA.addBoxingRecipe(
- GT_Utility.copyAmount(4L, new Object[] { aSmallDust }),
- aRecipeType,
- aOutputStack1,
- 100,
- 4));
+ GT_Values.RA
+ .addBoxingRecipe(GT_Utility.copyAmount(4L, aSmallDust), aRecipeType, aOutputStack1, 100, 4));
// Dust 2
aResults.put(
- GT_Values.RA.addBoxingRecipe(
- GT_Utility.copyAmount(9L, new Object[] { aTinyDust }),
- aRecipeType,
- aOutputStack1,
- 100,
- 4));
+ GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(9L, aTinyDust), aRecipeType, aOutputStack1, 100, 4));
for (boolean b : aResults) {
if (!b) {
return false;
@@ -1915,7 +1106,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage) {
- int aSize1 = GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.mRecipeList.size();
GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.addRecipe(
true,
new ItemStack[] { aFuelPellet },
@@ -1926,16 +1116,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
0,
aVoltage,
aFuelDays);
- int aSize2 = GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.mRecipeList.size();
-
- if (aSize2 > aSize1) {
- long eu = GregtechMetaTileEntity_RTG
- .getTotalEUGenerated(GregtechMetaTileEntity_RTG.convertDaysToTicks(aFuelDays), aVoltage);
- GT_MetaTileEntity_Hatch_Energy_RTG.registerPelletForHatch(aFuelPellet, eu);
- return true;
- } else {
- return false;
- }
+ long eu = GregtechMetaTileEntity_RTG
+ .getTotalEUGenerated(GregtechMetaTileEntity_RTG.convertDaysToTicks(aFuelDays), aVoltage);
+ GT_MetaTileEntity_Hatch_Energy_RTG.registerPelletForHatch(aFuelPellet, eu);
+ return true;
}
@Override
@@ -1953,9 +1137,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aEU,
0);
- int aSize = GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size();
GTPP_Recipe_Map.sColdTrapRecipes.add(aRecipe);
- return GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size() > aSize;
+ return true;
}
@Override
@@ -1973,15 +1156,14 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aEU,
0);
- int aSize = GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size();
GTPP_Recipe_Map.sReactorProcessingUnitRecipes.add(aRecipe);
- return GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size() > aSize;
+ return true;
}
@Override
public boolean addFluidHeaterRecipe(ItemStack aInput, FluidStack aFluidInput, FluidStack aOutput, int aDuration,
int aEUt) {
- if ((aInput == null && aFluidInput == null) || (aOutput == null)) {
+ if ((aInput == null && aFluidInput == null) || aOutput == null) {
return false;
}
GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes.addRecipe(
@@ -1999,7 +1181,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput == null)) {
+ if (aInput == null || aOutput == null) {
return false;
}
GTPP_Recipe aRecipe = new GTPP_Recipe(
@@ -2014,14 +1196,13 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aEUt,
0);
- int aSize = GT_Recipe_Map.sVacuumRecipes.mRecipeList.size();
GT_Recipe_Map.sVacuumRecipes.add(aRecipe);
- return GT_Recipe_Map.sVacuumRecipes.mRecipeList.size() > aSize;
+ return true;
}
@Override
public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput == null)) {
+ if (aInput == null || aOutput == null) {
return false;
}
GTPP_Recipe aRecipe = new GTPP_Recipe(
@@ -2036,9 +1217,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
aEUt,
0);
- int aSize = GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size();
GTPP_Recipe_Map.sMolecularTransformerRecipes.add(aRecipe);
- return GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size() > aSize;
+ return true;
}
@Override