aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java39
-rw-r--r--src/Java/miscutil/core/util/fluid/FluidUtils.java12
-rw-r--r--src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java22
-rw-r--r--src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java623
-rw-r--r--src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java799
-rw-r--r--src/Java/miscutil/xmod/gregtech/api/util/GregtechRecipe.java19
-rw-r--r--src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java43
-rw-r--r--src/Java/miscutil/xmod/gregtech/registration/gregtech/GregtechDehydrator.java99
8 files changed, 1629 insertions, 27 deletions
diff --git a/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java b/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java
index b5d2763f7c..f4d55102b7 100644
--- a/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java
@@ -12,6 +12,7 @@ import miscutil.core.util.Utils;
import miscutil.core.util.fluid.FluidUtils;
import miscutil.core.util.item.UtilsItems;
import miscutil.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.item.ItemStack;
public class RECIPES_GREGTECH {
@@ -27,6 +28,7 @@ public class RECIPES_GREGTECH {
distilleryRecipes();
extractorRecipes();
chemicalBathRecipes();
+ dehydratorRecipes();
addFuels();
}
@@ -92,7 +94,7 @@ public class RECIPES_GREGTECH {
try {
- CORE.RA.addMattrFabricatorRecipe(
+ CORE.RA.addMatterFabricatorRecipe(
Materials.UUAmplifier.getFluid(1L), //Fluid Input
Materials.UUMatter.getFluid(1L), //Fluid Output
800, //Time in ticks
@@ -100,7 +102,7 @@ public class RECIPES_GREGTECH {
}catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
try {
- CORE.RA.addMattrFabricatorRecipe(
+ CORE.RA.addMatterFabricatorRecipe(
null, //Fluid Input
Materials.UUMatter.getFluid(1L), //Fluid Output
3200, //Time in ticks
@@ -108,6 +110,39 @@ public class RECIPES_GREGTECH {
}catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
}
+
+ private static void dehydratorRecipes(){
+ Utils.LOG_INFO("Loading Recipes for Chemical Dehydrator.");
+
+ try {
+
+ CORE.RA.addDehydratorRecipe(
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSteel", 8), //Item input (slot 1)
+ FluidUtils.getFluidStack("oxygen", 1000), //Fluid Input
+ new ItemStack[]{UtilsItems.getItemStackOfAmountFromOreDict("dustDiamond", 1)}, //Output Array of Items - Upto 9
+ 10*20, //Time in ticks
+ 30); //EU
+
+ CORE.RA.addDehydratorRecipe(
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSteel", 8), //Item input (slot 1)
+ UtilsItems.getItemStackOfAmountFromOreDict("dustRedstone", 8), //Item input (slot 2)
+ new ItemStack[]{UtilsItems.getItemStackOfAmountFromOreDict("dustDiamond", 1)}, //Output Array of Items - Upto 9
+ 10*20, //Time in ticks
+ 30); //EU
+
+ CORE.RA.addDehydratorRecipe(
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSteel", 8),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustRedstone", 8),
+ FluidUtils.getFluidStack("oxygen", 1000),
+ new ItemStack[]{UtilsItems.getItemStackOfAmountFromOreDict("dustDiamond", 1)}, //Output Array of Items - Upto 9
+ FluidUtils.getFluidStack("lava", 1000),
+ 10*20, //Time in ticks
+ 30); //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/util/fluid/FluidUtils.java b/src/Java/miscutil/core/util/fluid/FluidUtils.java
index 242a8c8a2f..8977b0e8ea 100644
--- a/src/Java/miscutil/core/util/fluid/FluidUtils.java
+++ b/src/Java/miscutil/core/util/fluid/FluidUtils.java
@@ -29,4 +29,16 @@ public class FluidUtils {
}
+ public static FluidStack[] getFluidStackArray(FluidStack fluidName, int amount){
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName);
+ try {
+ FluidStack[] singleFluid = {FluidRegistry.getFluidStack(fluidName.getLocalizedName(), amount)};
+ return singleFluid;
+ }
+ catch (Throwable e){
+ return null;
+ }
+
+ }
+
}
diff --git a/src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
index b39c206ecd..32d370d4b1 100644
--- a/src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
+++ b/src/Java/miscutil/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -31,6 +31,24 @@ public interface IGregtech_RecipeAdder {
* @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addMattrFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
-
+ public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
+
+
+
+
+ /**
+ * Adds a Recipe for the Sifter. (up to 9 Outputs)
+ *
+ * @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 addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);
+ public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt);
+ public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt);
+
+
}
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
new file mode 100644
index 0000000000..e051a54fb3
--- /dev/null
+++ b/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java
@@ -0,0 +1,623 @@
+package miscutil.xmod.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.enums.GT_Values.W;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Tier;
+import gregtech.api.gui.GT_Container_BasicMachine;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_ModHandler.RecipeBits;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Random;
+
+import miscutil.xmod.gregtech.api.util.GregtechRecipe.Gregtech_Recipe_Map;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This is the main construct for my Basic Machines such as the Automatic Extractor
+ * Extend this class to make a simple Machine
+ */
+public class GT_MTE_BasicMachine_Custom_Recipe extends GT_MTE_CustomRecipe_BasicMachine {
+ private final Gregtech_Recipe_Map mRecipes;
+ private final int mTankCapacity, mSpecialEffect;
+ private final String mSound;
+ private final boolean mSharedTank, mRequiresFluidForFiltering;
+ private final byte mGUIParameterA, mGUIParameterB;
+ public GT_MTE_BasicMachine_Custom_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, Gregtech_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) {
+ super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM"))});
+ mSharedTank = aSharedTank;
+ mTankCapacity = aTankCapacity;
+ mSpecialEffect = aSpecialEffect;
+ mRequiresFluidForFiltering = aRequiresFluidForFiltering;
+ mRecipes = aRecipes;
+ mSound = aSound;
+ mGUIParameterA = (byte) aGUIParameterA;
+ mGUIParameterB = (byte) aGUIParameterB;
+
+ if (aRecipe != null) {
+ for (int i = 3; i < aRecipe.length; i++) {
+ if (aRecipe[i] == X.CIRCUIT) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mManagingObject;
+ continue;
+ }
+ if (aRecipe[i] == X.BETTER_CIRCUIT) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mBetterManagingObject;
+ continue;
+ }
+ if (aRecipe[i] == X.HULL) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mHullObject;
+ continue;
+ }
+ if (aRecipe[i] == X.WIRE) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mConductingObject;
+ continue;
+ }
+ if (aRecipe[i] == X.WIRE4) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mLargerConductingObject;
+ continue;
+ }
+
+ if (aRecipe[i] == X.GLASS) {
+ switch (mTier) {
+ default:
+ aRecipe[i] = new ItemStack(Blocks.glass, 1, W);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.PLATE) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.Steel);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.Aluminium);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.StainlessSteel);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.Titanium);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.TungstenSteel);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.PIPE) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Bronze);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Steel);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.StainlessSteel);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Titanium);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.TungstenSteel);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.COIL_HEATING) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.AnyCopper);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Cupronickel);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Kanthal);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Nichrome);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.wireGt08.get(Materials.Nichrome);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.COIL_HEATING_DOUBLE) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.AnyCopper);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.Cupronickel);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.Kanthal);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.Nichrome);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.wireGt16.get(Materials.Nichrome);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.STICK_DISTILLATION) {
+ switch (mTier) {
+ default:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.Blaze);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.STICK_MAGNETIC) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.IronMagnetic);
+ break;
+ case 2:
+ case 3:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.SteelMagnetic);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.NeodymiumMagnetic);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.STICK_ELECTROMAGNETIC) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.AnyIron);
+ break;
+ case 2:
+ case 3:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.Steel);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.Neodymium);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.VanadiumGallium);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.COIL_ELECTRIC) {
+ switch (mTier) {
+ case 0:
+ aRecipe[i] = OrePrefixes.wireGt01.get(Materials.Tin);
+ break;
+ case 1:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Tin);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.AnyCopper);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.AnyCopper);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.wireGt08.get(Materials.AnnealedCopper);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.wireGt16.get(Materials.AnnealedCopper);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.ROBOT_ARM) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Robot_Arm_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Robot_Arm_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Robot_Arm_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Robot_Arm_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Robot_Arm_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Robot_Arm_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Robot_Arm_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Robot_Arm_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.PUMP) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Electric_Pump_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Electric_Pump_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Electric_Pump_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Electric_Pump_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Electric_Pump_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Electric_Pump_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Electric_Pump_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Electric_Pump_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.ROTOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.Tin);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.Bronze);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.Steel);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.StainlessSteel);
+ break;
+ case 5:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel);
+ break;
+ case 6:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel);
+ break;
+ case 7:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.MOTOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Electric_Motor_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Electric_Motor_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Electric_Motor_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Electric_Motor_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Electric_Motor_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Electric_Motor_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Electric_Motor_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Electric_Motor_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.PISTON) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Electric_Piston_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Electric_Piston_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Electric_Piston_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Electric_Piston_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Electric_Piston_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Electric_Piston_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Electric_Piston_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Electric_Piston_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.CONVEYOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Conveyor_Module_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Conveyor_Module_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Conveyor_Module_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Conveyor_Module_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Conveyor_Module_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Conveyor_Module_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Conveyor_Module_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Conveyor_Module_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.EMITTER) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Emitter_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Emitter_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Emitter_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Emitter_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Emitter_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Emitter_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Emitter_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Emitter_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.SENSOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Sensor_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Sensor_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Sensor_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Sensor_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Sensor_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Sensor_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Sensor_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Sensor_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.FIELD_GENERATOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Field_Generator_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Field_Generator_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Field_Generator_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Field_Generator_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Field_Generator_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Field_Generator_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Field_Generator_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Field_Generator_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] instanceof X)
+ throw new IllegalArgumentException("MISSING TIER MAPPING FOR: " + aRecipe[i] + " AT TIER " + mTier);
+ }
+
+ if (!GT_ModHandler.addCraftingRecipe(getStackForm(1), RecipeBits.DISMANTLEABLE | RecipeBits.BUFFERED | RecipeBits.NOT_REMOVABLE | RecipeBits.REVERSIBLE, aRecipe)) {
+ throw new IllegalArgumentException("INVALID CRAFTING RECIPE FOR: " + getStackForm(1).getDisplayName());
+ }
+ }
+ }
+
+ public GT_MTE_BasicMachine_Custom_Recipe(String aName, int aTier, String aDescription, Gregtech_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) {
+ super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName);
+ mSharedTank = aSharedTank;
+ mTankCapacity = aTankCapacity;
+ mSpecialEffect = aSpecialEffect;
+ mRequiresFluidForFiltering = aRequiresFluidForFiltering;
+ mRecipes = aRecipes;
+ mSound = aSound;
+ mGUIParameterA = (byte) aGUIParameterA;
+ mGUIParameterB = (byte) aGUIParameterB;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MTE_BasicMachine_Custom_Recipe(mName, mTier, mDescription, mRecipes, mInputSlotCount, mOutputItems == null ? 0 : mOutputItems.length, mTankCapacity, mAmperage, mGUIParameterA, mGUIParameterB, mTextures, mGUIName, mNEIName, mSound, mSharedTank, mRequiresFluidForFiltering, mSpecialEffect);
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_BasicMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "", mGUIParameterA, mGUIParameterB);
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false;
+ if (mInventory[aIndex] != null) return true;
+ switch (mInputSlotCount) {
+ case 0: return false;
+ case 1: return getFillableStack() == null ? !mRequiresFluidForFiltering && getRecipeList().containsInput(aStack) : null!=getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[] {getFillableStack()}, getSpecialSlot(), new ItemStack[] {aStack});
+ case 2: return (!mRequiresFluidForFiltering || getFillableStack() != null) && (((getInputAt(0)!=null&&getInputAt(1)!=null) || (getInputAt(0)==null&&getInputAt(1)==null?getRecipeList().containsInput(aStack):(getRecipeList().containsInput(aStack)&&null!=getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[] {getFillableStack()}, getSpecialSlot(), aIndex == getInputSlot() ? new ItemStack[] {aStack, getInputAt(1)} : new ItemStack[] {getInputAt(0), aStack})))));
+ default: return getRecipeList().containsInput(aStack);
+ }
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) {
+ switch (mSpecialEffect) {
+ case 0:
+ break;
+ case 1:
+ if (aBaseMetaTileEntity.getFrontFacing() != 1 && aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0 && !aBaseMetaTileEntity.getOpacityAtSide((byte) 1)) {
+ Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D);
+ }
+ break;
+ }
+ }
+ }
+
+
+ public Gregtech_Recipe_Map getRecipeList() {
+ return mRecipes;
+ }
+
+ @Override
+ public int getCapacity() {
+ return mTankCapacity;
+ }
+
+ @Override
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1 && GT_Utility.isStringValid(mSound)) GT_Utility.doSoundAtClient(mSound, 100, 1.0F, aX, aY, aZ);
+ }
+
+ @Override
+ public void startProcess() {
+ if (GT_Utility.isStringValid(mSound)) sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public FluidStack getFillableStack() {
+ return mSharedTank ? getDrainableStack() : super.getFillableStack();
+ }
+
+ @Override
+ public FluidStack setFillableStack(FluidStack aFluid) {
+ return mSharedTank ? setDrainableStack(aFluid) : super.setFillableStack(aFluid);
+ }
+
+ @Override
+ protected boolean displaysOutputFluid() {
+ return !mSharedTank;
+ }
+
+ public static enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC;}
+} \ No newline at end of file
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
new file mode 100644
index 0000000000..a3042a4144
--- /dev/null
+++ b/src/Java/miscutil/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java
@@ -0,0 +1,799 @@
+package miscutil.xmod.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_Container_BasicMachine;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_OreDictUnificator;
+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 net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidHandler;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This is the main construct for my Basic Machines such as the Automatic Extractor
+ * Extend this class to make a simple Machine
+ */
+public abstract class GT_MTE_CustomRecipe_BasicMachine extends GT_MetaTileEntity_BasicTank {
+ /**
+ * return values for checkRecipe()
+ */
+ protected static final int
+ DID_NOT_FIND_RECIPE = 0,
+ FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
+ FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
+ private static final int OTHER_SLOT_COUNT = 4;
+ public final ItemStack[] mOutputItems;
+ public final int mInputSlotCount, mAmp