aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-07-15 21:21:04 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-07-15 21:21:04 +1000
commitbc05626aaa3fc6898ecdbf9aeee0aac081dd7e99 (patch)
tree8af0769b7a880810f18786016b49f42e5226b41d
parent2289408315ab5ec8d17d72a1c53a75789961d5c4 (diff)
downloadGT5-Unofficial-bc05626aaa3fc6898ecdbf9aeee0aac081dd7e99.tar.gz
GT5-Unofficial-bc05626aaa3fc6898ecdbf9aeee0aac081dd7e99.tar.bz2
GT5-Unofficial-bc05626aaa3fc6898ecdbf9aeee0aac081dd7e99.zip
+ Added the Matter Fabricator Multiblock.
+ Added Casings for the Matter Fabricator. + Added recipes for the Matter Fabricator. + Added the Wire Factory Multiblock. + Added Casings for the Wire Factory.
-rw-r--r--src/Java/miscutil/core/handler/COMPAT_HANDLER.java2
-rw-r--r--src/Java/miscutil/core/handler/registration/gregtech/GregtechIndustrialMassFabricator.java27
-rw-r--r--src/Java/miscutil/core/lib/LoadedMods.java2
-rw-r--r--src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java23
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechItemList.java6
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java12
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java128
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/GregtechRecipeAdder.java119
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java23
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java378
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java238
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/recipes/GregtechRecipeAdder.java136
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java46
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java45
14 files changed, 842 insertions, 343 deletions
diff --git a/src/Java/miscutil/core/handler/COMPAT_HANDLER.java b/src/Java/miscutil/core/handler/COMPAT_HANDLER.java
index 11167f5371..5ca2ea5c4a 100644
--- a/src/Java/miscutil/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/miscutil/core/handler/COMPAT_HANDLER.java
@@ -25,6 +25,7 @@ import miscutil.core.handler.registration.gregtech.GregtechIndustrialCentrifuge;
import miscutil.core.handler.registration.gregtech.GregtechIndustrialCokeOven;
import miscutil.core.handler.registration.gregtech.GregtechIndustrialElectrolyzer;
import miscutil.core.handler.registration.gregtech.GregtechIndustrialMacerator;
+import miscutil.core.handler.registration.gregtech.GregtechIndustrialMassFabricator;
import miscutil.core.handler.registration.gregtech.GregtechIndustrialPlatePress;
import miscutil.core.handler.registration.gregtech.GregtechIndustrialWiremill;
import miscutil.core.handler.registration.gregtech.GregtechIronBlastFurnace;
@@ -93,6 +94,7 @@ public class COMPAT_HANDLER {
GregtechIndustrialElectrolyzer.run();
GregtechIndustrialMacerator.run();
GregtechIndustrialWiremill.run();
+ GregtechIndustrialMassFabricator.run();
}
}
diff --git a/src/Java/miscutil/core/handler/registration/gregtech/GregtechIndustrialMassFabricator.java b/src/Java/miscutil/core/handler/registration/gregtech/GregtechIndustrialMassFabricator.java
new file mode 100644
index 0000000000..4d36de7df4
--- /dev/null
+++ b/src/Java/miscutil/core/handler/registration/gregtech/GregtechIndustrialMassFabricator.java
@@ -0,0 +1,27 @@
+package miscutil.core.handler.registration.gregtech;
+
+import miscutil.core.util.Utils;
+import miscutil.core.xmod.gregtech.api.enums.GregtechItemList;
+import miscutil.core.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityMassFabricator;
+
+public class GregtechIndustrialMassFabricator
+{
+
+
+
+ public static void run()
+ {
+ if (miscutil.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("MiscUtils: Gregtech5u Content | Registering Industrial Mass Fabricator Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_MassFab.set(new GregtechMetaTileEntityMassFabricator(799, "industrialmassfab.controller.tier.single", "Matter Fabrication Controller").getStackForm(1L));
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/lib/LoadedMods.java b/src/Java/miscutil/core/lib/LoadedMods.java
index 352fffa3df..b1b95a6af3 100644
--- a/src/Java/miscutil/core/lib/LoadedMods.java
+++ b/src/Java/miscutil/core/lib/LoadedMods.java
@@ -1,7 +1,7 @@
package miscutil.core.lib;
import miscutil.core.util.Utils;
-import miscutil.core.xmod.gregtech.common.GregtechRecipeAdder;
+import miscutil.core.xmod.gregtech.recipes.GregtechRecipeAdder;
import cpw.mods.fml.common.Loader;
public class LoadedMods {
diff --git a/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java b/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java
index 040c4e8377..1845e1304c 100644
--- a/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java
@@ -19,6 +19,7 @@ public class RECIPES_GREGTECH {
private static void execute(){
cokeOvenRecipes();
+ matterFabRecipes();
assemblerRecipes();
distilleryRecipes();
addFuels();
@@ -80,6 +81,28 @@ public class RECIPES_GREGTECH {
120); //EU
}catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
}
+
+ private static void matterFabRecipes(){
+ Utils.LOG_INFO("Loading Recipes for Matter Fabricator.");
+
+ try {
+
+ CORE.RA.addMattrFabricatorRecipe(
+ Materials.UUAmplifier.getFluid(1L), //Fluid Input
+ Materials.UUMatter.getFluid(1L), //Fluid Output
+ 800, //Time in ticks
+ 32); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ try {
+
+ CORE.RA.addMattrFabricatorRecipe(
+ null, //Fluid Input
+ Materials.UUMatter.getFluid(1L), //Fluid Output
+ 3200, //Time in ticks
+ 32); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+
+ }
private static void assemblerRecipes(){
//GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 6L), ItemList.Casing_Turbine.get(1L, new Object[0]), ItemList.Casing_Turbine2.get(1L, new Object[0]), 50, 16);
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechItemList.java
index a358ff8bba..060ef75a54 100644
--- a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechItemList.java
@@ -68,7 +68,7 @@ public enum GregtechItemList implements GregtechItemContainer {
Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM,
//Unused Machine Casings
- Casing_U4, Casing_U5, Casing_U6, Casing_U7,
+ Casing_U4, Casing_MatterGen, Casing_MatterFab, Casing_U7,
//Unused Machine Coils
Casing_Coil_U1, Casing_Coil_U2, Casing_Coil_U3, Casing_Coil_U4,
@@ -85,7 +85,9 @@ public enum GregtechItemList implements GregtechItemContainer {
Casing_Macerator, Industrial_MacerationStack,
//Industrial Wire Factory
- Industrial_WireFactory;
+ Industrial_WireFactory,
+
+ Industrial_MassFab;
public static final GregtechItemList[]
DYE_ONLY_ITEMS = {
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
index 3668dd51db..6ee921f4bf 100644
--- a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
+++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -21,4 +21,16 @@ public interface IGregtech_RecipeAdder {
public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType);
+
+ /**
+ * Adds a Matter Fabricator Recipe
+ *
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be UU_Amp or 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 addMattrFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
+
}
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java
index 6d73a94364..7c75489cef 100644
--- a/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java
+++ b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java
@@ -4,6 +4,7 @@ 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_FluidStack;
import gregtech.api.objects.GT_ItemStack;
@@ -165,9 +166,9 @@ public class GregtechRecipe {
}
public GregtechRecipe(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) {
- this(aInput1, aOutput1, null, null, null, aFuelValue, 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) {
this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue));
@@ -208,6 +209,31 @@ public class GregtechRecipe {
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 GregtechRecipe copy() {
return new GregtechRecipe(this);
@@ -277,6 +303,8 @@ public class GregtechRecipe {
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/ChemicalBath", 1, 3, 1, 1, 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, 3, 1, 1, 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);
@@ -322,28 +350,8 @@ 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, 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 Gregtech_Recipe_Map(HashSet<GregtechRecipe> hashSet,
- String aUnlocalizedName, String aLocalName, Object aNEIName,
+ public Gregtech_Recipe_Map(Collection<GregtechRecipe> aRecipeList,
+ String aUnlocalizedName, String aLocalName, String aNEIName,
String aNEIGUIPath, int aUsualInputCount,
int aUsualOutputCount, int aMinimalInputItems,
int aMinimalInputFluids, int aAmperage,
@@ -353,8 +361,8 @@ public class GregtechRecipe {
sMappings.add(this);
mNEIAllowed = aNEIAllowed;
mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI;
- mRecipeList = hashSet;
- mNEIName = (String) (aNEIName == null ? aUnlocalizedName : aNEIName);
+ mRecipeList = aRecipeList;
+ mNEIName = aNEIName == null ? aUnlocalizedName : aNEIName;
mNEIGUIPath = aNEIGUIPath.endsWith(".png") ? aNEIGUIPath : aNEIGUIPath + ".png";
mNEISpecialValuePre = aNEISpecialValuePre;
mNEISpecialValueMultiplier = aNEISpecialValueMultiplier;
@@ -381,6 +389,10 @@ public class GregtechRecipe {
return addRecipe(new GregtechRecipe(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 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));
@@ -561,12 +573,72 @@ public class GregtechRecipe {
if (tList == null){
Utils.LOG_INFO("Method 4 - brrr list was NUll");
mRecipeItemMap.put(tStack, tList = new HashSet<GregtechRecipe>(1));
- }
+ }
tList.add(aRecipe);
Utils.LOG_INFO("Method 4 - Added recipe to map? I think.");
}
return aRecipe;
}
+
+ public GregtechRecipe findRecipe(IGregTechTileEntity baseMetaTileEntity, GregtechRecipe 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<GregtechRecipe>
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) for (GregtechRecipe 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 (!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<GregtechRecipe>
+ tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tRecipes != null) for (GregtechRecipe 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;
+ }
}
// -----------------------------------------------------------------------------------------------------------------
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/GregtechRecipeAdder.java b/src/Java/miscutil/core/xmod/gregtech/common/GregtechRecipeAdder.java
deleted file mode 100644
index 076915b633..0000000000
--- a/src/Java/miscutil/core/xmod/gregtech/common/GregtechRecipeAdder.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package miscutil.core.xmod.gregtech.common;
-
-import gregtech.api.GregTech_API;
-import miscutil.core.util.Utils;
-import miscutil.core.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
-import miscutil.core.xmod.gregtech.api.util.GregtechRecipe;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
-
- @SuppressWarnings("static-method")
- private void debug1(){
- Utils.LOG_WARNING("==================================================================================");
- Utils.LOG_WARNING("==================================================================================");
- Utils.LOG_WARNING("==================================================================================");
- Utils.LOG_WARNING("Walking Through CokeOven Recipe Creation.");
- Utils.LOG_WARNING("My name is Ralph and I will be your humble host.");
- }
- @SuppressWarnings("static-method")
- private 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.");
- }
- @SuppressWarnings("static-method")
- private 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.");
- }
- @SuppressWarnings("static-method")
- private 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);
-
- }
- @SuppressWarnings("static-method")
- private void debug5(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
- Utils.LOG_INFO("Successfully added a Coke Oven recipe for: "+aOutput.getDisplayName()+" & "+aFluidOutput.getFluid().getName()+", Using "+aInput1.getDisplayName()+" & "+aInput2.getDisplayName()+" & liquid "+aFluidInput.getFluid().getName()+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
- Utils.LOG_WARNING("==================================================================================");
- Utils.LOG_WARNING("==================================================================================");
- Utils.LOG_WARNING("==================================================================================");
- }
-
- @Override
- public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) {
- try {
- try {
- 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);
- Utils.LOG_WARNING("Something was null, returning false");
- return false;
- }
-
- } catch (NullPointerException e){e.getStackTrace();}
- try {
- 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);
- Utils.LOG_WARNING("Something was null, returning false");
- return false;
- }
-
- } catch (NullPointerException e){e.getStackTrace();}
- try {
-
- 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);
- Utils.LOG_WARNING("Something was null, returning false");
- return false;
- }
-
- } catch (NullPointerException e){e.getStackTrace();}
- try {
- 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);
- }
- 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);
- }
- debug5(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
-
- return true;
-
- } catch (NullPointerException e){
- return false;
- }
- } catch (Throwable e){
- 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("Failed.");
- e.getStackTrace();
- return false;
- }
- }
-
- @Override
- public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) {
- if (aInput1 == null) {
- Utils.LOG_INFO("Fuel Input is Invalid.");
- return false;
- }
- new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
- return true;
- }
-
-
-}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
index be318d9865..b6a71c128c 100644
--- a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
+++ b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
@@ -28,13 +28,13 @@ extends GregtechMetaCasingBlocksAbstract {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Centrifuge Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); //60
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Material Press Machine Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Electrolyzer Casing");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "BROKEN BLUE FUSION Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Wire Factory Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Maceration Stack Casing");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "BROKEN PINK FUSION Casing");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Unused Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Matter Generation Block"); //65
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Matter Fabricator Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Iron Plated Bricks");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Unused Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Unused Coil Block");
@@ -49,8 +49,8 @@ extends GregtechMetaCasingBlocksAbstract {
GregtechItemList.Casing_Electrolyzer.set(new ItemStack(this, 1, 5));
GregtechItemList.Casing_Macerator.set(new ItemStack(this, 1, 6));
GregtechItemList.Casing_U4.set(new ItemStack(this, 1, 7));
- GregtechItemList.Casing_U5.set(new ItemStack(this, 1, 8));
- GregtechItemList.Casing_U6.set(new ItemStack(this, 1, 9));
+ GregtechItemList.Casing_MatterGen.set(new ItemStack(this, 1, 8));
+ GregtechItemList.Casing_MatterFab.set(new ItemStack(this, 1, 9));
GregtechItemList.Casing_IronPlatedBricks.set(new ItemStack(this, 1, 10));
GregtechItemList.Casing_U7.set(new ItemStack(this, 1, 11));
GregtechItemList.Casing_Coil_U1.set(new ItemStack(this, 1, 12));
@@ -82,14 +82,17 @@ extends GregtechMetaCasingBlocksAbstract {
case 5:
return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon();
//Broken Blue Fusion Casings
- /*case 6:
- return Textures.BlockIcons.MACHINE_CASING_FIREBOX_TITANIUM.getIcon();*/
+ case 6:
+ return Textures.BlockIcons.MACHINE_CASING_FUSION.getIcon();
//Maceration Stack Casings
case 7:
return Textures.BlockIcons.MACHINE_LuV_BOTTOM.getIcon();
//Broken Pink Fusion Casings
- /*case 8:
- return Textures.BlockIcons.MACHINE_CASING_FIREBOX_TITANIUM.getIcon();*/
+ case 8:
+ return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon();
+ //Matter Fabricator Casings
+ case 9:
+ return Textures.BlockIcons.MACHINE_CASING_MAGIC.getIcon();
//Iron Blast Fuance Textures
case 10:
return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java
index 1e5fa6427b..1dd4d2bd00 100644
--- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java
@@ -6,7 +6,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
@@ -21,212 +21,224 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GregtechMetaTileEntityIndustrialWireMill
- extends GT_MetaTileEntity_MultiBlockBase {
- public GregtechMetaTileEntityIndustrialWireMill(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
+extends GT_MetaTileEntity_MultiBlockBase {
+ public GregtechMetaTileEntityIndustrialWireMill(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
- public GregtechMetaTileEntityIndustrialWireMill(String aName) {
- super(aName);
- }
+ public GregtechMetaTileEntityIndustrialWireMill(String aName) {
+ super(aName);
+ }
- @Override
+ @Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityIndustrialWireMill(this.mName);
- }
+ return new GregtechMetaTileEntityIndustrialWireMill(this.mName);
+ }
- @Override
+ @Override
public String[] getDescription() {
- return new String[]{
- "Controller Block for the Vacuum Freezer",
- "Size: 3x3x3 (Hollow)",
- "Controller (front centered)",
- "1x Input (anywhere)",
- "1x Output (anywhere)",
- "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)",
- "Frost Proof Casings for the rest (16 at least!)",
- "",
- "Controller Block for the Large Plasma Generator",
- "Size: 3x4x3 (Hollow)", "Controller (front centered)",
- "1x Input Hatch (side centered)",
- "1x Dynamo Hatch (back centered)",
- "1x Maintenance Hatch (side centered)",
- "Turbine Casings for the rest (24 at least!)",
- "Needs a Turbine Item (inside controller GUI)"
- };
- }
-
- @Override
+ return new String[]{
+ "Controller Block for the Industrial Wire Factory",
+ "Size: 3x5x3 (Hollow)", "Controller (front centered)",
+ "2x Input Bus (side centered)",
+ "2x Output Bus (side centered)",
+ "1x Energy Hatch (top or bottom centered)",
+ "1x Maintenance Hatch (back centered)",
+ "Wire Factory Casings for the rest (32 at least!)"
+ };
+ }
+
+ @Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[17], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)};
- }
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[17]};
- }
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[63], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[63]};
+ }
- @Override
+ @Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png");
- }
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png");
+ }
- @Override
+ @Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
- }
+ return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
+ }
- @Override
+ @Override
public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
+ return true;
+ }
- @Override
+ @Override
public boolean isFacingValid(byte aFacing) {
- return aFacing > 1;
- }
+ return aFacing > 1;
+ }
- @Override
+ @Override
public boolean checkRecipe(ItemStack aStack) {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- for (ItemStack tInput : tInputList) {
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput});
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- } else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
- updateSlots();
- return true;
- }
- }
- }
- return false;
- }
-
- @Override
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (ItemStack tInput : tInputList) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ updateSlots();
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- byte tSide = getBaseMetaTileEntity().getBackFacing();
- if ((getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2))) {
- int tAirCount = 0;
- for (byte i = -1; i < 2; i = (byte) (i + 1)) {
- for (byte j = -1; j < 2; j = (byte) (j + 1)) {
- for (byte k = -1; k < 2; k = (byte) (k + 1)) {
- if (getBaseMetaTileEntity().getAirOffset(i, j, k)) {
- tAirCount++;
- }
- }
- }
- }
- if (tAirCount != 10) {
- return false;
- }
- for (byte i = 2; i < 6; i = (byte) (i + 1)) {
- IGregTechTileEntity tTileEntity;
- if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) &&
- (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) &&
- ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntityIndustrialWireMill))) {
- Utils.LOG_INFO("False 1");
- return false;
- }
- }
- int tX = getBaseMetaTileEntity().getXCoord();
- int tY = getBaseMetaTileEntity().getYCoord();
- int tZ = getBaseMetaTileEntity().getZCoord();
- for (byte i = -1; i < 2; i = (byte) (i + 1)) {
- for (byte j = -1; j < 2; j = (byte) (j + 1)) {
- if ((i != 0) || (j != 0)) {
- for (byte k = 0; k < 4; k = (byte) (k + 1)) {
- if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2))) {
- if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
- } else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)))) {
- Utils.LOG_INFO("False 2");
- return false;
- }
- } else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
- } else {
- Utils.LOG_INFO("False 3");
- return false;
- }
- }
- }
- }
- }
- this.mDynamoHatches.clear();
- IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3);
- if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
- if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Dynamo)) {
- this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) tTileEntity.getMetaTileEntity());
- ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
- } else {
- Utils.LOG_INFO("False 4");
- return false;
- }
- }
- } else {
- Utils.LOG_INFO("False 5");
- return false;
- }
- return true;
- }
-
- @Override
+ byte tSide = getBaseMetaTileEntity().getBackFacing();
+ if ((getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3)))) {
+ int tAirCount = 0;
+ for (byte i = -1; i < 2; i = (byte) (i + 1)) {
+ for (byte j = -1; j < 2; j = (byte) (j + 1)) {
+ for (byte k = -1; k < 2; k = (byte) (k + 1)) {
+ if (getBaseMetaTileEntity().getAirOffset(i, j, k)) {
+ tAirCount++;
+ }
+ }
+ }
+ }
+ if (tAirCount != 10) {
+ Utils.LOG_INFO("False 1");
+ return false;
+ }
+ for (byte i = 2; i < 6; i = (byte) (i + 1)) {
+ IGregTechTileEntity tTileEntity;
+ if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) &&
+ (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) &&
+ ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntityIndustrialWireMill))) {
+ //Utils.LOG_INFO("False 1");
+ return false;
+ }
+ }
+ int tX = getBaseMetaTileEntity().getXCoord();
+ int tY = getBaseMetaTileEntity().getYCoord();
+ int tZ = getBaseMetaTileEntity().getZCoord();
+ for (byte i = -1; i < 2; i = (byte) (i + 1)) {
+ for (byte j = -1; j < 2; j = (byte) (j + 1)) {
+ if ((i != 0) || (j != 0)) {
+ for (byte k = 0; k < 5; k = (byte) (k + 1)) {
+ if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) {
+ if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
+ }
+ else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!addEnergyInputToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) {
+ Utils.LOG_INFO("False 2");
+ return false;
+ }
+ }
+ else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
+ }
+ else {
+ Utils.LOG_INFO("False 3");
+ return false;
+ }
+ }
+ }
+ }
+ }
+ if (this.mOutputHatches.size() != 0 || this.mInputHatches.size() != 0) {
+ Utils.LOG_INFO("Use Busses, Not Hatches for Input/Output.");
+ return false;
+ }
+ if (this.mInputBusses.size() != 2 || this.mOutputBusses.size() != 2) {
+ Utils.LOG_INFO("Incorrect amount of Input & Output busses.");
+ return false;
+ }
+ this.mMaintenanceHatches.clear();
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 4);
+ if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
+ if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) {
+ this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity());
+ ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
+ } else {
+ Utils.LOG_INFO("Maintenance hatch must be in the middle block on the back.");
+ return false;
+ }
+ }
+ if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1) {
+ Utils.LOG_INFO("Incorrect amount of Maintenance or Energy hatches.");
+ return false;
+ }
+ } else {
+ Utils.LOG_INFO("False 5");
+ return false;
+ }
+ Utils.LOG_INFO("True");
+ return true;
+ }
+
+ @Override
public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
+ return 10000;
+ }
- @Override
+ @Override
public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
+ return 0;
+ }
- @Override
+ @Override
public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
+ return 0;
+ }
- @Override
+ @Override
public int getAmountOfOutputs() {
- return 1;
- }
+ return 1;
+ }
- @Override
+ @Override
public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasingsMisc;
- }
-
-
- public byte getCasingMeta() {
- return 9;
- }
-
-
- public byte getCasingTextureIndex() {
- return 46;
- }
-
- private boolean addToMachineList(IGregTechTileEntity tTileEntity) {
- return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex())));
- }
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasingsMisc;
+ }
+
+
+ public byte getCasingMeta() {
+ return 6;
+ }
+
+
+ public byte getCasingTextureIndex() {
+ return 63;
+ }
+
+ private boolean addToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex())));
+ }
+
+ private boolean addEnergyInputToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addEnergyInputToMachineList(tTileEntity, getCasingTextureIndex())));
+ }
}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
new file mode 100644
index 0000000000..3c72955125
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
@@ -0,0 +1,238 @@
+package miscutil.core.xmod.gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+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 java.util.ArrayList;
+import java.util.Arrays;
+
+import miscutil.core.block.ModBlocks;
+import miscutil.core.util.Utils;
+import miscutil.core.xmod.gregtech.api.util.GregtechRecipe;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+import org.apache.commons.lang3.ArrayUtils;
+
+public class GregtechMetaTileEntityMassFabricator extends GT_MetaTileEntity_MultiBlockBase {
+
+ public static int sUUAperUUM = 1;
+ public static int sUUASpeedBonus = 4;
+ public static int sDurationMultiplier = 3215;
+ public static boolean sRequiresUUA = false;
+ //public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L);
+
+ public GregtechMetaTileEntityMassFabricator(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityMassFabricator(String aName) {
+ super(aName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Pyrolyse Oven",
+ "Industrial Charcoal producer and Oil from Plants",
+ "Size(WxHxD): 5x4x5, Controller (Bottom center)",
+ "3x1x3 Kanthal Heating Coils (Inside bottom 5x1x5 layer)",
+ "9x Kanthal Heating Coils (Centered 3x1x3 area in Bottom layer)",
+ "1x Input Hatch/Bus (Centered 3x1x3 area in Top layer)",
+ "1x Output Hatch/Bus (Any bottom layer casing)",
+ "1x Maintenance Hatch (Any bottom layer casing)",
+ "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
+ "1x Energy Hatch (Any bottom layer casing)",
+ "ULV Machine Casings for the rest (60 at least!)"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
+ }
+
+ public void onConfigLoad(GT_Config aConfig) {
+ super.onConfigLoad(aConfig);
+ sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
+ sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
+ sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
+ sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
+ Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ 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[]{});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ this.mOutputFluids = tRecipe.mFluidOutputs.clone();
+ ArrayUtils.reverse(mOutputFluids);
+ updateSlots();
+ Utils.LOG_INFO("Good Recipe");
+ return true;
+ }
+ }
+ }
+ }
+ Utils.LOG_INFO("Bad Recipe");
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
+ for (int i = -2; i < 3; i++) {
+ for (int j = -2; j < 3; j++) {
+ for (int h = 0; h < 4; h++) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne h�he
+ if (h == 0) {// innen boden (kantal coils)
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ } else if (h == 3) {// innen decke (ulv casings + input + muffler)
+ if ((!addInputToMachineList(tTileEntity, 66)) && (!addMufflerToMachineList(tTileEntity, 66))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ }
+ } else {// innen air
+ if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ }
+ } else {// Au�erer 5x5 ohne h�he
+ if (h == 0) {// au�en boden (controller, output, energy, maintainance, rest ulv casings)
+ if ((!addMaintenanceToMachineList(tTileEntity, 66)) && (!addOutputToMachineList(tTileEntity, 66)) && (!addEnergyInputToMachineList(tTileEntity, 66))) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {//no controller
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ }
+ }
+ } else {// au�en �ber boden (ulv casings)
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ Utils.LOG_INFO("Multiblock Formed.");
+ return true;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 20;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityMassFabricator(this.mName);
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/miscutil/core/xmod/gregtech/recipes/GregtechRecipeAdder.java
new file mode 100644
index 0000000000..0e422f32d3
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -0,0 +1,136 @@
+package miscutil.core.xmod.gregtech.recipes;
+
+import gregtech.api.GregTech_API;
+import miscutil.core.util.Utils;
+import miscutil.core.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
+import miscutil.core.xmod.gregtech.api.util.GregtechRecipe;
+import miscutil.core.xmod.gregtech.recipes.machines.RECIPEHANDLER_CokeOven;
+import miscutil.core.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
+
+
+
+ @Override
+ public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, 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);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (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);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (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);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (NullPointerException e){e.getStackTrace();}
+ 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);
+ }
+ 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);
+ }
+ RECIPEHANDLER_CokeOven.debug5(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
+
+ return true;
+
+ } catch (NullPointerException e){
+ return false;
+ }
+ } catch (Throwable e){
+ 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("Failed.");
+ e.getStackTrace();
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addMattrFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) {
+ try {
+ try {
+ RECIPEHANDLER_MatterFabricator.debug1();
+ if (aFluidOutput == null) {
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (NullPointerException e){e.getStackTrace();}
+ try {
+ RECIPEHANDLER_MatterFabricator.debug2(aFluidInput, aFluidOutput, aDuration, aEUt);
+ if ((aFluidOutput == null)/* && ((aDuration = GregTech_API.sRecipeFile.get("matterfab", null, aDuration)) <= 0)*/) {
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (NullPointerException e){e.getStackTrace();}
+ /*try {
+
+ RECIPEHANDLER_MatterFabricator.debug3(aFluidInput, aFluidOutput, aDuration, aEUt);
+ if ((aFluidOutput == null) && ((aDuration = GregTech_API.sRecipeFile.get("matterfab", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (NullPointerException e){e.getStackTrace();}*/
+ 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);
+ }
+ 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);
+ }
+ RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
+
+ return true;
+
+ } catch (NullPointerException e){
+ return false;
+ }
+ } catch (Throwable e){
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Failed.");
+ e.getStackTrace();
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) {
+ if (aInput1 == null) {
+ Utils.LOG_INFO("Fuel Input is Invalid.");
+ return false;
+ }
+ new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
+ return true;
+ }
+
+
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java b/src/Java/miscutil/core/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java
new file mode 100644
index 0000000000..cbb17b009f
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java
@@ -0,0 +1,46 @@
+package miscutil.core.xmod.gregtech.recipes.machines;
+
+import miscutil.core.util.Utils;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class RECIPEHANDLER_CokeOven {
+
+ public static void debug1(){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Walking Through CokeOven Recipe Creation.");
+ Utils.LOG_WARNING("My name is Ralph 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){
+ Utils.LOG_INFO("Successfully added a Coke Oven recipe for: "+aOutput.getDisplayName()+" & "+aFluidOutput.getFluid().getName()+", Using "+aInput1.getDisplayName()+" & "+aInput2.getDisplayName()+" & liquid "+aFluidInput.getFluid().getName()+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java b/src/Java/miscutil/core/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java
new file mode 100644
index 0000000000..053f268083
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java
@@ -0,0 +1,45 @@
+package miscutil.core.xmod.gregtech.recipes.machines;
+
+import miscutil.core.util.Utils;
+import net.minecraftforge.fluids.FluidStack;
+
+public class RECIPEHANDLER_MatterFabricator {
+
+ public static void debug1(){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Walking Through Matter Fabrication Recipe Creation.");
+ Utils.LOG_WARNING("My name is Ralph and I will be your humble host.");
+ }
+ public static void debug2(FluidStack aFluidInput, FluidStack aFluidOutput, 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("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Passed.");
+ }
+ public static void debug3(FluidStack aFluidInput, FluidStack aFluidOutput, 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("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Passed.");
+ }
+ public static void debug4(FluidStack aFluidInput, FluidStack aFluidOutput, 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("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Passed.");
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+
+ }
+ public static void debug5(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){
+ Utils.LOG_INFO("Successfully added a Matter Fabrication recipe for: "+aFluidOutput.getFluid().getName()+", Using "+" liquid "+aFluidInput.getFluid().getName()+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ }
+
+}