aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Java/gregtech/api/util/Recipe_GT.java689
-rw-r--r--src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java2
-rw-r--r--src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java12
-rw-r--r--src/Java/miscutil/xmod/gregtech/api/util/GregtechRecipe_OLD.java (renamed from src/Java/miscutil/xmod/gregtech/api/util/GregtechRecipe.java)146
-rw-r--r--src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMTENuclearReactor.java4
-rw-r--r--src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java6
-rw-r--r--src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java4
-rw-r--r--src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java22
-rw-r--r--src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java81
-rw-r--r--src/Java/miscutil/xmod/gregtech/registration/gregtech/GregtechDehydrator.java20
10 files changed, 878 insertions, 108 deletions
diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java
new file mode 100644
index 0000000000..3d4cc8ae10
--- /dev/null
+++ b/src/Java/gregtech/api/util/Recipe_GT.java
@@ -0,0 +1,689 @@
+package gregtech.api.util;
+
+import static gregtech.api.enums.GT_Values.E;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+import static gregtech.api.enums.GT_Values.W;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
+import gregtech.api.objects.GT_ItemStack;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import miscutil.core.util.Utils;
+import miscutil.core.util.item.UtilsItems;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This File contains the functions used for Recipes. Please do not include this File AT ALL in your Moddownload as it ruins compatibility
+ * This is just the Core of my Recipe System, if you just want to GET the Recipes I add, then you can access this File.
+ * Do NOT add Recipes using the Constructors inside this Class, The GregTech_API File calls the correct Functions for these Constructors.
+ * <p/>
+ * I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions.
+ */
+public class Recipe_GT extends GT_Recipe{
+
+ public static volatile int VERSION = 508;
+ /**
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ */
+ public ItemStack[] mInputs, mOutputs;
+ /**
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ */
+ public FluidStack[] mFluidInputs, mFluidOutputs;
+ /**
+ * If you changed the amount of Array-Items inside the Output Array then the length of this Array must be larger or equal to the Output Array. A chance of 10000 equals 100%
+ */
+ public int[] mChances;
+ /**
+ * An Item that needs to be inside the Special Slot, like for example the Copy Slot inside the Printer. This is only useful for Fake Recipes in NEI, since findRecipe() and containsInput() don't give a shit about this Field. Lists are also possible.
+ */
+ public Object mSpecialItems;
+ public int mDuration, mEUt, mSpecialValue;
+ /**
+ * Use this to just disable a specific Recipe, but the Configuration enables that already for every single Recipe.
+ */
+ public boolean mEnabled = true;
+ /**
+ * If this Recipe is hidden from NEI
+ */
+ public boolean mHidden = false;
+ /**
+ * If this Recipe is Fake and therefore doesn't get found by the findRecipe Function (It is still in the HashMaps, so that containsInput does return T on those fake Inputs)
+ */
+ public boolean mFakeRecipe = false;
+ /**
+ * If this Recipe can be stored inside a Machine in order to make Recipe searching more Efficient by trying the previously used Recipe first. In case you have a Recipe Map overriding things and returning one time use Recipes, you have to set this to F.
+ */
+ public boolean mCanBeBuffered = true;
+ /**
+ * If this Recipe needs the Output Slots to be completely empty. Needed in case you have randomised Outputs
+ */
+ public boolean mNeedsEmptyOutput = false;
+
+
+ protected Recipe_GT(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
+ Utils.LOG_SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for "+UtilsItems.getArrayStackNames(aInputs), 167);
+ }
+
+ public Recipe_GT(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) {
+ this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
+ }
+
+ // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
+ public Recipe_GT(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) {
+ this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue));
+
+ Utils.LOG_INFO("Switch case method for adding fuels");
+ if (mInputs.length > 0 && aSpecialValue > 0) {
+ switch (aType) {
+ // Diesel Generator
+ case 0:
+ Utils.LOG_INFO("Added fuel "+aInput1.getDisplayName()+" is ROCKET FUEL - continuing");
+ Gregtech_Recipe_Map.sRocketFuels.addRecipe(this);
+ break;
+ // Gas Turbine
+ case 1:
+ Gregtech_Recipe_Map.sGeoThermalFuels.addRecipe(this);
+ break;
+ // Thermal Generator
+ case 2:
+ //Gregtech_Recipe_Map.sHotFuels.addRecipe(this);
+ break;
+ // Plasma Generator
+ case 4:
+ //Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this);
+ break;
+ // Magic Generator
+ case 5:
+ //Gregtech_Recipe_Map.sMagicFuels.addRecipe(this);
+ break;
+ // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
+ default:
+ //Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
+ break;
+ }
+ }
+ }
+
+ //Custom Recipe Handlers
+ public Recipe_GT(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
+ this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this);
+ }
+ }
+
+ /*public GregtechRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
+ this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this);
+ }
+ }*/
+
+
+ public static void reInit() {
+ GT_Log.out.println("GT_Mod: Re-Unificating Recipes.");
+ for (Gregtech_Recipe_Map tMapEntry : Gregtech_Recipe_Map.sMappings) tMapEntry.reInit();
+ }
+
+ public ItemStack getRepresentativeInput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mInputs.length) return null;
+ return GT_Utility.copy(mInputs[aIndex]);
+ }
+
+ public ItemStack getOutput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mOutputs.length) return null;
+ return GT_Utility.copy(mOutputs[aIndex]);
+ }
+
+ public int getOutputChance(int aIndex) {
+ if (aIndex < 0 || aIndex >= mChances.length) return 10000;
+ return mChances[aIndex];
+ }
+
+ public FluidStack getRepresentativeFluidInput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mFluidInputs.length || mFluidInputs[aIndex] == null) return null;
+ return mFluidInputs[aIndex].copy();
+ }
+
+ public FluidStack getFluidOutput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mFluidOutputs.length || mFluidOutputs[aIndex] == null) return null;
+ return mFluidOutputs[aIndex].copy();
+ }
+
+ public GT_Recipe copy() {
+ return this.copy();
+ }
+
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) {
+ return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs);
+ }
+
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] aFluidInputs, ItemStack... aInputs) {
+ if (mFluidInputs.length > 0 && aFluidInputs == null) return false;
+ for (FluidStack tFluid : mFluidInputs)
+ if (tFluid != null) {
+ boolean temp = true;
+ for (FluidStack aFluid : aFluidInputs)
+ if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {
+ temp = false;
+ break;
+ }
+ if (temp) return false;
+ }
+
+ if (mInputs.length > 0 && aInputs == null) return false;
+
+ for (ItemStack tStack : mInputs)
+ if (tStack != null) {
+ boolean temp = true;
+ for (ItemStack aStack : aInputs)
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {
+ temp = false;
+ break;
+ }
+ if (temp) return false;
+ }
+
+ if (aDecreaseStacksizeBySuccess) {
+ if (aFluidInputs != null) {
+ for (FluidStack tFluid : mFluidInputs)
+ if (tFluid != null) {
+ for (FluidStack aFluid : aFluidInputs)
+ if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {
+ aFluid.amount -= tFluid.amount;
+ break;
+ }
+ }
+ }
+
+ if (aInputs != null) {
+ for (ItemStack tStack : mInputs)
+ if (tStack != null) {
+ for (ItemStack aStack : aInputs)
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {
+ aStack.stackSize -= tStack.stackSize;
+ break;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public static class Gregtech_Recipe_Map {
+ /**
+ * Contains all Recipe Maps
+ */
+ public static final Collection<Gregtech_Recipe_Map> sMappings = new ArrayList<Gregtech_Recipe_Map>();
+ //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 2, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, E, 1, E, true, true);
+ //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe>(200), "gt.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true);
+ public static final Gregtech_Recipe_Map_Fuel sGeoThermalFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map sChemicalDehydratorRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicaldehydrator", "Chemical Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 1, 1, 0, 0, 1, E, 1, E, true, true);
+
+ /**
+ * HashMap of Recipes based on their Items
+ */
+ public final Map<GT_ItemStack, Collection<GT_Recipe>> mRecipeItemMap = new HashMap<GT_ItemStack, Collection<GT_Recipe>>();
+ /**
+ * HashMap of Recipes based on their Fluids
+ */
+ public final Map<Fluid, Collection<GT_Recipe>> mRecipeFluidMap = new HashMap<Fluid, Collection<GT_Recipe>>();
+ /**
+ * The List of all Recipes
+ */
+ public final Collection<GT_Recipe> mRecipeList;
+ /**
+ * String used as an unlocalised Name.
+ */
+ public final String mUnlocalizedName;
+ /**
+ * String used in NEI for the Recipe Lists. If null it will use the unlocalised Name instead
+ */
+ public final String mNEIName;
+ /**
+ * GUI used for NEI Display. Usually the GUI of the Machine itself
+ */
+ public final String mNEIGUIPath;
+ public final String mNEISpecialValuePre, mNEISpecialValuePost;
+ public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, mMinimalInputFluids, mAmperage;
+ public final boolean mNEIAllowed, mShowVoltageAmperageInNEI;
+
+ /**
+ * Initialises a new type of Recipe Handler.
+ *
+ * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a pre-initialised Size.
+ * @param aUnlocalizedName the unlocalised Name of this Recipe Handler, used mainly for NEI.
+ * @param aLocalName the displayed Name inside the NEI Recipe GUI.
+ * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png" if forgotten.
+ * @param aUsualInputCount the usual amount of Input Slots this Recipe Class has.
+ * @param aUsualOutputCount the usual amount of Output Slots this Recipe Class has.
+ * @param aNEISpecialValuePre the String in front of the Special Value in NEI.
+ * @param aNEISpecialValueMultiplier the Value the Special Value is getting Multiplied with before displaying
+ * @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something.
+ * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general.
+ */
+ public Gregtech_Recipe_Map(Collection<GT_Recipe> aRecipeList,
+ String aUnlocalizedName, String aLocalName, String aNEIName,
+ String aNEIGUIPath, int aUsualInputCount,
+ int aUsualOutputCount, int aMinimalInputItems,
+ int aMinimalInputFluids, int aAmperage,
+ String aNEISpecialValuePre, int aNEISpecialValueMultiplier,
+ String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
+ boolean aNEIAllowed) {
+ sMappings.add(this);
+ mNEIAllowed = aNEIAllowed;
+ mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI;
+ mRecipeList = aRecipeList;
+ mNEIName = aNEIName == null ? aUnlocalizedName : aNEIName;
+ mNEIGUIPath = aNEIGUIPath.endsWith(".png") ? aNEIGUIPath : aNEIGUIPath + ".png";
+ mNEISpecialValuePre = aNEISpecialValuePre;
+ mNEISpecialValueMultiplier = aNEISpecialValueMultiplier;
+ mNEISpecialValuePost = aNEISpecialValuePost;
+ mAmperage = aAmperage;
+ mUsualInputCount = aUsualInputCount;
+ mUsualOutputCount = aUsualOutputCount;
+ mMinimalInputItems = aMinimalInputItems;
+ mMinimalInputFluids = aMinimalInputFluids;
+ GregTech_API.sFluidMappings.add(mRecipeFluidMap);
+ GregTech_API.sItemStackMappings.add(mRecipeItemMap);
+ GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName);
+ }
+
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GT_Recipe(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
+ }
+
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ public GT_Recipe addRecipe(boolean aOptimize, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GT_Recipe(aOptimize, null, null, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /*public GregtechRecipe addRecipe(boolean aOptimize, FluidStack aInput1, FluidStack aOutput1, ItemStack[] bInput1, ItemStack[] bOutput1, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe(aOptimize, aInput1, aOutput1, bInput1,bOutput1, aDuration, aEUt, aSpecialValue));
+
+ }*/
+
+ public GT_Recipe addRecipe(GT_Recipe aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 1");
+ return addRecipe(aRecipe, true, false, false);
+ }
+
+ protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
+ Utils.LOG_INFO("Adding Recipe Method 2 - This Checks if hidden, fake or if duplicate recipes exists, I think.");
+ aRecipe.mHidden = aHidden;
+ aRecipe.mFakeRecipe = aFakeRecipe;
+ Utils.LOG_INFO("Logging some data about this method: GregtechRecipe["+aRecipe.toString()+"] | aCheckForCollisions["+aCheckForCollisions+"] | aFakeRecipe["+aFakeRecipe+"] | aHidden["+aHidden+"]");
+ Utils.LOG_INFO("Logging some data about this method: mMinimalInputFluids["+mMinimalInputFluids+"] | mMinimalInputItems["+mMinimalInputItems+"] | aRecipe.mFluidInputs.length["+aRecipe.mFluidInputs.length+"] | aRecipe.mInputs.length["+aRecipe.mInputs.length+"]");
+ if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems){
+ Utils.LOG_INFO("Step 2 failed");
+ return null;}
+
+ Utils.LOG_INFO("Logging some data about this method: aCheckForCollisions["+aCheckForCollisions+"] | findRecipe != null ["+(findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null)+"]");
+ if (aCheckForCollisions && findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null){
+ Utils.LOG_INFO("Step 2 failed - 2");
+ return null;
+ }
+ return add(aRecipe);
+ }
+
+
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) {
+ return addRecipe(aRecipe, aCheckForCollisions, true, false);
+ }
+
+ public GT_Recipe add(GT_Recipe aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 3");
+ mRecipeList.add(aRecipe);
+ for (FluidStack aFluid : aRecipe.mFluidInputs)
+ if (aFluid != null) {
+ Utils.LOG_INFO("Fluid is valid - getting some kind of fluid instance to add to the recipe hashmap.");
+ Collection<GT_Recipe> tList = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tList == null) mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<GT_Recipe>(1));
+ tList.add(aRecipe);
+ }
+ return addToItemMap(aRecipe);
+ }
+
+ public void reInit() {
+ Map<GT_ItemStack, Collection<GT_Recipe>> tMap = mRecipeItemMap;
+ if (tMap != null) tMap.clear();
+ for (GT_Recipe tRecipe : mRecipeList) {
+ GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs);
+ GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs);
+ if (tMap != null) addToItemMap(tRecipe);
+ }
+ }
+
+ /**
+ * @return if this Item is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(ItemStack aStack) {
+ return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) || mRecipeItemMap.containsKey(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack))));
+ }
+
+ /**
+ * @return if this Fluid is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(FluidStack aFluid) {
+ return aFluid != null && containsInput(aFluid.getFluid());
+ }
+
+ /**
+ * @return if this Fluid is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(Fluid aFluid) {
+ return aFluid != null && mRecipeFluidMap.containsKey(aFluid);
+ }
+
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs);
+ }
+
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs);
+ }
+
+ /**
+ * finds a Recipe matching the aFluid and ItemStack Inputs.
+ *
+ * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup.
+ * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up.
+ * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs
+ * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage
+ * @param aFluids the Fluid Inputs
+ * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do.
+ * @param aInputs the Item Inputs
+ * @return the Recipe it has found or null for no matching Recipe
+ */
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ // No Recipes? Well, nothing to be found then.
+ if (mRecipeList.isEmpty()) return null;
+
+ // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes.
+ // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes.
+ if (GregTech_API.sPostloadFinished) {
+ if (mMinimalInputFluids > 0) {
+ if (aFluids == null) return null;
+ int tAmount = 0;
+ for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++;
+ if (tAmount < mMinimalInputFluids) return null;
+ }
+ if (mMinimalInputItems > 0) {
+ if (aInputs == null) return null;
+ int tAmount = 0;
+ for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
+ if (tAmount < mMinimalInputItems) return null;
+ }
+ }
+
+ // Unification happens here in case the Input isn't already unificated.
+ if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
+
+ // Check the Recipe which has been used last time in order to not have to search for it again, if possible.
+ if (aRecipe != null)
+ if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
+
+ // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
+ if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
+ if (tStack != null) {
+ Collection<GT_Recipe>
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too.
+ if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
+ if (aFluid != null) {
+ Collection<GT_Recipe>
+ tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // And nothing has been found.
+ return null;
+ }
+
+ protected GT_Recipe addToItemMap(GT_Recipe aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 4");
+ for (ItemStack aStack : aRecipe.mInputs)
+ if (aStack != null) {
+ Utils.LOG_INFO("Method 4 - Manipulating "+aStack.getDisplayName());
+ GT_ItemStack tStack = new GT_ItemStack(aStack);
+ Utils.LOG_INFO("Method 4 - Made gt stack of item "+tStack.toStack().getDisplayName());
+ Collection<GT_Recipe> tList = mRecipeItemMap.get(tStack);
+ if (tList != null){
+ Utils.LOG_INFO("Method 4 - Gt Recipe Hashmap: "+tList.toString());
+ }
+ if (tList == null){
+ Utils.LOG_INFO("Method 4 - brrr list was NUll");
+ mRecipeItemMap.put(tStack, tList = new HashSet<GT_Recipe>(1));
+ Utils.LOG_INFO("Method 4 - Attemping backup method for Gt Recipe Hashmap:");
+
+ while (tList.iterator().hasNext()){
+ Utils.LOG_INFO(tList.iterator().next().toString());
+ }
+
+ }
+ tList.add(aRecipe);
+ Utils.LOG_INFO("Method 4 - Added recipe to map? I think.");
+ }
+ return aRecipe;
+ }
+
+ public GT_Recipe findRecipe(IGregTechTileEntity baseMetaTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, FluidStack[] fluidStacks) {
+
+ ItemStack aInputs[] = null;
+ // No Recipes? Well, nothing to be found then.
+ if (mRecipeList.isEmpty()) return null;
+
+ // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes.
+ // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes.
+ if (GregTech_API.sPostloadFinished) {
+ if (mMinimalInputFluids > 0) {
+ if (aFluids == null) return null;
+ int tAmount = 0;
+ for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++;
+ if (tAmount < mMinimalInputFluids) return null;
+ }
+ if (mMinimalInputItems > 0) {
+ if (aInputs == null) return null;
+ int tAmount = 0;
+ for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
+ if (tAmount < mMinimalInputItems) return null;
+ }
+ }
+
+ // Unification happens here in case the Input isn't already unificated.
+ if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
+
+ // Check the Recipe which has been used last time in order to not have to search for it again, if possible.
+ if (aRecipe != null)
+ if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
+
+ // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
+ if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
+ if (tStack != null) {
+ Collection<GT_Recipe>
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too.
+ if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
+ if (aFluid != null) {
+ Collection<GT_Recipe>
+ tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // And nothing has been found.
+ return null;
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ // Here are a few Classes I use for Special Cases in some Machines without having to write a separate Machine Class.
+ // -----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Abstract Class for general Recipe Handling of non GT Recipes
+ */
+ public static abstract class GT_Recipe_Map_NonGTRecipes extends Gregtech_Recipe_Map {
+ public GT_Recipe_Map_NonGTRecipes(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean containsInput(FluidStack aFluid) {
+ return false;
+ }
+
+ @Override
+ public boolean containsInput(Fluid aFluid) {
+ return false;
+ }
+
+ @Override
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public Recipe_GT addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addRecipe(GT_Recipe aRecipe) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe add(GT_Recipe aRecipe) {
+ return null;
+ }
+
+ @Override
+ public void reInit() {/**/}
+
+ @Override
+ protected GT_Recipe addToItemMap(GT_Recipe aRecipe) {
+ return null;
+ }
+ }
+
+ /**
+ * Just a Recipe Map with Utility specifically for Fuels.
+ */
+ public static class Gregtech_Recipe_Map_Fuel extends Gregtech_Recipe_Map {
+ public Gregtech_Recipe_Map_Fuel(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 1");
+ return addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU);
+ }
+
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 2");
+ return addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU);
+ }
+
+ public GT_Recipe addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 3");
+ return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
+ }
+
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 4");
+ return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
+ }
+
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 5");
+ return addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 0, 0, aFuelValueInEU);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java b/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java
index e051a54fb3..0c501af33a 100644
--- a/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java
+++ b/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java
@@ -19,7 +19,7 @@ import gregtech.api.util.GT_Utility;
import java.util.Random;
-import miscutil.xmod.gregtech.api.util.GregtechRecipe.Gregtech_Recipe_Map;
+import miscutil.xmod.gregtech.api.util.GregtechRecipe_OLD.Gregtech_Recipe_Map;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
diff --git a/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java b/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java
index a3042a4144..c2852c3c1a 100644
--- a/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java
+++ b/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java
@@ -16,8 +16,8 @@ import gregtech.api.util.GT_Utility;
import java.util.Arrays;
-import miscutil.xmod.gregtech.api.util.GregtechRecipe;
-import miscutil.xmod.gregtech.api.util.GregtechRecipe.Gregtech_Recipe_Map;
+import miscutil.xmod.gregtech.api.util.GregtechRecipe_OLD;
+import miscutil.xmod.gregtech.api.util.GregtechRecipe_OLD.Gregtech_Recipe_Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -52,7 +52,7 @@ public abstract class GT_MTE_CustomRecipe_BasicMachine extends GT_MetaTileEntity
/**
* Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered
*/
- protected GregtechRecipe mLastRecipe = null;
+ protected GregtechRecipe_OLD mLastRecipe = null;
private FluidStack mFluidOut;
/**
@@ -514,7 +514,7 @@ public abstract class GT_MTE_CustomRecipe_BasicMachine extends GT_MetaTileEntity
return getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEUt, false);
}
- protected void calculateOverclockedNess(GregtechRecipe tRecipe) {
+ protected void calculateOverclockedNess(GregtechRecipe_OLD tRecipe) {
calculateOverclockedNess(tRecipe.mEUt, tRecipe.mDuration);
}
@@ -546,7 +546,7 @@ public abstract class GT_MTE_CustomRecipe_BasicMachine extends GT_MetaTileEntity
return rOutputs;
}
- protected boolean canOutput(GregtechRecipe tRecipe) {
+ protected boolean canOutput(GregtechRecipe_OLD tRecipe) {
return tRecipe != null && (tRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null : canOutput(tRecipe.getFluidOutput(0)) && canOutput(tRecipe.mOutputs));
}
@@ -723,7 +723,7 @@ public abstract class GT_MTE_CustomRecipe_BasicMachine extends GT_MetaTileEntity
public int checkRecipe() {
Gregtech_Recipe_Map tMap = getRecipeList();
if (tMap == null) return DID_NOT_FIND_RECIPE;
- GregtechRecipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
+ GregtechRecipe_OLD tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
if (!canOutput(tRecipe)) {
diff --git a/src/Java/miscutil/xmod/gregtech/api/util/GregtechRecipe.java b/src/Java/miscutil/xmod/gregtech/api/util/GregtechRecipe_OLD.java
index a44315b2eb..fd91ba40ae 100644
--- a/src/Java/miscutil/xmod/gregtech/api/util/GregtechRecipe.java
+++ b/src/Java/miscutil/xmod/gregtech/api/util/GregtechRecipe_OLD.java
@@ -38,7 +38,7 @@ import net.minecraftforge.fluids.FluidStack;
* <p/>
* I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions.
*/
-public class GregtechRecipe {
+public class GregtechRecipe_OLD {
public static volatile int VERSION = 508;
/**
@@ -78,7 +78,7 @@ public class GregtechRecipe {
* If this Recipe needs the Output Slots to be completely empty. Needed in case you have randomised Outputs
*/
public boolean mNeedsEmptyOutput = false;
- private GregtechRecipe(GregtechRecipe aRecipe) {
+ private GregtechRecipe_OLD(GregtechRecipe_OLD aRecipe) {
mInputs = GT_Utility.copyStackArray((Object[]) aRecipe.mInputs);
mOutputs = GT_Utility.copyStackArray((Object[]) aRecipe.mOutputs);
mSpecialItems = aRecipe.mSpecialItems;
@@ -94,7 +94,7 @@ public class GregtechRecipe {
mEnabled = aRecipe.mEnabled;
mHidden = aRecipe.mHidden;
}
- protected GregtechRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ protected GregtechRecipe_OLD(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
if (aInputs == null) aInputs = new ItemStack[0];
if (aOutputs == null) aOutputs = new ItemStack[0];
if (aFluidInputs == null) aFluidInputs = new FluidStack[0];
@@ -165,15 +165,15 @@ public class GregtechRecipe {
// checkCellBalance();
- Utils.LOG_SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for "+UtilsItems.getArrayStackNames(aInputs), 167);
+ Utils.LOG_SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe_OLD]", "Created new recipe instance for "+UtilsItems.getArrayStackNames(aInputs), 167);
}
- public GregtechRecipe(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) {
+ public GregtechRecipe_OLD(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) {
this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
}
// aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
- public GregtechRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) {
+ public GregtechRecipe_OLD(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) {
this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue));
Utils.LOG_INFO("Switch case method for adding fuels");
@@ -209,14 +209,14 @@ public class GregtechRecipe {
}
//Custom Recipe Handlers
- public GregtechRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
+ public GregtechRecipe_OLD(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
if (mInputs.length > 0 && mOutputs[0] != null) {
Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this);
}
}
- /*public GregtechRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
+ /*public GregtechRecipe_OLD(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
if (mInputs.length > 0 && mOutputs[0] != null) {
Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this);
@@ -254,8 +254,8 @@ public class GregtechRecipe {
return mFluidOutputs[aIndex].copy();
}
- public GregtechRecipe copy() {
- return new GregtechRecipe(this);
+ public GregtechRecipe_OLD copy() {
+ return new GregtechRecipe_OLD(this);
}
public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) {
@@ -323,23 +323,23 @@ public class GregtechRecipe {
//public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 2, 1, 0, 1, E, 1, E, true, true);
public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, E, 1, E, true, true);
- //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe>(200), "gt.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true);
- public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe>(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true);
- public static final Gregtech_Recipe_Map_Fuel sGeoThermalFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe>(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final Gregtech_Recipe_Map sChemicalDehydratorRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe>(200), "gt.recipe.chemicaldehydrator", "Chemical Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 1, 1, 0, 0, 1, E, 1, E, true, true);
+ //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe_OLD>(200), "gt.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe_OLD>(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true);
+ public static final Gregtech_Recipe_Map_Fuel sGeoThermalFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe_OLD>(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final Gregtech_Recipe_Map sChemicalDehydratorRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe_OLD>(200), "gt.recipe.chemicaldehydrator", "Chemical Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 1, 1, 0, 0, 1, E, 1, E, true, true);
/**
* HashMap of Recipes based on their Items
*/
- public final Map<GT_ItemStack, Collection<GregtechRecipe>> mRecipeItemMap = new HashMap<GT_ItemStack, Collection<GregtechRecipe>>();
+ public final Map<GT_ItemStack, Collection<GregtechRecipe_OLD>> mRecipeItemMap = new HashMap<GT_ItemStack, Collection<GregtechRecipe_OLD>>();
/**
* HashMap of Recipes based on their Fluids
*/
- public final Map<Fluid, Collection<GregtechRecipe>> mRecipeFluidMap = new HashMap<Fluid, Collection<GregtechRecipe>>();
+ public final Map<Fluid, Collection<GregtechRecipe_OLD>> mRecipeFluidMap = new HashMap<Fluid, Collection<GregtechRecipe_OLD>>();
/**
* The List of all Recipes
*/
- public final Collection<GregtechRecipe> mRecipeList;
+ public final Collection<GregtechRecipe_OLD> mRecipeList;
/**
* String used as an unlocalised Name.
*/
@@ -370,7 +370,7 @@ public class GregtechRecipe {
* @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something.
* @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general.
*/
- public Gregtech_Recipe_Map(Collection<GregtechRecipe> aRecipeList,
+ public Gregtech_Recipe_Map(Collection<GregtechRecipe_OLD> aRecipeList,
String aUnlocalizedName, String aLocalName, String aNEIName,
String aNEIGUIPath, int aUsualInputCount,
int aUsualOutputCount, int aMinimalInputItems,
@@ -397,37 +397,37 @@ public class GregtechRecipe {
GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName);
}
- public GregtechRecipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
}
- public GregtechRecipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
+ public GregtechRecipe_OLD addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
}
- public GregtechRecipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
}
- public GregtechRecipe addRecipe(boolean aOptimize, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe(aOptimize, null, null, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(aOptimize, null, null, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
}
- /*public GregtechRecipe addRecipe(boolean aOptimize, FluidStack aInput1, FluidStack aOutput1, ItemStack[] bInput1, ItemStack[] bOutput1, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe(aOptimize, aInput1, aOutput1, bInput1,bOutput1, aDuration, aEUt, aSpecialValue));
+ /*public GregtechRecipe_OLD addRecipe(boolean aOptimize, FluidStack aInput1, FluidStack aOutput1, ItemStack[] bInput1, ItemStack[] bOutput1, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(aOptimize, aInput1, aOutput1, bInput1,bOutput1, aDuration, aEUt, aSpecialValue));
}*/
- public GregtechRecipe addRecipe(GregtechRecipe aRecipe) {
+ public GregtechRecipe_OLD addRecipe(GregtechRecipe_OLD aRecipe) {
Utils.LOG_INFO("Adding Recipe Method 1");
return addRecipe(aRecipe, true, false, false);
}
- protected GregtechRecipe addRecipe(GregtechRecipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
+ protected GregtechRecipe_OLD addRecipe(GregtechRecipe_OLD aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
Utils.LOG_INFO("Adding Recipe Method 2 - This Checks if hidden, fake or if duplicate recipes exists, I think.");
aRecipe.mHidden = aHidden;
aRecipe.mFakeRecipe = aFakeRecipe;
- Utils.LOG_INFO("Logging some data about this method: GregtechRecipe["+aRecipe.toString()+"] | aCheckForCollisions["+aCheckForCollisions+"] | aFakeRecipe["+aFakeRecipe+"] | aHidden["+aHidden+"]");
+ Utils.LOG_INFO("Logging some data about this method: GregtechRecipe_OLD["+aRecipe.toString()+"] | aCheckForCollisions["+aCheckForCollisions+"] | aFakeRecipe["+aFakeRecipe+"] | aHidden["+aHidden+"]");
Utils.LOG_INFO("Logging some data about this method: mMinimalInputFluids["+mMinimalInputFluids+"] | mMinimalInputItems["+mMinimalInputItems+"] | aRecipe.mFluidInputs.length["+aRecipe.mFluidInputs.length+"] | aRecipe.mInputs.length["+aRecipe.mInputs.length+"]");
if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems){
Utils.LOG_INFO("Step 2 failed");
@@ -446,41 +446,41 @@ public class GregtechRecipe {
/**
* Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
*/
- public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addFakeRecipe(aCheckForCollisions, new GregtechRecipe(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GregtechRecipe_OLD(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
}
/**
* Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
*/
- public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addFakeRecipe(aCheckForCollisions, new GregtechRecipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GregtechRecipe_OLD(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
}
/**
* Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
*/
- public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe aRecipe) {
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe_OLD aRecipe) {
return addRecipe(aRecipe, aCheckForCollisions, true, false);
}
- public GregtechRecipe add(GregtechRecipe aRecipe) {
+ public GregtechRecipe_OLD add(GregtechRecipe_OLD aRecipe) {
Utils.LOG_INFO("Adding Recipe Method 3");
mRecipeList.add(aRecipe);
for (FluidStack aFluid : aRecipe.mFluidInputs)
if (aFluid != null) {
Utils.LOG_INFO("Fluid is valid - getting some kind of fluid instance to add to the recipe hashmap.");
- Collection<GregtechRecipe> tList = mRecipeFluidMap.get(aFluid.getFluid());
- if (tList == null) mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<GregtechRecipe>(1));
+ Collection<GregtechRecipe_OLD> tList = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tList == null) mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<GregtechRecipe_OLD>(1));
tList.add(aRecipe);
}
return addToItemMap(aRecipe);
}
public void reInit() {
- Map<GT_ItemStack, Collection<GregtechRecipe>> tMap = mRecipeItemMap;
+ Map<GT_ItemStack, Collection<GregtechRecipe_OLD>> tMap = mRecipeItemMap;
if (tMap != null) tMap.clear();
- for (GregtechRecipe tRecipe : mRecipeList) {
+ for (GregtechRecipe_OLD tRecipe : mRecipeList) {
GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs);
GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs);
if (tMap != null) addToItemMap(tRecipe);
@@ -508,11 +508,11 @@ public class GregtechRecipe {
return aFluid != null && mRecipeFluidMap.containsKey(aFluid);
}
- public GregtechRecipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ public GregtechRecipe_OLD findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs);
}
- public GregtechRecipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ public GregtechRecipe_OLD findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe_OLD aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs);
}
@@ -528,7 +528,7 @@ public class GregtechRecipe {
* @param aInputs the Item Inputs
* @return the Recipe it has found or null for no matching Recipe
*/
- public GregtechRecipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ public GregtechRecipe_OLD findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe_OLD aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
// No Recipes? Well, nothing to be found then.
if (mRecipeList.isEmpty()) return null;
@@ -560,13 +560,13 @@ public class GregtechRecipe {
// Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
if (tStack != null) {
- Collection<GregtechRecipe>
+ Collection<GregtechRecipe_OLD>
tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
- if (tRecipes != null) for (GregtechRecipe tRecipe : tRecipes)
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
- if (tRecipes != null) for (GregtechRecipe tRecipe : tRecipes)
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
}
@@ -574,9 +574,9 @@ public class GregtechRecipe {
// If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too.
if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
if (aFluid != null) {
- Collection<GregtechRecipe>
+ Collection<GregtechRecipe_OLD>
tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
- if (tRecipes != null) for (GregtechRecipe tRecipe : tRecipes)
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
}
@@ -585,20 +585,20 @@ public class GregtechRecipe {
return null;
}
- protected GregtechRecipe addToItemMap(GregtechRecipe aRecipe) {
+ protected GregtechRecipe_OLD addToItemMap(GregtechRecipe_OLD aRecipe) {
Utils.LOG_INFO("Adding Recipe Method 4");
for (ItemStack aStack : aRecipe.mInputs)
if (aStack != null) {
Utils.LOG_INFO("Method 4 - Manipulating "+aStack.getDisplayName());
GT_ItemStack tStack = new GT_ItemStack(aStack);
Utils.LOG_INFO("Method 4 - Made gt stack of item "+tStack.toStack().getDisplayName());
- Collection<GregtechRecipe> tList = mRecipeItemMap.get(tStack);
+ Collection<GregtechRecipe_OLD> tList = mRecipeItemMap.get(tStack);
if (tList != null){
Utils.LOG_INFO("Method 4 - Gt Recipe Hashmap: "+tList.toString());
}
if (tList == null){
Utils.LOG_INFO("Method 4 - brrr list was NUll");
- mRecipeItemMap.put(tStack, tList = new HashSet<GregtechRecipe>(1));
+ mRecipeItemMap.put(tStack, tList = new HashSet<GregtechRecipe_OLD>(1));
Utils.LOG_INFO("Method 4 - Attemping backup method for Gt Recipe Hashmap:");
while (tList.iterator().hasNext()){
@@ -612,7 +612,7 @@ public class GregtechRecipe {
return aRecipe;
}
- public GregtechRecipe findRecipe(IGregTechTileEntity baseMetaTileEntity, GregtechRecipe aRecipe, boolean aNotUnificated,
+ public GregtechRecipe_OLD findRecipe(IGregTechTileEntity baseMetaTileEntity, GregtechRecipe_OLD aRecipe, boolean aNotUnificated,
long aVoltage, FluidStack[] aFluids, FluidStack[] fluidStacks) {
ItemStack aInputs[] = null;
@@ -647,13 +647,13 @@ public class GregtechRecipe {
// Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
if (tStack != null) {
- Collection<GregtechRecipe>
+ Collection<GregtechRecipe_OLD>
tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
- if (tRecipes != null) for (GregtechRecipe tRecipe : tRecipes)
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
- if (tRecipes != null) for (GregtechRecipe tRecipe : tRecipes)
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
}
@@ -661,9 +661,9 @@ public class GregtechRecipe {
// If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too.
if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
if (aFluid != null) {
- Collection<GregtechRecipe>
+ Collection<GregtechRecipe_OLD>
tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
- if (tRecipes != null) for (GregtechRecipe tRecipe : tRecipes)
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
}
@@ -681,7 +681,7 @@ public class GregtechRecipe {
* Abstract Class for general Recipe Handling of non GT Recipes
*/
public static abstract class GT_Recipe_Map_NonGTRecipes extends Gregtech_Recipe_Map {
- public GT_Recipe_Map_NonGTRecipes(Collection<GregtechRecipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ public GT_Recipe_Map_NonGTRecipes(Collection<GregtechRecipe_OLD> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
}
@@ -701,37 +701,37 @@ public class GregtechRecipe {
}
@Override
- public GregtechRecipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
return null;
}
@Override
- public GregtechRecipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
return null;
}
@Override
- public GregtechRecipe addRecipe(GregtechRecipe aRecipe) {
+ public GregtechRecipe_OLD addRecipe(GregtechRecipe_OLD aRecipe) {
return null;
}
@Override
- public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
return null;
}
@Override
- public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
return null;
}
@Override
- public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe aRecipe) {
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe_OLD aRecipe) {
return null;
}
@Override
- public GregtechRecipe add(GregtechRecipe aRecipe) {
+ public GregtechRecipe_OLD add(GregtechRecipe_OLD aRecipe) {
return null;
}
@@ -739,7 +739,7 @@ public class GregtechRecipe {
public void reInit() {/**/}
@Override
- protected GregtechRecipe addToItemMap(GregtechRecipe aRecipe) {
+ protected GregtechRecipe_OLD addToItemMap(GregtechRecipe_OLD aRecipe) {
return null;
}
}
@@ -748,31 +748,31 @@ public class GregtechRecipe {
* Just a Recipe Map with Utility specifically for Fuels.
*/
public static class Gregtech_Recipe_Map_Fuel extends Gregtech_Recipe_Map {
- public Gregtech_Recipe_Map_Fuel(Collection<GregtechRecipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ public Gregtech_Recipe_Map_Fuel(Collection<GregtechRecipe_OLD> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
}
- public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) {
+ public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) {
Utils.LOG_INFO("Adding Fuel using method 1");
return addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU);
}
- public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) {
+ public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) {
Utils.LOG_INFO("Adding Fuel using method 2");
return addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU);
}
- public GregtechRecipe addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ public GregtechRecipe_OLD addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
Utils.LOG_INFO("Adding Fuel using method 3");
return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
}
- public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
Utils.LOG_INFO("Adding Fuel using method 4");
return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
}
- public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) {
+ public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) {
Utils.LOG_INFO("Adding Fuel using method 5");
return addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 0, 0, aFuelValueInEU);
}
diff --git a/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMTENuclearReactor.java b/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMTENuclearReactor.java
index 713a44f0a8..523525c017 100644
--- a/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMTENuclearReactor.java
+++ b/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMTENuclearReactor.java
@@ -9,6 +9,7 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
import java.util.ArrayList;
import java.util.Arrays;
@@ -18,7 +19,6 @@ import miscutil.core.lib.CORE;
import miscutil.core.util.Utils;
import miscutil.core.util.item.UtilsItems;
import miscutil.xmod.gregtech.api.gui.GUI_MultiMachine;
-import miscutil.xmod.gregtech.api.util.GregtechRecipe;
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -102,7 +102,7 @@ public class GregtechMTENuclearReactor extends GT_MetaTileEntity_MultiBlockBase
FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0, tFluidList.size());
if (tFluids.length > 0) {
for(int i = 0;i<tFluids.length;i++){
- GT_Recipe tRecipe = GregtechRecipe.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{});
+ GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{});
if (tRecipe != null) {
if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) {
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
diff --git a/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java b/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java
index 12076dc3c2..0f9765a319 100644
--- a/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java
+++ b/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java
@@ -8,6 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
import java.util.ArrayList;
import java.util.Arrays;
@@ -16,7 +17,6 @@ import miscutil.core.block.ModBlocks;
import miscutil.core.lib.CORE;
import miscutil.xmod.gregtech.api.gui.GUI_MultiMachine;
import miscutil.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
-import miscutil.xmod.gregtech.api.util.GregtechRecipe;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
@@ -70,7 +70,7 @@ public class GregtechMetaTileEntityIndustrialCokeOven
@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes;
+ return Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes;
}
@@ -118,7 +118,7 @@ public class GregtechMetaTileEntityIndustrialCokeOven
if (tInputList.size() > 0) {
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- GT_Recipe tRecipe = GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
if ((tRecipe != null) && (this.mLevel >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
diff --git a/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java b/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
index 36a645b3e3..13d10e71de 100644
--- a/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
+++ b/src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
@@ -11,6 +11,7 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
import java.util.ArrayList;
import java.util.Arrays;
@@ -20,7 +21,6 @@ import miscutil.core.lib.CORE;
import miscutil.core.util.Utils;
import miscutil.core.util.item.UtilsItems;
import miscutil.xmod.gregtech.api.gui.GUI_MultiMachine;
-import miscutil.xmod.gregtech.api.util.GregtechRecipe;
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -110,7 +110,7 @@ public class GregtechMetaTileEntityMassFabricator extends GT_MetaTileEntity_Mult
FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0, tFluidList.size());
if (tFluids.length > 0) {
for(int i = 0;i<tFluids.length;i++){
- GT_Recipe tRecipe = GregtechRecipe.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{});
+ GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{});
if (tRecipe != null) {
if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) {
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
diff --git a/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java
index ae25ede64b..7f7acac784 100644
--- a/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -1,9 +1,9 @@
package miscutil.xmod.gregtech.recipes;
import gregtech.api.GregTech_API;
+import gregtech.api.util.Recipe_GT;
import miscutil.core.util.Utils;
import miscutil.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
-import miscutil.xmod.gregtech.api.util.GregtechRecipe;
import miscutil.xmod.gregtech.recipes.machines.RECIPEHANDLER_CokeOven;
import miscutil.xmod.gregtech.recipes.machines.RECIPEHANDLER_Dehydrator;
import miscutil.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator;
@@ -47,10 +47,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
try {
RECIPEHANDLER_CokeOven.debug4(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
if (aFluidInput == null){
- GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
}
else {
- GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_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);
@@ -101,12 +101,12 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
try {
RECIPEHANDLER_MatterFabricator.debug4(aFluidInput, aFluidOutput, aDuration, aEUt);
if (aFluidInput == null){
- //GregtechRecipe.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- GregtechRecipe.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ //Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
}
else {
- //GregtechRecipe.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- GregtechRecipe.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ //Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
}
RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
@@ -129,7 +129,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
Utils.LOG_INFO("Fuel Input is Invalid.");
return false;
}
- new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
+ //new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
return true;
}
@@ -143,7 +143,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) {
return false;
}
- GregtechRecipe.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB}, aOutputItems.clone(), null, null, null, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB}, aOutputItems.clone(), null, null, null, aDuration, aEUt, 0);
RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, aFluid, aOutputFluid, aOutputItems, aDuration, aEUt);
return true;
}
@@ -159,7 +159,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) {
return false;
}
- GregtechRecipe.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB}, aOutputItems.clone(), null, null, null, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB}, aOutputItems.clone(), null, null, null, aDuration, aEUt, 0);
RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, null, null, aOutputItems, aDuration, aEUt);
return true;
}
@@ -172,7 +172,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) {
return false;
}
- GregtechRecipe.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutput.clone(), null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutput.clone(), null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, aOutput, aDuration, aEUt);
return true;
}
diff --git a/src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java b/src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java
new file mode 100644
index 0000000000..9cab3c2549
--- /dev/null
+++ b/src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java
@@ -0,0 +1,81 @@
+package miscutil.xmod.gregtech.recipes.machines;
+
+import miscutil.core.util.Utils;
+import miscutil.core.util.item.UtilsItems;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class RECIPEHANDLER_Dehydrator {
+
+ public static void debug1(){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Walking Through Chemical Dehydrator Recipe Creation.");
+ Utils.LOG_WARNING("My name is Willus and I will be your humble host.");
+ }
+ public static void debug2(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Taking a step forward.");
+ Utils.LOG_WARNING("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);
+ Utils.LOG_WARNING("Passed.");
+ }
+ public static void debug3(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Taking a step forward.");
+ Utils.LOG_WARNING("(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);
+ Utils.LOG_WARNING("Passed.");
+ }
+ public static void debug4(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Taking a step forward.");
+ Utils.LOG_WARNING("(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);
+ Utils.LOG_WARNING("Passed.");
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+
+ }
+ public static void debug5(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutput, int aDuration, int aEUt){
+
+ String inputAname;
+ String inputBname;
+ String inputFluidname;
+ String outputFluidName;
+
+ if (aInput1 != null){
+ inputAname = aInput1.getDisplayName();
+ }
+ else {
+ inputAname = "null";
+ }
+
+ if (aInput2 != null){
+ inputBname = aInput2.getDisplayName();
+ }
+ else {
+ inputBname = "null";
+ }
+
+ if (aFluidInput != null){
+ inputFluidname = aFluidInput.getFluid().getName();
+ }
+ else {
+ inputFluidname = "null";
+ }
+
+ if (aFluidOutput != null){
+ outputFluidName = aFluidOutput.getFluid().getName();
+ }
+ else {
+ outputFluidName = "null";
+ }
+
+ Utils.LOG_INFO("Successfully added a Chemical Dehydrator recipe for: "+UtilsItems.getArrayStackNames(aOutput)+" & "+outputFluidName+", Using "+inputAname+" & "+inputBname+" & liquid "+inputFluidname+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ }
+
+}
diff --git a/src/Java/miscutil/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/miscutil/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
index d5b61eae7a..a4949bc292 100644
--- a/src/Java/miscutil/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
+++ b/src/Java/miscutil/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
@@ -1,11 +1,11 @@
package miscutil.xmod.gregtech.registration.gregtech;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe;
+import gregtech.api.util.Recipe_GT;
import miscutil.core.lib.CORE;
import miscutil.core.lib.LoadedMods;
import miscutil.core.util.Utils;
import miscutil.xmod.gregtech.api.enums.GregtechItemList;
-import miscutil.xmod.gregtech.api.metatileentity.implementations.base.GT_MTE_BasicMachine_Custom_Recipe;
-import miscutil.xmod.gregtech.api.util.GregtechRecipe;
public class GregtechDehydrator
{
@@ -38,10 +38,10 @@ public class GregtechDehydrator
*/
- GregtechItemList.GT_Dehydrator_EV.set(new GT_MTE_BasicMachine_Custom_Recipe(
+ GregtechItemList.GT_Dehydrator_EV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
813, "advancedmachine.dehydrator.tier.01", "Chemical Dehydrator I", 4,
"Remind Alkalus to add something here."+System.getProperty("line.separator")+CORE.GT_Tooltip,
- GregtechRecipe.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
2, 9,
10000,
2, 5,
@@ -50,10 +50,10 @@ public class GregtechDehydrator
0,
"UNBOXINATOR",
null).getStackForm(1L));
- GregtechItemList.GT_Dehydrator_IV.set(new GT_MTE_BasicMachine_Custom_Recipe(
+ GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
814, "advancedmachine.dehydrator.tier.02", "Chemical Dehydrator II", 5,
"Remind Alkalus to add something here."+System.getProperty("line.separator")+CORE.GT_Tooltip,
- GregtechRecipe.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
2, 9,
10000,
2, 5,
@@ -62,10 +62,10 @@ public class GregtechDehydrator
0,
"UNBOXINATOR",
null).getStackForm(1L));
- GregtechItemList.GT_Dehydrator_LuV.set(new GT_MTE_BasicMachine_Custom_Recipe(
+ GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
815, "advancedmachine.dehydrator.tier.03", "Chemical Dehydrator III", 6,
"Remind Alkalus to add something here."+System.getProperty("line.separator")+CORE.GT_Tooltip,
- GregtechRecipe.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
2, 9,
10000,
2, 5,
@@ -74,10 +74,10 @@ public class GregtechDehydrator
0,
"UNBOXINATOR",
null).getStackForm(1L));
- GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MTE_BasicMachine_Custom_Recipe(
+ GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
816, "advancedmachine.dehydrator.tier.04", "Chemical Dehydrator IV", 7,
"Remind Alkalus to add something here."+System.getProperty("line.separator")+CORE.GT_Tooltip,
- GregtechRecipe.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
2, 9,
10000,
2, 5,