aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/gregtech/api/util/Recipe_GT.java1
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java1
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java7
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java7
-rw-r--r--src/Java/gtPlusPlus/core/material/ALLOY.java16
-rw-r--r--src/Java/gtPlusPlus/core/util/item/UtilsItems.java4
-rw-r--r--src/Java/gtPlusPlus/core/util/math/MathUtils.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java623
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java799
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipe_OLD.java781
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java14
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java (renamed from src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastFurnace.java)69
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java169
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java120
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java1
20 files changed, 369 insertions, 2293 deletions
diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java
index 64e3dd9a35..979a6f17e5 100644
--- a/src/Java/gregtech/api/util/Recipe_GT.java
+++ b/src/Java/gregtech/api/util/Recipe_GT.java
@@ -235,6 +235,7 @@ public class Recipe_GT extends GT_Recipe{
public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true);
public static final Gregtech_Recipe_Map_Fuel sGeoThermalFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
public static final GT_Recipe_Map sChemicalDehydratorRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicaldehydrator", "Chemical Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sAlloyBlastSmelterRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/Dehydrator", 9, 1, 1, 0, 1, E, 1, E, true, true);
/**
* HashMap of Recipes based on their Items
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
index fd8d7a634c..4bb8a12836 100644
--- a/src/Java/gtPlusPlus/GTplusplus.java
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -169,6 +169,7 @@ implements ActionListener
dumpGtRecipeMap(Gregtech_Recipe_Map.sCokeOvenRecipes);
dumpGtRecipeMap(Gregtech_Recipe_Map.sMatterFab2Recipes);
}
+ dumpGtRecipeMap(Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes);
//~
ReflectionUtils.becauseIWorkHard();
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 1a407e1fc6..e77f457487 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -236,10 +236,13 @@ public final class ModItems {
generateItemsFromMaterial(ELEMENT.ZIRCONIUM);
generateItemsFromMaterial(ALLOY.ZIRCONIUM_CARBIDE);
generateItemsFromMaterial(ALLOY.TANTALUM_CARBIDE);
- generateItemsFromMaterial(ALLOY.NIOBIUM_CARBIDE);
+ generateItemsFromMaterial(ALLOY.NIOBIUM_CARBIDE);
+
+ //Leagrisium
+ generateItemsFromMaterial(ALLOY.LEAGRISIUM);
//Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle.
- UtilsItems.generateItemsFromMaterial(ELEMENT.URANIUM233);
+ generateItemsFromMaterial(ELEMENT.URANIUM233);
} catch (Throwable r){
Utils.LOG_INFO("Failed to Generated a Material. "+r.getMessage());
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
index 46e727edd1..079e3cfc39 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
@@ -179,7 +179,7 @@ public class StaballoyPickaxe extends ItemPickaxe{
//Break Tool
- if ((durNow-dodmg) <= (900) && itemdmg != 0){
+ if ((durNow-dodmg) <= (99) && itemdmg != 0){
//TODO break tool
Utils.LOG_INFO("Breaking Tool");
heldItem.stackSize = 0;
@@ -315,8 +315,9 @@ public class StaballoyPickaxe extends ItemPickaxe{
@Override
public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
thisPickaxe = stack;
- list.add(EnumChatFormatting.GOLD+"Mines a 3x3 area in the direction you are facing.");
- super.addInformation(stack, aPlayer, list, bool);
+ list.add(EnumChatFormatting.GRAY+"Mines a 3x3 at 100 durability per block mined.");
+ list.add(EnumChatFormatting.GRAY+"Durability: "+(stack.getMaxDamage()-stack.getItemDamage())+"/"+stack.getMaxDamage());
+ //super.addInformation(stack, aPlayer, list, bool);
}
@Override
diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java
index ea5b90259f..e2648c667e 100644
--- a/src/Java/gtPlusPlus/core/material/ALLOY.java
+++ b/src/Java/gtPlusPlus/core/material/ALLOY.java
@@ -495,6 +495,22 @@ public final class ALLOY {
new MaterialStack(ELEMENT.CARBON, 50),
new MaterialStack(ELEMENT.NIOBIUM, 50)
});
+
+
+ public static final Material LEAGRISIUM = new Material(
+ "Grisium", //Material Name
+ new short[]{53, 93, 106, 0}, //Material Colour
+ 9001, //Melting Point in C
+ 25000, //Boiling Point in C
+ 96, //Protons
+ 128, //Neutrons
+ true, //Uses Blast furnace?
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.NICKEL, 25),
+ new MaterialStack(ELEMENT.CHROMIUM, 25),
+ new MaterialStack(ELEMENT.IRON, 25),
+ new MaterialStack(ELEMENT.TUNGSTEN, 25)
+ }); //Material Stacks with Percentage of required elements.
}
diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
index b067be1c24..dcc73860d0 100644
--- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
+++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
@@ -557,5 +557,9 @@ public class UtilsItems {
return itemNames;
}
+
+ public static ItemStack getGregtechCircuit(int Meta){
+ return UtilsItems.getItemStackWithMeta(LoadedMods.Gregtech, "gregtech:gt.integrated_circuit", "Gregtech Circuit", Meta, 0);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
index 8fab1341d3..75d8452975 100644
--- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java
+++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
@@ -29,6 +29,11 @@ public class MathUtils {
return randomNum;
}
+ public static double getChanceOfXOverYRuns(double x, double y){
+ double z = (1-Math.pow((1-x), y));
+ return z;
+ }
+
/**
* Returns a psuedo-random number between min and max, inclusive.
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 8140839cac..2ee8fea9d4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -8,6 +8,7 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks;
import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelter;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits;
public class HANDLER_GT {
@@ -36,6 +37,7 @@ public class HANDLER_GT {
GregtechConduits.run();
new MetaGeneratedGregtechTools();
new ProcessingToolHeadChoocher().run();
+ RecipeGen_BlastSmelter.generateRecipes();
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 6576e1c0d9..e69ab529c6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -70,7 +70,7 @@ public enum GregtechItemList implements GregtechItemContainer {
//Unused Machine Casings
Casing_MacerationStack, Casing_MatterGen, Casing_MatterFab, Casing_U7,
//Unused Machine Coils
- Casing_Coil_U1, Casing_Coil_U2, Casing_Coil_U3, Casing_Coil_U4,
+ Casing_Coil_U1, Casing_Coil_U2, Casing_Coil_BlastSmelter, Casing_BlastSmelter,
//Windmill Shaft Shape for Extruder
Shape_Extruder_WindmillShaft,
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
index 3b876e6d93..73e7a5d56f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -66,4 +66,17 @@ public interface IGregtech_RecipeAdder {
*/
public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt);
+
+ /**
+ * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
+ *
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aChances = Output Change (can be == 0)
+ * @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 addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt);
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java
deleted file mode 100644
index c7f84f1095..0000000000
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java
+++ /dev/null
@@ -1,623 +0,0 @@
-package gtPlusPlus.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 gtPlusPlus.xmod.gregtech.api.util.GregtechRecipe_OLD.Gregtech_Recipe_Map;
-
-import java.util.Random;
-
-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/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java
deleted file mode 100644
index 521b23a42e..0000000000
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java
+++ /dev/null
@@ -1,799 +0,0 @@
-package gtPlusPlus.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 gtPlusPlus.xmod.gregtech.api.util.GregtechRecipe_OLD;
-import gtPlusPlus.xmod.gregtech.api.util.GregtechRecipe_OLD.Gregtech_Recipe_Map;
-
-import java.util.Arrays;
-
-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, mAmperage;
- public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false;
- public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0;
- public FluidStack mOutputFluid;
- public String mGUIName = "", mNEIName = "";
- private NBTTagCompound mRecipeStuff = new NBTTagCompound();
- /**
- * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered
- */
- protected GregtechRecipe_OLD mLastRecipe = null;
- private FluidStack mFluidOut;
-
- /**
- * @param aOverlays 0 = SideFacingActive
- * 1 = SideFacingInactive
- * 2 = FrontFacingActive
- * 3 = FrontFacingInactive
- * 4 = TopFacingActive
- * 5 = TopFacingInactive
- * 6 = BottomFacingActive
- * 7 = BottomFacingInactive
- * ----- Not all Array Elements have to be initialised, you can also just use 8 Parameters for the Default Pipe Texture Overlays -----
- * 8 = BottomFacingPipeActive
- * 9 = BottomFacingPipeInactive
- * 10 = TopFacingPipeActive
- * 11 = TopFacingPipeInactive
- * 12 = SideFacingPipeActive
- * 13 = SideFacingPipeInactive
- */
- public GT_MTE_CustomRecipe_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, ITexture... aOverlays) {
- super(aID, aName, aNameRegional, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aOverlays);
- mInputSlotCount = Math.max(0, aInputSlotCount);
- mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
- mAmperage = aAmperage;
- mGUIName = aGUIName;
- mNEIName = aNEIName;
- }
-
- public GT_MTE_CustomRecipe_BasicMachine(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
- super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures);
- mInputSlotCount = Math.max(0, aInputSlotCount);
- mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
- mAmperage = aAmperage;
- mGUIName = aGUIName;
- mNEIName = aNEIName;
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- ITexture[][][] rTextures = new ITexture[14][17][];
- aTextures = Arrays.copyOf(aTextures, 14);
-
- for (int i = 0; i < aTextures.length; i++)
- if (aTextures[i] != null) for (byte c = -1; c < 16; c++) {
- if (rTextures[i][c + 1] == null)
- rTextures[i][c + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i]};
- }
-
- for (byte c = -1; c < 16; c++) {
- if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c);
- if (rTextures[1][c + 1] == null) rTextures[1][c + 1] = getSideFacingInactive(c);
- if (rTextures[2][c + 1] == null) rTextures[2][c + 1] = getFrontFacingActive(c);
- if (rTextures[3][c + 1] == null) rTextures[3][c + 1] = getFrontFacingInactive(c);
- if (rTextures[4][c + 1] == null) rTextures[4][c + 1] = getTopFacingActive(c);
- if (rTextures[5][c + 1] == null) rTextures[5][c + 1] = getTopFacingInactive(c);
- if (rTextures[6][c + 1] == null) rTextures[6][c + 1] = getBottomFacingActive(c);
- if (rTextures[7][c + 1] == null) rTextures[7][c + 1] = getBottomFacingInactive(c);
- if (rTextures[8][c + 1] == null) rTextures[8][c + 1] = getBottomFacingPipeActive(c);
- if (rTextures[9][c + 1] == null) rTextures[9][c + 1] = getBottomFacingPipeInactive(c);
- if (rTextures[10][c + 1] == null) rTextures[10][c + 1] = getTopFacingPipeActive(c);
- if (rTextures[11][c + 1] == null) rTextures[11][c + 1] = getTopFacingPipeInactive(c);
- if (rTextures[12][c + 1] == null) rTextures[12][c + 1] = getSideFacingPipeActive(c);
- if (rTextures[13][c + 1] == null) rTextures[13][c + 1] = getSideFacingPipeInactive(c);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return mTextures[mMainFacing < 2 ? aSide == aFacing ? aActive ? 2 : 3 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 : aSide == mMainFacing ? aActive ? 2 : 3 : (showPipeFacing() && aSide == aFacing) ? aSide == 0 ? aActive ? 8 : 9 : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][aColorIndex + 1];
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isElectric() {
- return true;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return mMainFacing > 1 || aFacing > 1;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return aSide != mMainFacing;
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return false;
- }
-
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- @Override
- public boolean isLiquidInput(byte aSide) {
- return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing());
- }
-
- @Override
- public boolean isLiquidOutput(byte aSide) {
- return aSide != mMainFacing;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return V[mTier] * 16;
- }
-
- @Override
- public long maxEUStore() {
- return V[mTier] * 64;
- }
-
- @Override
- public long maxEUInput() {
- return V[mTier];
- }
-
- @Override
- public long maxSteamStore() {
- return maxEUStore();
- }
-
- @Override
- public long maxAmperesIn() {
- return (mEUt * 2) / V[mTier] + 1;
- }
-
- @Override
- public int getInputSlot() {
- return OTHER_SLOT_COUNT;
- }
-
- @Override
- public int getOutputSlot() {
- return OTHER_SLOT_COUNT + mInputSlotCount;
- }
-
- @Override
- public int getStackDisplaySlot() {
- return 2;
- }
-
- @Override
- public int rechargerSlotStartIndex() {
- return 1;
- }
-
- @Override
- public int dechargerSlotStartIndex() {
- return 1;
- }
-
- @Override
- public int rechargerSlotCount() {
- return mCharge ? 1 : 0;
- }
-
- @Override
- public int dechargerSlotCount() {
- return mDecharge ? 1 : 0;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public int getProgresstime() {
- return mProgresstime;
- }
-
- @Override
- public int maxProgresstime() {
- return mMaxProgresstime;
- }
-
- @Override
- public int increaseProgress(int aProgress) {
- mProgresstime += aProgress;
- return mMaxProgresstime - mProgresstime;
- }
-
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
- }
-
- @Override
- public boolean isFluidChangingAllowed() {
- return true;
- }
-
- @Override
- public boolean doesFillContainers() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return false;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return true;
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return true;
- }
-
- @Override
- public boolean displaysItemStack() {
- return true;
- }
-
- @Override
- public boolean displaysStackSize() {
- return true;
- }
-
- @Override
- public FluidStack getDisplayedFluid() {
- return displaysOutputFluid() ? getDrainableStack() : null;
- }
-
- @Override
- public FluidStack getDrainableStack() {
- return mFluidOut;
- }
-
- @Override
- public FluidStack setDrainableStack(FluidStack aFluid) {
- mFluidOut = aFluid;
- return mFluidOut;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @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 : "");
- }
-
- @Override
- public void initDefaultModes(NBTTagCompound aNBT) {
- mMainFacing = -1;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mFluidTransfer", mFluidTransfer);
- aNBT.setBoolean("mItemTransfer", mItemTransfer);
- aNBT.setBoolean("mHasBeenUpdated", mHasBeenUpdated);
- aNBT.setBoolean("mAllowInputFromOutputSide", mAllowInputFromOutputSide);
- aNBT.setInteger("mEUt", mEUt);
- aNBT.setInteger("mMainFacing", mMainFacing);
- aNBT.setInteger("mProgresstime", mProgresstime);
- aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
- aNBT.setTag("GT.CraftingComponents", mRecipeStuff);
- if (mOutputFluid != null) aNBT.setTag("mOutputFluid", mOutputFluid.writeToNBT(new NBTTagCompound()));
- if (mFluidOut != null) aNBT.setTag("mFluidOut", mFluidOut.writeToNBT(new NBTTagCompound()));
-
- for (int i = 0; i < mOutputItems.length; i++)
- if (mOutputItems[i] != null)
- aNBT.setTag("mOutputItem" + i, mOutputItems[i].writeToNBT(new NBTTagCompound()));
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mFluidTransfer = aNBT.getBoolean("mFluidTransfer");
- mItemTransfer = aNBT.getBoolean("mItemTransfer");
- mHasBeenUpdated = aNBT.getBoolean("mHasBeenUpdated");
- mAllowInputFromOutputSide = aNBT.getBoolean("mAllowInputFromOutputSide");
- mEUt = aNBT.getInteger("mEUt");
- mMainFacing = aNBT.getInteger("mMainFacing");
- mProgresstime = aNBT.getInteger("mProgresstime");
- mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents");
- mOutputFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid"));
- mFluidOut = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluidOut"));
-
- for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- if (aBaseMetaTileEntity.isServerSide()) {
- mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3;
- mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
-
- doDisplayThings();
-
- boolean tSucceeded = false;
-
- if (mMaxProgresstime > 0 && (mProgresstime >= 0 || aBaseMetaTileEntity.isAllowedToWork())) {
- aBaseMetaTileEntity.setActive(true);
- if (mProgresstime < 0 || drainEnergyForProcess(mEUt)) {
- if (++mProgresstime >= mMaxProgresstime) {
- for (int i = 0; i < mOutputItems.length; i++)
- for (int j = 0; j < mOutputItems.length; j++)
- if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i]))
- break;
- if (mOutputFluid != null)
- if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy());
- else if (mOutputFluid.isFluidEqual(getDrainableStack()))
- getDrainableStack().amount += mOutputFluid.amount;
- for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = null;
- mOutputFluid = null;
- mEUt = 0;
- mProgresstime = 0;
- mMaxProgresstime = 0;
- mStuttering = false;
- tSucceeded = true;
- endProcess();
- }
- if (mProgresstime > 5) mStuttering = false;
- } else {
- if (!mStuttering) {
- stutterProcess();
- if (canHaveInsufficientEnergy()) mProgresstime = -100;
- mStuttering = true;
- }
- }
- } else {
- aBaseMetaTileEntity.setActive(false);
- }
-
- boolean tRemovedOutputFluid = false;
-
- if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) {
- IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
- if (tTank != null) {
- FluidStack tDrained = drain(1000, false);
- if (tDrained != null) {
- int tFilledAmount = tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
- if (tFilledAmount > 0)
- tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), drain(tFilledAmount, true), true);
- }
- }
- if (getDrainableStack() == null) tRemovedOutputFluid = true;
- }
-
- if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0)) {
- TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing());
- for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) {
- tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true);
- }
- }
-
- if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0;
- else mOutputBlocked++;
-
- if (allowToCheckRecipe()) {
- if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) {
- if (checkRecipe() == 2) {
- if (mInventory[3] != null && mInventory[3].stackSize <= 0) mInventory[3] = null;
- for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
- if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null;
- for (int i = 0; i < mOutputItems.length; i++) {
- mOutputItems[i] = GT_Utility.copy(mOutputItems[i]);
- if (mOutputItems[i] != null && mOutputItems[i].stackSize > 64)
- mOutputItems[i].stackSize = 64;
- mOutputItems[i] = GT_OreDictUnificator.get(true, mOutputItems[i]);
- }
- if (mFluid != null && mFluid.amount <= 0) mFluid = null;
- mMaxProgresstime = Math.max(1, mMaxProgresstime);
- if (GT_Utility.isDebugItem(mInventory[dechargerSlotStartIndex()])) {
- mEUt = mMaxProgresstime = 1;
- }
- startProcess();
- } else {
- mMaxProgresstime = 0;
- for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = null;
- mOutputFluid = null;
- }
- }
- } else {
- if (!mStuttering) {
- stutterProcess();
- mStuttering = true;
- }
- }
- }
- }
-
- protected void doDisplayThings() {
- if (mMainFacing < 2 && getBaseMetaTileEntity().getFrontFacing() > 1) {
- mMainFacing = getBaseMetaTileEntity().getFrontFacing();
- }
- if (mMainFacing >= 2 && !mHasBeenUpdated) {
- mHasBeenUpdated = true;
- getBaseMetaTileEntity().setFrontFacing(getBaseMetaTileEntity().getBackFacing());
- }
-
- if (displaysInputFluid()) {
- int tDisplayStackSlot = OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
- if (getFillableStack() == null) {
- if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true))
- mInventory[tDisplayStackSlot] = null;
- } else {
- mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize());
- }
- }
- }
-
- protected boolean hasEnoughEnergyToCheckRecipe() {
- return getBaseMetaTileEntity().isUniversalEnergyStored(getMinimumStoredEU() / 2);
- }
-
- protected boolean drainEnergyForProcess(long aEUt) {
- return getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEUt, false);
- }
-
- protected void calculateOverclockedNess(GregtechRecipe_OLD tRecipe) {
- calculateOverclockedNess(tRecipe.mEUt, tRecipe.mDuration);
- }
-
- protected void calculateOverclockedNess(int aEUt, int aDuration) {
- if (aEUt <= 16) {
- mEUt = aEUt * (1 << (mTier - 1)) * (1 << (mTier - 1));
- mMaxProgresstime = aDuration / (1 << (mTier - 1));
- } else {
- mEUt = aEUt;
- mMaxProgresstime = aDuration;
- while (mEUt <= V[mTier - 1] * mAmperage) {
- mEUt *= 4;
- mMaxProgresstime /= 2;
- }
- }
- }
-
- protected ItemStack getSpecialSlot() {
- return mInventory[3];
- }
-
- protected ItemStack getOutputAt(int aIndex) {
- return mInventory[getOutputSlot() + aIndex];
- }
-
- protected ItemStack[] getAllOutputs() {
- ItemStack[] rOutputs = new ItemStack[mOutputItems.length];
- for (int i = 0; i < mOutputItems.length; i++) rOutputs[i] = getOutputAt(i);
- return rOutputs;
- }
-
- protected boolean canOutput(GregtechRecipe_OLD tRecipe) {
- return tRecipe != null && (tRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null : canOutput(tRecipe.getFluidOutput(0)) && canOutput(tRecipe.mOutputs));
- }
-
- protected boolean canOutput(ItemStack... aOutputs) {
- if (aOutputs == null) return true;
- ItemStack[] tOutputSlots = getAllOutputs();
- for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++)
- if (tOutputSlots[i] != null && aOutputs[i] != null && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) {
- mOutputBlocked++;
- return false;
- }
- return true;
- }
-
- protected boolean canOutput(FluidStack aOutput) {
- return getDrainableStack() == null || aOutput == null || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0 || getDrainableStack().amount + aOutput.amount <= getCapacity()));
- }
-
- protected ItemStack getInputAt(int aIndex) {
- return mInventory[getInputSlot() + aIndex];
- }
-
- protected ItemStack[] getAllInputs() {
- ItemStack[] rInputs = new ItemStack[mInputSlotCount];
- for (int i = 0; i < mInputSlotCount; i++) rInputs[i] = getInputAt(i);
- return rInputs;
- }
-
- protected boolean isOutputEmpty() {
- boolean rIsEmpty = true;
- for (ItemStack tOutputSlotContent : getAllOutputs()) if (tOutputSlotContent != null) rIsEmpty = false;
- return rIsEmpty;
- }
-
- protected boolean displaysInputFluid() {
- return true;
- }
-
- protected boolean displaysOutputFluid() {
- return true;
- }
-
- @Override
- public void onValueUpdate(byte aValue) {
- mMainFacing = aValue;
- }
-
- @Override
- public byte getUpdateData() {
- return (byte) mMainFacing;
- }
-
- @Override
- public void doSound(byte aIndex, double aX, double aY, double aZ) {
- super.doSound(aIndex, aX, aY, aZ);
- if (aIndex == 8) GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(210), 100, 1.0F, aX, aY, aZ);
- }
-
- public boolean doesAutoOutput() {
- return mItemTransfer;
- }
-
- public boolean doesAutoOutputFluids() {
- return mFluidTransfer;
- }
-
- public boolean allowToCheckRecipe() {
- return true;
- }
-
- public boolean showPipeFacing() {
- return true;
- }
-
- /**
- * Called whenever the Machine successfully started a Process, useful for Sound Effects
- */
- public void startProcess() {
- //
- }
-
- /**
- * Called whenever the Machine successfully finished a Process, useful for Sound Effects
- */
- public void endProcess() {
- //
- }
-
- /**
- * Called whenever the Machine aborted a Process, useful for Sound Effects
- */
- public void abortProcess() {
- //
- }
-
- /**
- * Called whenever the Machine aborted a Process but still works on it, useful for Sound Effects
- */
- public void stutterProcess() {
- if (useStandardStutterSound()) sendSound((byte) 8);
- }
-
- /**
- * If this Machine can have the Insufficient Energy Line Problem
- */
- public boolean canHaveInsufficientEnergy() {
- return true;
- }
-
- public boolean useStandardStutterSound() {
- return true;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[]{
- mRecipeStuff.toString(),
- mNEIName,
- "Progress:", (mProgresstime / 20) + " secs",
- (mMaxProgresstime / 20) + " secs",
- "Stored Energy:",
- getBaseMetaTileEntity().getStoredEU() + "EU",
- getBaseMetaTileEntity().getEUCapacity() + "EU"};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) {
- mAllowInputFromOutputSide = !mAllowInputFromOutputSide;
- GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? "Input from Output Side allowed" : "Input from Output Side forbidden");
- }
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
- return (aSide != mMainFacing || GregTech_API.getCoverBehavior(aCoverID.toStack()).isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity()));
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aSide != mMainFacing && aIndex >= getOutputSlot() && aIndex < getOutputSlot() + mOutputItems.length;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (aSide == mMainFacing || aIndex < getInputSlot() || aIndex >= getInputSlot() + mInputSlotCount || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing()))
- return false;
- for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
- if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i])) return i == aIndex;
- return true;
- }
-
- /**
- * @return the Recipe List which is used for this Machine, this is a useful Default Handler
- */
- public Gregtech_Recipe_Map getRecipeList() {
- return null;
- }
-
- /**
- * Override this to check the Recipes yourself, super calls to this could be useful if you just want to add a special case
- * <p/>
- * I thought about Enum too, but Enum doesn't add support for people adding other return Systems.
- * <p/>
- * Funny how Eclipse marks the word Enum as not correctly spelled.
- *
- * @return see constants above
- */
- public int checkRecipe() {
- Gregtech_Recipe_Map tMap = getRecipeList();
- if (tMap == null) return DID_NOT_FIND_RECIPE;
- GregtechRecipe_OLD tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
- if (tRecipe == null) return DID_NOT_FIND_RECIPE;
- if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
- if (!canOutput(tRecipe)) {
- mOutputBlocked++;
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- }
- if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs()))
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
-
- for (int i = 0; i < mOutputItems.length; i++)
- if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i))
- mOutputItems[i] = tRecipe.getOutput(i);
- mOutputFluid = tRecipe.getFluidOutput(0);
- calculateOverclockedNess(tRecipe);
- return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
- }
-
- public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipe_OLD.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipe_OLD.java
deleted file mode 100644
index 60583ed27b..0000000000
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipe_OLD.java
+++ /dev/null
@@ -1,781 +0,0 @@
-package gtPlusPlus.xmod.gregtech.api.util;
-
-import static gregtech.api.enums.GT_Values.E;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-import static gregtech.api.enums.GT_Values.W;
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
-import gregtech.api.objects.GT_FluidStack;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.item.UtilsItems;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-
-/**
- * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
- * <p/>
- * This File contains the functions used for Recipes. Please do not include this File AT ALL in your Moddownload as it ruins compatibility
- * This is just the Core of my Recipe System, if you just want to GET the Recipes I add, then you can access this File.
- * Do NOT add Recipes using the Constructors inside this Class, The GregTech_API File calls the correct Functions for these Constructors.
- * <p/>
- * I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions.
- */
-public class GregtechRecipe_OLD {
-
- public static volatile int VERSION = 508;
- /**
- * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
- */
- public ItemStack[] mInputs, mOutputs;
- /**
- * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
- */
- public FluidStack[] mFluidInputs, mFluidOutputs;
- /**
- * If you changed the amount of Array-Items inside the Output Array then the length of this Array must be larger or equal to the Output Array. A chance of 10000 equals 100%
- */
- public int[] mChances;
- /**
- * An Item that needs to be inside the Special Slot, like for example the Copy Slot inside the Printer. This is only useful for Fake Recipes in NEI, since findRecipe() and containsInput() don't give a shit about this Field. Lists are also possible.
- */
- public Object mSpecialItems;
- public int mDuration, mEUt, mSpecialValue;
- /**
- * Use this to just disable a specific Recipe, but the Configuration enables that already for every single Recipe.
- */
- public boolean mEnabled = true;
- /**
- * If this Recipe is hidden from NEI
- */
- public boolean mHidden = false;
- /**
- * If this Recipe is Fake and therefore doesn't get found by the findRecipe Function (It is still in the HashMaps, so that containsInput does return T on those fake Inputs)
- */
- public boolean mFakeRecipe = false;
- /**
- * If this Recipe can be stored inside a Machine in order to make Recipe searching more Efficient by trying the previously used Recipe first. In case you have a Recipe Map overriding things and returning one time use Recipes, you have to set this to F.
- */
- public boolean mCanBeBuffered = true;
- /**
- * If this Recipe needs the Output Slots to be completely empty. Needed in case you have randomised Outputs
- */
- public boolean mNeedsEmptyOutput = false;
- private GregtechRecipe_OLD(GregtechRecipe_OLD aRecipe) {
- mInputs = GT_Utility.copyStackArray((Object[]) aRecipe.mInputs);
- mOutputs = GT_Utility.copyStackArray((Object[]) aRecipe.mOutputs);
- mSpecialItems = aRecipe.mSpecialItems;
- mChances = aRecipe.mChances;
- mFluidInputs = GT_Utility.copyFluidArray(aRecipe.mFluidInputs);
- mFluidOutputs = GT_Utility.copyFluidArray(aRecipe.mFluidOutputs);
- mDuration = aRecipe.mDuration;
- mSpecialValue = aRecipe.mSpecialValue;
- mEUt = aRecipe.mEUt;
- mNeedsEmptyOutput = aRecipe.mNeedsEmptyOutput;
- mCanBeBuffered = aRecipe.mCanBeBuffered;
- mFakeRecipe = aRecipe.mFakeRecipe;
- mEnabled = aRecipe.mEnabled;
- mHidden = aRecipe.mHidden;
- }
- protected GregtechRecipe_OLD(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- if (aInputs == null) aInputs = new ItemStack[0];
- if (aOutputs == null) aOutputs = new ItemStack[0];
- if (aFluidInputs == null) aFluidInputs = new FluidStack[0];
- if (aFluidOutputs == null) aFluidOutputs = new FluidStack[0];
- if (aChances == null) aChances = new int[aOutputs.length];
- if (aChances.length < aOutputs.length) aChances = Arrays.copyOf(aChances, aOutputs.length);
-
- aInputs = GT_Utility.getArrayListWithoutTrailingNulls(aInputs).toArray(new ItemStack[0]);
- aOutputs = GT_Utility.getArrayListWithoutTrailingNulls(aOutputs).toArray(new ItemStack[0]);
- aFluidInputs = GT_Utility.getArrayListWithoutNulls(aFluidInputs).toArray(new FluidStack[0]);
- aFluidOutputs = GT_Utility.getArrayListWithoutNulls(aFluidOutputs).toArray(new FluidStack[0]);
-
- GT_OreDictUnificator.setStackArray(true, aInputs);
- GT_OreDictUnificator.setStackArray(true, aOutputs);
-
- for (ItemStack tStack : aOutputs) GT_Utility.updateItemStack(tStack);
-
- for (int i = 0; i < aChances.length; i++) if (aChances[i] <= 0) aChances[i] = 10000;
- for (int i = 0; i < aFluidInputs.length; i++) aFluidInputs[i] = new GT_FluidStack(aFluidInputs[i]);
- for (int i = 0; i < aFluidOutputs.length; i++) aFluidOutputs[i] = new GT_FluidStack(aFluidOutputs[i]);
-
- for (int i = 0; i < aInputs.length; i++)
- if (aInputs[i] != null && Items.feather.getDamage(aInputs[i]) != W)
- for (int j = 0; j < aOutputs.length; j++) {
- if (GT_Utility.areStacksEqual(aInputs[i], aOutputs[j])) {
- if (aInputs[i].stackSize >= aOutputs[j].stackSize) {
- aInputs[i].stackSize -= aOutputs[j].stackSize;
- aOutputs[j] = null;
- } else {
- aOutputs[j].stackSize -= aInputs[i].stackSize;
- }
- }
- }
-
- if (aOptimize && aDuration >= 32) {
- ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
- tList.addAll(Arrays.asList(aInputs));
- tList.addAll(Arrays.asList(aOutputs));
- for (int i = 0; i < tList.size(); i++) if (tList.get(i) == null) tList.remove(i--);
-
- for (byte i = (byte) Math.min(64, aDuration / 16); i > 1; i--)
- if (aDuration / i >= 16) {
- boolean temp = true;
- for (int j = 0, k = tList.size(); temp && j < k; j++)
- if (tList.get(j).stackSize % i != 0) temp = false;
- for (int j = 0; temp && j < aFluidInputs.length; j++)
- if (aFluidInputs[j].amount % i != 0) temp = false;
- for (int j = 0; temp && j < aFluidOutputs.length; j++)
- if (aFluidOutputs[j].amount % i != 0) temp = false;
- if (temp) {
- for (int j = 0, k = tList.size(); j < k; j++) tList.get(j).stackSize /= i;
- for (int j = 0; j < aFluidInputs.length; j++) aFluidInputs[j].amount /= i;
- for (int j = 0; j < aFluidOutputs.length; j++) aFluidOutputs[j].amount /= i;
- aDuration /= i;
- }
- }
- }
-
- mInputs = aInputs;
- mOutputs = aOutputs;
- mSpecialItems = aSpecialItems;
- mChances = aChances;
- mFluidInputs = aFluidInputs;
- mFluidOutputs = aFluidOutputs;
- mDuration = aDuration;
- mSpecialValue = aSpecialValue;
- mEUt = aEUt;
-
- // checkCellBalance();
-
- Utils.LOG_SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe_OLD]", "Created new recipe instance for "+UtilsItems.getArrayStackNames(aInputs), 167);
- }
-
- public GregtechRecipe_OLD(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) {
- this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
- }
-
- // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
- public GregtechRecipe_OLD(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) {
- this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue));
-
- Utils.LOG_INFO("Switch case method for adding fuels");
- if (mInputs.length > 0 && aSpecialValue > 0) {
- switch (aType) {
- // Diesel Generator
- case 0:
- Utils.LOG_INFO("Added fuel "+aInput1.getDisplayName()+" is ROCKET FUEL - continuing");
- Gregtech_Recipe_Map.sRocketFuels.addRecipe(this);
- break;
- // Gas Turbine
- case 1:
- Gregtech_Recipe_Map.sGeoThermalFuels.addRecipe(this);
- break;
- // Thermal Generator
- case 2:
- //Gregtech_Recipe_Map.sHotFuels.addRecipe(this);
- break;
- // Plasma Generator
- case 4:
- //Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this);
- break;
- // Magic Generator
- case 5:
- //Gregtech_Recipe_Map.sMagicFuels.addRecipe(this);
- break;
- // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
- default:
- //Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
- break;
- }
- }
- }
-
- //Custom Recipe Handlers
- public GregtechRecipe_OLD(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
- this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this);
- }
- }
-
- /*public GregtechRecipe_OLD(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
- this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this);
- }
- }*/
-
-
- public static void reInit() {
- GT_Log.out.println("GT_Mod: Re-Unificating Recipes.");
- for (Gregtech_Recipe_Map tMapEntry : Gregtech_Recipe_Map.sMappings) tMapEntry.reInit();
- }
-
- public ItemStack getRepresentativeInput(int aIndex) {
- if (aIndex < 0 || aIndex >= mInputs.length) return null;
- return GT_Utility.copy(mInputs[aIndex]);
- }
-
- public ItemStack getOutput(int aIndex) {
- if (aIndex < 0 || aIndex >= mOutputs.length) return null;
- return GT_Utility.copy(mOutputs[aIndex]);
- }
-
- public int getOutputChance(int aIndex) {
- if (aIndex < 0 || aIndex >= mChances.length) return 10000;
- return mChances[aIndex];
- }
-
- public FluidStack getRepresentativeFluidInput(int aIndex) {
- if (aIndex < 0 || aIndex >= mFluidInputs.length || mFluidInputs[aIndex] == null) return null;
- return mFluidInputs[aIndex].copy();
- }
-
- public FluidStack getFluidOutput(int aIndex) {
- if (aIndex < 0 || aIndex >= mFluidOutputs.length || mFluidOutputs[aIndex] == null) return null;
- return mFluidOutputs[aIndex].copy();
- }
-
- public GregtechRecipe_OLD copy() {
- return new GregtechRecipe_OLD(this);
- }
-
- public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) {
- return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs);
- }
-
- public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] aFluidInputs, ItemStack... aInputs) {
- if (mFluidInputs.length > 0 && aFluidInputs == null) return false;
- for (FluidStack tFluid : mFluidInputs)
- if (tFluid != null) {
- boolean temp = true;
- for (FluidStack aFluid : aFluidInputs)
- if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {
- temp = false;
- break;
- }
- if (temp) return false;
- }
-
- if (mInputs.length > 0 && aInputs == null) return false;
-
- for (ItemStack tStack : mInputs)
- if (tStack != null) {
- boolean temp = true;
- for (ItemStack aStack : aInputs)
- if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {
- temp = false;
- break;
- }
- if (temp) return false;
- }
-
- if (aDecreaseStacksizeBySuccess) {
- if (aFluidInputs != null) {
- for (FluidStack tFluid : mFluidInputs)
- if (tFluid != null) {
- for (FluidStack aFluid : aFluidInputs)
- if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {
- aFluid.amount -= tFluid.amount;
- break;
- }
- }
- }
-
- if (aInputs != null) {
- for (ItemStack tStack : mInputs)
- if (tStack != null) {
- for (ItemStack aStack : aInputs)
- if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {
- aStack.stackSize -= tStack.stackSize;
- break;
- }
- }
- }
- }
-
- return true;
- }
-
- public static class Gregtech_Recipe_Map {
- /**
- * Contains all Recipe Maps
- */
- public static final Collection<Gregtech_Recipe_Map> sMappings = new ArrayList<Gregtech_Recipe_Map>();
- //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 2, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, E, 1, E, true, true);
- //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe_OLD>(200), "gt.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true);
- public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe_OLD>(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true);
- public static final Gregtech_Recipe_Map_Fuel sGeoThermalFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe_OLD>(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final Gregtech_Recipe_Map sChemicalDehydratorRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe_OLD>(200), "gt.recipe.chemicaldehydrator", "Chemical Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 1, 1, 0, 0, 1, E, 1, E, true, true);
-
- /**
- * HashMap of Recipes based on their Items
- */
- public final Map<GT_ItemStack, Collection<GregtechRecipe_OLD>> mRecipeItemMap = new HashMap<GT_ItemStack, Collection<GregtechRecipe_OLD>>();
- /**
- * HashMap of Recipes based on their Fluids
- */
- public final Map<Fluid, Collection<GregtechRecipe_OLD>> mRecipeFluidMap = new HashMap<Fluid, Collection<GregtechRecipe_OLD>>();
- /**
- * The List of all Recipes
- */
- public final Collection<GregtechRecipe_OLD> mRecipeList;
- /**
- * String used as an unlocalised Name.
- */
- public final String mUnlocalizedName;
- /**
- * String used in NEI for the Recipe Lists. If null it will use the unlocalised Name instead
- */
- public final String mNEIName;
- /**
- * GUI used for NEI Display. Usually the GUI of the Machine itself
- */
- public final String mNEIGUIPath;
- public final String mNEISpecialValuePre, mNEISpecialValuePost;
- public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, mMinimalInputFluids, mAmperage;
- public final boolean mNEIAllowed, mShowVoltageAmperageInNEI;
-
- /**
- * Initialises a new type of Recipe Handler.
- *
- * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a pre-initialised Size.
- * @param aUnlocalizedName the unlocalised Name of this Recipe Handler, used mainly for NEI.
- * @param aLocalName the displayed Name inside the NEI Recipe GUI.
- * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png" if forgotten.
- * @param aUsualInputCount the usual amount of Input Slots this Recipe Class has.
- * @param aUsualOutputCount the usual amount of Output Slots this Recipe Class has.
- * @param aNEISpecialValuePre the String in front of the Special Value in NEI.
- * @param aNEISpecialValueMultiplier the Value the Special Value is getting Multiplied with before displaying
- * @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something.
- * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general.
- */
- public Gregtech_Recipe_Map(Collection<GregtechRecipe_OLD> aRecipeList,
- String aUnlocalizedName, String aLocalName, String aNEIName,
- String aNEIGUIPath, int aUsualInputCount,
- int aUsualOutputCount, int aMinimalInputItems,
- int aMinimalInputFluids, int aAmperage,
- String aNEISpecialValuePre, int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
- boolean aNEIAllowed) {
- 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 GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe_OLD(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- public GregtechRecipe_OLD addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe_OLD(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
- }
-
- public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe_OLD(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- public GregtechRecipe_OLD addRecipe(boolean aOptimize, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe_OLD(aOptimize, null, null, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- /*public GregtechRecipe_OLD addRecipe(boolean aOptimize, FluidStack aInput1, FluidStack aOutput1, ItemStack[] bInput1, ItemStack[] bOutput1, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GregtechRecipe_OLD(aOptimize, aInput1, aOutput1, bInput1,bOutput1, aDuration, aEUt, aSpecialValue));
-
- }*/
-
- public GregtechRecipe_OLD addRecipe(GregtechRecipe_OLD aRecipe) {
- Utils.LOG_INFO("Adding Recipe Method 1");
- return addRecipe(aRecipe, true, false, false);
- }
-
- protected GregtechRecipe_OLD addRecipe(GregtechRecipe_OLD aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
- Utils.LOG_INFO("Adding Recipe Method 2 - This Checks if hidden, fake or if duplicate recipes exists, I think.");
- aRecipe.mHidden = aHidden;
- aRecipe.mFakeRecipe = aFakeRecipe;
- Utils.LOG_INFO("Logging some data about this method: GregtechRecipe_OLD["+aRecipe.toString()+"] | aCheckForCollisions["+aCheckForCollisions+"] | aFakeRecipe["+aFakeRecipe+"] | aHidden["+aHidden+"]");
- Utils.LOG_INFO("Logging some data about this method: mMinimalInputFluids["+mMinimalInputFluids+"] | mMinimalInputItems["+mMinimalInputItems+"] | aRecipe.mFluidInputs.length["+aRecipe.mFluidInputs.length+"] | aRecipe.mInputs.length["+aRecipe.mInputs.length+"]");
- if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems){
- Utils.LOG_INFO("Step 2 failed");
- return null;}
-
- Utils.LOG_INFO("Logging some data about this method: aCheckForCollisions["+aCheckForCollisions+"] | findRecipe != null ["+(findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null)+"]");
- if (aCheckForCollisions && findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null){
- Utils.LOG_INFO("Step 2 failed - 2");
- return null;
- }
- return add(aRecipe);
- }
-
-
-
- /**
- * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
- */
- public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addFakeRecipe(aCheckForCollisions, new GregtechRecipe_OLD(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- /**
- * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
- */
- public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addFakeRecipe(aCheckForCollisions, new GregtechRecipe_OLD(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- /**
- * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
- */
- public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe_OLD aRecipe) {
- return addRecipe(aRecipe, aCheckForCollisions, true, false);
- }
-
- public GregtechRecipe_OLD add(GregtechRecipe_OLD aRecipe) {
- Utils.LOG_INFO("Adding Recipe Method 3");
- mRecipeList.add(aRecipe);
- for (FluidStack aFluid : aRecipe.mFluidInputs)
- if (aFluid != null) {
- Utils.LOG_INFO("Fluid is valid - getting some kind of fluid instance to add to the recipe hashmap.");
- Collection<GregtechRecipe_OLD> tList = mRecipeFluidMap.get(aFluid.getFluid());
- if (tList == null) mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<GregtechRecipe_OLD>(1));
- tList.add(aRecipe);
- }
- return addToItemMap(aRecipe);
- }
-
- public void reInit() {
- Map<GT_ItemStack, Collection<GregtechRecipe_OLD>> tMap = mRecipeItemMap;
- if (tMap != null) tMap.clear();
- for (GregtechRecipe_OLD tRecipe : mRecipeList) {
- GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs);
- GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs);
- if (tMap != null) addToItemMap(tRecipe);
- }
- }
-
- /**
- * @return if this Item is a valid Input for any for the Recipes
- */
- public boolean containsInput(ItemStack aStack) {
- return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) || mRecipeItemMap.containsKey(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack))));
- }
-
- /**
- * @return if this Fluid is a valid Input for any for the Recipes
- */
- public boolean containsInput(FluidStack aFluid) {
- return aFluid != null && containsInput(aFluid.getFluid());
- }
-
- /**
- * @return if this Fluid is a valid Input for any for the Recipes
- */
- public boolean containsInput(Fluid aFluid) {
- return aFluid != null && mRecipeFluidMap.containsKey(aFluid);
- }
-
- public GregtechRecipe_OLD findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
- return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs);
- }
-
- public GregtechRecipe_OLD findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe_OLD aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
- return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs);
- }
-
- /**
- * finds a Recipe matching the aFluid and ItemStack Inputs.
- *
- * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup.
- * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up.
- * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs
- * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage
- * @param aFluids the Fluid Inputs
- * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do.
- * @param aInputs the Item Inputs
- * @return the Recipe it has found or null for no matching Recipe
- */
- public GregtechRecipe_OLD findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe_OLD aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- // No Recipes? Well, nothing to be found then.
- if (mRecipeList.isEmpty()) return null;
-
- // 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_OLD>
- tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
- if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
- if (tRecipes != null) for (GregtechRecipe_OLD 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_OLD>
- tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
- if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- }
-
- // And nothing has been found.
- return null;
- }
-
- protected GregtechRecipe_OLD addToItemMap(GregtechRecipe_OLD aRecipe) {
- Utils.LOG_INFO("Adding Recipe Method 4");
- for (ItemStack aStack : aRecipe.mInputs)
- if (aStack != null) {
- Utils.LOG_INFO("Method 4 - Manipulating "+aStack.getDisplayName());
- GT_ItemStack tStack = new GT_ItemStack(aStack);
- Utils.LOG_INFO("Method 4 - Made gt stack of item "+tStack.toStack().getDisplayName());
- Collection<GregtechRecipe_OLD> tList = mRecipeItemMap.get(tStack);
- if (tList != null){
- Utils.LOG_INFO("Method 4 - Gt Recipe Hashmap: "+tList.toString());
- }
- if (tList == null){
- Utils.LOG_INFO("Method 4 - brrr list was NUll");
- mRecipeItemMap.put(tStack, tList = new HashSet<GregtechRecipe_OLD>(1));
- Utils.LOG_INFO("Method 4 - Attemping backup method for Gt Recipe Hashmap:");
-
- while (tList.iterator().hasNext()){
- Utils.LOG_INFO(tList.iterator().next().toString());
- }
-
- }
- tList.add(aRecipe);
- Utils.LOG_INFO("Method 4 - Added recipe to map? I think.");
- }
- return aRecipe;
- }
-
- public GregtechRecipe_OLD findRecipe(IGregTechTileEntity baseMetaTileEntity, GregtechRecipe_OLD 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_OLD>
- tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
- if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
- if (tRecipes != null) for (GregtechRecipe_OLD 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_OLD>
- tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
- if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- }
-
- // And nothing has been found.
- return null;
- }
- }
-
- // -----------------------------------------------------------------------------------------------------------------
- // Here are a few Classes I use for Special Cases in some Machines without having to write a separate Machine Class.
- // -----------------------------------------------------------------------------------------------------------------
-
- /**
- * Abstract Class for general Recipe Handling of non GT Recipes
- */
- public static abstract class GT_Recipe_Map_NonGTRecipes extends Gregtech_Recipe_Map {
- public GT_Recipe_Map_NonGTRecipes(Collection<GregtechRecipe_OLD> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean containsInput(FluidStack aFluid) {
- return false;
- }
-
- @Override
- public boolean containsInput(Fluid aFluid) {
- return false;
- }
-
- @Override
- public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return null;
- }
-
- @Override
- public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return null;
- }
-
- @Override
- public GregtechRecipe_OLD addRecipe(GregtechRecipe_OLD aRecipe) {
- return null;
- }
-
- @Override
- public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return null;
- }
-
- @Override
- public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return null;
- }
-
- @Override
- public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe_OLD aRecipe) {
- return null;
- }
-
- @Override
- public GregtechRecipe_OLD add(GregtechRecipe_OLD aRecipe) {
- return null;
- }
-
- @Override
- public void reInit() {/**/}
-
- @Override
- protected GregtechRecipe_OLD addToItemMap(GregtechRecipe_OLD aRecipe) {
- return null;
- }
- }
-
- /**
- * Just a Recipe Map with Utility specifically for Fuels.
- */
- public static class Gregtech_Recipe_Map_Fuel extends Gregtech_Recipe_Map {
- public Gregtech_Recipe_Map_Fuel(Collection<GregtechRecipe_OLD> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) {
- Utils.LOG_INFO("Adding Fuel using method 1");
- return addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU);
- }
-
- public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) {
- Utils.LOG_INFO("Adding Fuel using method 2");
- return addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU);
- }
-
- public GregtechRecipe_OLD addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
- Utils.LOG_INFO("Adding Fuel using method 3");
- return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
- }
-
- public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
- Utils.LOG_INFO("Adding Fuel using method 4");
- return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
- }
-
- public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) {
- Utils.LOG_INFO("Adding Fuel using method 5");
- return addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 0, 0, aFuelValueInEU);
- }
- }
-
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
index 601d403f2d..c7d6dcbbba 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
@@ -38,8 +38,8 @@ extends GregtechMetaCasingBlocksAbstract {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Multitank Exterior Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Hastelloy-N Reactor Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Zeron-100 Reactor Shielding");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Unused Coil Block");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Unused Coil Block");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Blast Smelter Heat Containment Coil ");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Blast Smelter Casing Block");
GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0));
GregtechItemList.Casing_CokeOven.set(new ItemStack(this, 1, 1));
GregtechItemList.Casing_CokeOven_Coil1.set(new ItemStack(this, 1, 2));
@@ -54,8 +54,8 @@ extends GregtechMetaCasingBlocksAbstract {
GregtechItemList.Casing_MultitankExterior.set(new ItemStack(this, 1, 11));
GregtechItemList.Casing_Reactor_I.set(new ItemStack(this, 1, 12));
GregtechItemList.Casing_Reactor_II.set(new ItemStack(this, 1, 13));
- GregtechItemList.Casing_Coil_U3.set(new ItemStack(this, 1, 14));
- GregtechItemList.Casing_Coil_U4.set(new ItemStack(this, 1, 15));
+ GregtechItemList.Casing_Coil_BlastSmelter.set(new ItemStack(this, 1, 14));
+ GregtechItemList.Casing_BlastSmelter.set(new ItemStack(this, 1, 15));
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
index c5b8985396..4b8fff1cc3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
@@ -6,11 +6,11 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
public class CasingTextureHandler {
-
+
//private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59();
//private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58();
private static final TexturesCentrifugeMultiblock gregtechX = new TexturesCentrifugeMultiblock();
-
+
public static IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57]
if ((aMeta >= 0) && (aMeta < 16)) {
switch (aMeta) {
@@ -19,7 +19,7 @@ public class CasingTextureHandler {
return TexturesGtBlocks.Casing_Material_MaragingSteel.getIcon();
//Coke Oven Frame
case 1:
- return TexturesGtBlocks.Casing_Material_Staballoy61.getIcon();
+ return TexturesGtBlocks.Casing_Material_Tantalloy61.getIcon();
//Coke Oven Casing Tier 1
case 2:
return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon();
@@ -56,6 +56,10 @@ public class CasingTextureHandler {
//Reactor Casing II
case 13:
return TexturesGtBlocks.Casing_Material_Zeron100.getIcon();
+ case 14:
+ return TexturesGtBlocks.Casing_Staballoy_Firebox.getIcon();
+ case 15:
+ return TexturesGtBlocks.Casing_Material_Grisium.getIcon();
default:
return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon();
@@ -64,8 +68,8 @@ public class CasingTextureHandler {
}
return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon();
}
-
-
+
+
public static IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
/*if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java
index e82355ae8c..cc7e548021 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java
@@ -73,8 +73,8 @@ public class TexturesGtBlocks {
public static final CustomIcon Casing_Machine_Dimensional_Adv = Internal_Casing_Machine_Dimensional_Adv;
//Material Casings
- private static final CustomIcon Internal_Casing_Staballoy61 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TANTALLOY61");
- public static final CustomIcon Casing_Material_Staballoy61 = Internal_Casing_Staballoy61;
+ private static final CustomIcon Internal_Casing_Tantalloy61 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TANTALLOY61");
+ public static final CustomIcon Casing_Material_Tantalloy61 = Internal_Casing_Tantalloy61;
private static final CustomIcon Internal_Casing_MaragingSteel = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL");
public static final CustomIcon Casing_Material_MaragingSteel = Internal_Casing_MaragingSteel;
private static final CustomIcon Internal_Casing_Stellite = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_STELLITE");
@@ -87,6 +87,22 @@ public class TexturesGtBlocks {
public static final CustomIcon Casing_Material_Zeron100 = Internal_Casing_Zeron100;
private static final CustomIcon Internal_Casing_Potin = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_POTIN");
public static final CustomIcon Casing_Material_Potin = Internal_Casing_Potin;
+
+ private static final CustomIcon Internal_Casing_Grisium = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_GRISIUM");
+ public static final CustomIcon Casing_Material_Grisium = Internal_Casing_Grisium;
+ private static final CustomIcon Internal_Casing_Incoloy020 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_020");
+ public static final CustomIcon Casing_Material_Incoloy020 = Internal_Casing_Incoloy020;
+ private static final CustomIcon Internal_Casing_IncoloyDS = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_DS");
+ public static final CustomIcon Casing_Material_IncoloyDS = Internal_Casing_IncoloyDS;
+ private static final CustomIcon Internal_Casing_IncoloyMA956 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_MA956");
+ public static final CustomIcon Casing_Material_IncoloyMA956 = Internal_Casing_IncoloyMA956;
+ private static final CustomIcon Internal_Casing_ZirconiumCarbide = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE");
+ public static final CustomIcon Casing_Material_ZirconiumCarbide = Internal_Casing_ZirconiumCarbide;
+
+ //Material Machine/Firebox Casings
+ private static final CustomIcon Internal_Casing_Staballoy_Firebox = new CustomIcon("TileEntities/MACHINE_CASING_FIREBOX_STABALLOY");
+ public static final CustomIcon Casing_Staballoy_Firebox = Internal_Casing_Staballoy_Firebox;
+
//Misc Casings
private static final CustomIcon Internal_Casing_Machine_Redstone_Off = new CustomIcon("TileEntities/cover_redstone_conductor");
public static final CustomIcon Casing_Machine_Redstone_Off = Internal_Casing_Machine_Redstone_Off;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java
index f717bdf001..b6b66f17b4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastFurnace.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java
@@ -10,6 +10,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
import java.util.ArrayList;
import java.util.Arrays;
@@ -19,50 +20,68 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_AlloyBlastFurnace
+public class GregtechMetaTileEntity_AlloyBlastSmelter
extends GT_MetaTileEntity_MultiBlockBase {
private int mHeatingCapacity = 0;
- public GregtechMetaTileEntity_AlloyBlastFurnace(int aID, String aName, String aNameRegional) {
+ public GregtechMetaTileEntity_AlloyBlastSmelter(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMetaTileEntity_AlloyBlastFurnace(String aName) {
+ public GregtechMetaTileEntity_AlloyBlastSmelter(String aName) {
super(aName);
}
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_AlloyBlastFurnace(this.mName);
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_AlloyBlastSmelter(this.mName);
}
- public String[] getDescription() {
- return new String[]{"Controller Block for the Blast Furnace", "Size: 3x3x4 (Hollow)", "Controller (front middle at bottom)", "16x Heating Coils (two middle Layers, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", "Heat Proof Machine Casings for the rest"};
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Alloy Blast Smelter", //Outputs 144mb fluid for every inputStack.stackSize; Time to use those hot metals.
+ "Size: 3x3x4 (Hollow)",
+ "Controller (front middle at bottom)",
+ "16x Heating Coils (two middle Layers, hollow)",
+ "1x Input bus (one of bottom)",
+ "1x Output Hatch (one of bottom)",
+ "1x Energy Hatch (one of bottom)",
+ "1x Maintenance Hatch (one of bottom)",
+ "1x Muffler Hatch (top middle)",
+ "Heat Proof Machine Casings for the rest"};
}
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ @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[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[72], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
}
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11]};
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[72]};
}
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png");
}
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sBlastRecipes;
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes;
}
- public boolean isCorrectMachinePart(ItemStack aStack) {
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
return true;
}
- public boolean isFacingValid(byte aFacing) {
+ @Override
+ public boolean isFacingValid(byte aFacing) {
return aFacing > 1;
}
- public boolean checkRecipe(ItemStack aStack) {
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
ArrayList<ItemStack> tInputList = getStoredInputs();
for (int i = 0; i < tInputList.size() - 1; i++) {
for (int j = i + 1; j < tInputList.size(); j++) {
@@ -122,7 +141,8 @@ public class GregtechMetaTileEntity_AlloyBlastFurnace
return false;
}
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
@@ -192,23 +212,28 @@ public class GregtechMetaTileEntity_AlloyBlastFurnace
return true;
}
- public int getMaxEfficiency(ItemStack aStack) {
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}
- public int getPollutionPerTick(ItemStack aStack) {
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
return 10;
}
- public int getDamageToComponent(ItemStack aStack) {
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
return 0;
}
- public int getAmountOfOutputs() {
+ @Override
+ public int getAmountOfOutputs() {
return 2;
}
- public boolean explodesOnComponentBreak(ItemStack aStack) {
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
new file mode 100644
index 0000000000..875375cc12
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
@@ -0,0 +1,169 @@
+package gtPlusPlus.xmod.gregtech.loaders;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.objects.MaterialStack;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.item.ItemStack;
+
+public class RecipeGen_BlastSmelter {
+
+ public static void generateRecipes(){
+
+ Materials[] GregMaterials = Materials.values();
+
+ for (Materials M : GregMaterials){
+
+ if (!M.equals(Materials.Osmiridium)){
+
+ }
+ else {
+
+ //Add a Blast Smelting Recipe, Let's go!
+ ItemStack tStack;
+ if ((null != (tStack = GT_OreDictUnificator.get(OrePrefixes.ingot, M.mSmeltInto, 1L))) && (!M.contains(SubTag.NO_SMELTING) && (M.contains(SubTag.METAL)))) {
+
+ //Prepare some Variables
+ ItemStack[] components;
+ MaterialStack[] tMaterial;
+ short counter=0;
+ int inputStackCount=0;
+ int fluidAmount=0;
+ boolean doTest = false;
+
+ //This Bad boy here is what dictates unique recipes. Fuck life, right?
+ ItemStack circuitGT = UtilsItems.getGregtechCircuit(0);
+
+
+ //Set a duration
+ int duration = 0;
+ if (M.mBlastFurnaceTemp > 100){
+ duration = (int) Math.max(M.getMass() / 30L, 1L) * M.mBlastFurnaceTemp;
+ }
+ else {
+ duration = (int) Math.max(M.getMass() / 30L, 1L) * 200;
+ }
+
+
+ //Make a simple one Material Materialstack[] and log it for validity.
+ tMaterial = new MaterialStack[]{new MaterialStack(M, 1)};
+ circuitGT = UtilsItems.getGregtechCircuit(1);
+ ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+M, 1)};
+ inputStackCount = 1;
+ fluidAmount = 144*inputStackCount;
+ Utils.LOG_INFO("Adding an Alloy Blast Smelter Recipe for "+M+". Gives "+fluidAmount+"L of molten metal.");
+ Utils.LOG_INFO("tMaterial.length: "+tMaterial.length+".");
+ for (int das=0;das<tItemStackTest.length;das++){
+ if (tItemStackTest[das] != null)
+ Utils.LOG_INFO("tMaterial["+das+"]: "+tItemStackTest[das].getDisplayName()+" Meta: "+tItemStackTest[das].getItemDamage()+", Amount: "+tItemStackTest[das].stackSize);
+ }
+
+ //Generate Recipes for all singular materials that can be made molten.
+ if (M.mBlastFurnaceRequired) {
+ doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration, 240);
+ }
+ else {
+ doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration/2, 120);
+ }
+
+ if (doTest){
+ //Reset the Variables for compounds if last recipe was a success.
+ inputStackCount=0;
+ counter=0;
+
+
+ int mMaterialListSize=0;
+ for (MaterialStack ternkfsdf:M.mMaterialList){
+ mMaterialListSize++;
+ }
+ Utils.LOG_INFO("Size: "+mMaterialListSize);
+ //If this Material has some kind of compound list, proceed
+ if (mMaterialListSize > 1){
+ MaterialStack[] tempStack = new MaterialStack[mMaterialListSize];
+ circuitGT = UtilsItems.getGregtechCircuit(mMaterialListSize);
+ //Just double checking
+ if (tempStack.length > 1){
+
+ //Builds me a MaterialStack[] from the MaterialList of M.
+ int ooo=0;
+ for (MaterialStack xMaterial : M.mMaterialList){
+ Utils.LOG_INFO("FOUND: "+xMaterial.mMaterial);
+ Utils.LOG_INFO("ADDING: "+xMaterial.mMaterial);
+ tempStack[ooo] = M.mMaterialList.get(ooo);
+ ooo++;
+ }
+
+ //Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for the 144L fluid multiplier
+ components = new ItemStack[tempStack.length];
+ for (MaterialStack aOutputPart : tempStack){
+ if (aOutputPart != null){
+ Utils.LOG_INFO("Finding dust: "+aOutputPart.mMaterial);
+ ItemStack rStack = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount);
+ if (rStack != null){
+ Utils.LOG_INFO("Found dust: "+aOutputPart.mMaterial);
+ components[counter] = rStack;
+ inputStackCount = inputStackCount+rStack.stackSize;
+ }
+ }
+ counter++;
+ }
+
+ ItemStack[] components_NoCircuit = components;
+
+
+ //Builds me an ItemStack[] of the materials. - With a circuit
+ components = new ItemStack[components_NoCircuit.length+1];
+ for (int fr=0;fr<components.length;fr++){
+ if (fr==0){
+ components[0] = circuitGT;
+ }
+ else {
+ components[fr] = components_NoCircuit[fr-1];
+ }
+ }
+
+ //Set Fluid output
+ fluidAmount = 144*inputStackCount;
+
+
+ Utils.LOG_INFO("Adding an Alloy Blast Smelter Recipe for "+M+" using it's compound dusts. This material has "+ inputStackCount+" parts. Gives "+fluidAmount+"L of molten metal.");
+ Utils.LOG_INFO("tMaterial.length: "+components.length+".");
+ for (int das=0;das<components.length;das++){
+ if (components[das] != null)
+ Utils.LOG_INFO("tMaterial["+das+"]: "+components[das].getDisplayName()+" Meta: "+components[das].getItemDamage()+", Amount: "+components[das].stackSize);
+ }
+ if (M.mBlastFurnaceRequired) {
+ CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 500);
+ }
+ else {
+ CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 240);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+
+ private ItemStack[] getItemStackFromMaterialStack(MaterialStack[] aInput){
+ ItemStack[] components = new ItemStack[aInput.length];
+ short counter=0;
+ for (MaterialStack aOutputPart : aInput){
+ if (aOutputPart != null && components[counter] != null){
+ ItemStack aStack = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount);
+ components[counter] = aStack;
+ }
+ counter++;
+ }
+ return components;
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
index 4b0cf94032..428042501d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -1,6 +1,7 @@
package gtPlusPlus.xmod.gregtech.recipes;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
import gregtech.api.util.Recipe_GT;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.UtilsItems;
@@ -166,16 +167,16 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
Utils.LOG_INFO("Trying to add a Dehydrator recipe.");
try{
- if ((aInput == null) || (aFluid == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) {
- return false;
- }
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutput, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
- //RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, aOutput, aDuration, aEUt);
- return true;
- }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");return false;}
+ if ((aInput == null) || (aFluid == null) || (aOutput == null)) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) {
+ return false;
+ }
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutput, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
+ //RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, aOutput, aDuration, aEUt);
+ return true;
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");return false;}
}
@@ -185,47 +186,47 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt) throws IndexOutOfBoundsException{
Utils.LOG_INFO("Trying to add a Dehydrator recipe.");
try{
- if (aInput[0] != null){
- Utils.LOG_INFO("Recipe requires input: "+aInput[0].getDisplayName()+" x"+aInput[0].stackSize);
- }
- if (aInput.length > 1){
- if (aInput[1] != null){
- Utils.LOG_INFO("Recipe requires input: "+aInput[1].getDisplayName()+" x"+aInput[1].stackSize);
+ if (aInput[0] != null){
+ Utils.LOG_INFO("Recipe requires input: "+aInput[0].getDisplayName()+" x"+aInput[0].stackSize);
+ }
+ if (aInput.length > 1){
+ if (aInput[1] != null){
+ Utils.LOG_INFO("Recipe requires input: "+aInput[1].getDisplayName()+" x"+aInput[1].stackSize);
+ }
+ }
+ if (aFluidInput != null){
+ Utils.LOG_INFO("Recipe requires input: "+aFluidInput.getFluid().getName()+" "+aFluidInput.amount+"mbst");
+ }
+ if (((aInput[0] == null) && (aFluidInput == null)) || ((aOutputItems == null) && (aFluidOutput == null))) {
+ return false;
+ }
+ if ((aOutputItems != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0)) {
+ return false;
+ }
+ if (aOutputItems != null){
+ Utils.LOG_INFO("Recipe will output: "+UtilsItems.getArrayStackNames(aOutputItems));
+ }
+ if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
+ return false;
+ }
+ if (aFluidOutput != null){
+ Utils.LOG_INFO("Recipe will output: "+aFluidOutput.getFluid().getName());
}
- }
- if (aFluidInput != null){
- Utils.LOG_INFO("Recipe requires input: "+aFluidInput.getFluid().getName()+" "+aFluidInput.amount+"mbst");
- }
- if (((aInput[0] == null) && (aFluidInput == null)) || ((aOutputItems == null) && (aFluidOutput == null))) {
- return false;
- }
- if ((aOutputItems != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0)) {
- return false;
- }
- if (aOutputItems != null){
- Utils.LOG_INFO("Recipe will output: "+UtilsItems.getArrayStackNames(aOutputItems));
- }
- if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
- return false;
- }
- if (aFluidOutput != null){
- Utils.LOG_INFO("Recipe will output: "+aFluidOutput.getFluid().getName());
- }
- if (aInput.length == 1){
- Utils.LOG_INFO("Dehydrator recipe only has a single input item.");
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ if (aInput.length == 1){
+ Utils.LOG_INFO("Dehydrator recipe only has a single input item.");
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- }
- else {
- Utils.LOG_INFO("Dehydrator recipe has two input items.");
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ }
+ else {
+ Utils.LOG_INFO("Dehydrator recipe has two input items.");
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- }
+ }
- return true;
+ return true;
}catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");return false;}
}
@@ -233,12 +234,31 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
+ @Override
+ public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt) {
+ if ((aInput == null) || (aOutput == null)) {
+ return false;
+ }
+
+
+ if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) {
+ aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount);
+ }
+ if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) {
+ aOutput = Materials.PulsatingIron.getMolten(aOutput.amount);
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("blastsmelter", aOutput.getFluid().getName(), aDuration)) <= 0) {
+ Utils.LOG_INFO("Recipe did not register.");
+ return false;
+ }
-
-
-
-
-
-
+ for (int das=0;das<aInput.length;das++){
+ if (aInput[das] != null)
+ Utils.LOG_INFO("tMaterial["+das+"]: "+aInput[das].getDisplayName()+", Amount: "+aInput[das].stackSize);
+ }
+
+ Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(true, aInput, new ItemStack[]{null}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
+ return true;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
index 6f81f5c44c..01ecf1650d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
@@ -25,7 +25,6 @@ public class GregtechEnergyBuffer
}
- @SuppressWarnings("deprecation")
private static void run1()
{