aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-08-17 19:11:38 +0100
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-08-17 19:11:38 +0100
commit828d9f0f8256f39d976f5ce6aedd6cb3b9cf560e (patch)
treedbee7e3d70a2dd8940341a4567a5bcf92d17a6ed /src/Java/gtPlusPlus
parent14a6ba866e1d2197d08b007011dc371f1b839552 (diff)
downloadGT5-Unofficial-828d9f0f8256f39d976f5ce6aedd6cb3b9cf560e.tar.gz
GT5-Unofficial-828d9f0f8256f39d976f5ce6aedd6cb3b9cf560e.tar.bz2
GT5-Unofficial-828d9f0f8256f39d976f5ce6aedd6cb3b9cf560e.zip
+ Added Air consumption to the LRE.
% Made the LRE longer. (10, up from 4) % Greatly improved NEI handling for decayables. $ Improved logic of LRE. $ Fixed NEI crash. $ Fixed bug in underlying GT code causing depleteInput to return false wrongly.
Diffstat (limited to 'src/Java/gtPlusPlus')
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java177
-rw-r--r--src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java151
-rw-r--r--src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java85
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java72
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java684
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java2
7 files changed, 803 insertions, 369 deletions
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java
index 7ade6d0371..c02e767dcd 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java
@@ -25,7 +25,7 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class RocketFuels extends ItemPackage {
-
+
public static HashSet<String> mValidRocketFuelNames = new HashSet<String>();
public static HashMap<Integer, Fluid> mValidRocketFuels = new HashMap<Integer, Fluid>();
@@ -52,16 +52,16 @@ public class RocketFuels extends ItemPackage {
public static Item Ammonium_Nitrate_Dust;
public static Item Formaldehyde_Catalyst;
-
+
public static void createKerosene(){
-
-
-
+
+
+
FluidStack fuelA = FluidUtils.getFluidStack("diesel", 300);
FluidStack fuelB = FluidUtils.getFluidStack("fuel", 300);
-
-
-
+
+
+
if (fuelA != null){
//GT_Values.RA.addDistilleryRecipe(23, fuelA, FluidUtils.getFluidStack(Kerosene, 50), 200, 64, false);
GT_Values.RA.addDistilleryRecipe(CI.getNumberedCircuit(23), fuelA, FluidUtils.getFluidStack(Kerosene, 100), 200, 64, false);
@@ -135,7 +135,11 @@ public class RocketFuels extends ItemPackage {
private static void createLOX() {
GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidOxygen", 1), 20*16);
CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("oxygen", 3000)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Oxygen, 3000)}, new ItemStack[] {}, new int[] {}, 20*16, 240, 0);
+ }
+ private static void createLOH() {
+ GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidhydrogen", 1), 20*16);
+ CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("hydrogen", 300)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Hydrogen, 300)}, new ItemStack[] {}, new int[] {}, 20*4, 540, 0);
}
private static void createHydratedAmmoniumNitrateSlurry() {
@@ -214,7 +218,7 @@ public class RocketFuels extends ItemPackage {
0,
0,
256)); //Fuel Value
-
+
mRocketFuels.put(1, new Recipe_GT(
true,
new ItemStack[] {},
@@ -226,7 +230,7 @@ public class RocketFuels extends ItemPackage {
0,
0,
512)); //Fuel Value
-
+
mRocketFuels.put(2, new Recipe_GT(
true,
new ItemStack[] {},
@@ -238,7 +242,7 @@ public class RocketFuels extends ItemPackage {
0,
0,
768)); //Fuel Value
-
+
mRocketFuels.put(3, new Recipe_GT(
true,
new ItemStack[] {},
@@ -250,8 +254,8 @@ public class RocketFuels extends ItemPackage {
0,
0,
1024)); //Fuel Value
-
-
+
+
//Add in default Diesel for the Buggy
mValidRocketFuels.put(-1, Diesel);
@@ -349,7 +353,7 @@ public class RocketFuels extends ItemPackage {
20*48,
480);
}
-
+
GT_Values.RA.addCentrifugeRecipe(
CI.getNumberedCircuit(23),
@@ -430,6 +434,7 @@ public class RocketFuels extends ItemPackage {
if (!CORE.GTNH) {
createLOX();
}
+ createLOH();
createHydratedAmmoniumNitrateSlurry();
@@ -440,18 +445,18 @@ public class RocketFuels extends ItemPackage {
createRocketFuels();
addRocketFuelsToMap();
-
+
return true;
}
@Override
public boolean onLoadComplete(FMLLoadCompleteEvent event) {
-
+
if (MathUtils.randInt(1, 2) > 0) {
return false;
}
-
+
Materials aMaterial_Chloramine = MaterialUtils.getMaterial("Chloramine");
Materials aMaterial_Dimethylamine = MaterialUtils.getMaterial("Dimethylamine");
@@ -459,19 +464,19 @@ public class RocketFuels extends ItemPackage {
Materials aMaterial_NitrogenDioxide = MaterialUtils.getMaterial("NitrogenDioxide");
Materials aMaterial_DinitrogenTetroxide = MaterialUtils.getMaterial("DinitrogenTetroxide");
Materials aMaterial_Dimethylhydrazine = MaterialUtils.getMaterial("Dimethylhydrazine");
-
+
Materials aMaterial_Oxygen = Materials.Oxygen;
Materials aMaterial_Water = Materials.Water;
Materials aMaterial_HypochlorousAcid = MaterialUtils.getMaterial("HypochlorousAcid");
Materials aMaterial_Ammonia = MaterialUtils.getMaterial("Ammonia");
Materials aMaterial_Methanol = MaterialUtils.getMaterial("Methanol");
-
+
if (aMaterial_Chloramine == null || aMaterial_Dimethylamine == null || aMaterial_DilutedHydrochloricAcid == null
|| aMaterial_Dimethylhydrazine == null || aMaterial_NitrogenDioxide == null || aMaterial_DinitrogenTetroxide == null
|| aMaterial_HypochlorousAcid == null || aMaterial_Ammonia == null || aMaterial_Methanol == null) {
return false;
}
-
+
ItemStack aCellEmpty = CI.emptyCells(1);
ItemStack aCellWater = aMaterial_Water.getCells(1);
@@ -482,10 +487,10 @@ public class RocketFuels extends ItemPackage {
ItemStack aCellNitrogenDioxide = aMaterial_NitrogenDioxide.getCells(1);
ItemStack aCellDinitrogenTetroxide = aMaterial_DinitrogenTetroxide.getCells(1);
ItemStack aCellDimethylhydrazine = aMaterial_Dimethylhydrazine.getCells(1);
-
-
-
-
+
+
+
+
GT_Recipe aChemReactor_1 = new Recipe_GT(
@@ -511,10 +516,10 @@ public class RocketFuels extends ItemPackage {
0, //Dura
0, //Eu
0); //Special
-
-
-
-
+
+
+
+
GT_Recipe aChemReactor_Basic_1 = new Recipe_GT(
true, //Optimise
new ItemStack[] {}, //I
@@ -562,18 +567,18 @@ public class RocketFuels extends ItemPackage {
0, //Dura
0, //Eu
0); //Special
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
GT_Recipe aChemReactor_Adv_1 = new Recipe_GT(
true, //Optimise
@@ -599,26 +604,26 @@ public class RocketFuels extends ItemPackage {
0, //Eu
0); //Special
-
-
+
+
//RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes);
//RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes);
//RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes);
//RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes);
-
-
-
-
-
- /* GT_Values.RA.addChemicalRecipe( Materials.Chloramine.getCells(2), GT_Utility.getIntegratedCircuit(1), Materials.Dimethylamine.getGas(5000), Materials.Dimethylhydrazine.getFluid(6000), Materials.DilutedHydrochloricAcid.getCells(1), Materials.Empty.getCells(1), 960, 480);
+
+
+
+
+
+ /* GT_Values.RA.addChemicalRecipe( Materials.Chloramine.getCells(2), GT_Utility.getIntegratedCircuit(1), Materials.Dimethylamine.getGas(5000), Materials.Dimethylhydrazine.getFluid(6000), Materials.DilutedHydrochloricAcid.getCells(1), Materials.Empty.getCells(1), 960, 480);
GT_Values.RA.addChemicalRecipe( Materials.Dimethylamine.getCells(5), GT_Utility.getIntegratedCircuit(1), Materials.Chloramine.getFluid(2000), Materials.Dimethylhydrazine.getFluid(6000), Materials.DilutedHydrochloricAcid.getCells(1), Materials.Empty.getCells(4), 960, 480);
GT_Values.RA.addChemicalRecipeForBasicMachineOnly(Materials.Chloramine.getCells(2), Materials.Empty.getCells(4), Materials.Dimethylamine.getGas(5000), Materials.DilutedHydrochloricAcid.getFluid(1000), Materials.Dimethylhydrazine.getCells(6), GT_Values.NI, 960, 480);
GT_Values.RA.addChemicalRecipeForBasicMachineOnly(Materials.Dimethylamine.getCells(5), Materials.Empty.getCells(1), Materials.Chloramine.getFluid(2000), Materials.DilutedHydrochloricAcid.getFluid(1000), Materials.Dimethylhydrazine.getCells(6), GT_Values.NI, 960, 480);
GT_Values.RA.addChemicalRecipeForBasicMachineOnly(Materials.Dimethylamine.getCells(5), Materials.Chloramine.getCells(2), Materials.Chloramine.getFluid(2000), Materials.DilutedHydrochloricAcid.getFluid(1000), Materials.Dimethylhydrazine.getCells(6), Materials.DilutedHydrochloricAcid.getCells(1), 960, 480);
GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(24)}, new FluidStack[]{Materials.HypochlorousAcid.getFluid(3000), Materials.Ammonia.getGas(8000), Materials.Methanol.getFluid(12000)}, new FluidStack[]{Materials.Dimethylhydrazine.getFluid(12000), Materials.DilutedHydrochloricAcid.getFluid(2000), Materials.Water.getFluid(9000)}, null, 1040, 480);
-
+
GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), GT_Values.NI, Materials.NitrogenDioxide.getGas(1000), Materials.DinitrogenTetroxide.getGas(1000), GT_Values.NI, 640);
GT_Values.RA.addChemicalRecipe(Materials.NitrogenDioxide.getCells(1), GT_Utility.getIntegratedCircuit(2), GT_Values.NF, Materials.DinitrogenTetroxide.getGas(1000), Materials.Empty.getCells(1), 640);
GT_Values.RA.addChemicalRecipe(Materials.NitrogenDioxide.getCells(1), GT_Utility.getIntegratedCircuit(12), GT_Values.NF, GT_Values.NF, Materials.DinitrogenTetroxide.getCells(1), 640);
@@ -630,25 +635,25 @@ public class RocketFuels extends ItemPackage {
GT_Values.RA.addMixerRecipe(Materials.Dimethylhydrazine.getCells(2), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Oxygen.getGas(1000), new FluidStack(ItemList.sRocketFuel, 3000), Materials.Empty.getCells(2), 60, 16);
GT_Values.RA.addMixerRecipe(Materials.Oxygen.getCells(1), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Dimethylhydrazine.getFluid(2000), new FluidStack(ItemList.sRocketFuel, 3000), Materials.Empty.getCells(1), 60, 16);
-
- */
-
-
-
-
-
-
-
-
-
+
+ */
+
+
+
+
+
+
+
+
+
//Get Rocket Fuel
-
+
//Find recipes using default values
-
+
//Remove
-
+
//Rebake map
-
+
return true;
};
@@ -663,16 +668,16 @@ public class RocketFuels extends ItemPackage {
@Override
public void fluids() {
-
+
//Register default fluids
Diesel = MaterialUtils.getMaterial("Fuel", "Diesel").getFluid(1).getFluid();
Oil_Heavy = MaterialUtils.getMaterial("OilHeavy", "Oil").getFluid(1).getFluid();
-
-
+
+
//Create Kerosene
Kerosene = FluidUtils.generateFluidNonMolten("Kerosene", "Kerosene", 500, new short[]{150, 40, 150, 100}, null, null);
CoalTar.Coal_Oil = Kerosene;
-
+
//RP! Focket Fuel
RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1 Rocket Fuel", 500, new short[]{210, 50, 50, 100}, null, null);
@@ -698,7 +703,7 @@ public class RocketFuels extends ItemPackage {
new BaseItemComponent("NitrousOxide", "Nitrous Oxide", new short[] {10, 10, 175});
}
}
-
+
//Unsymmetrical_Dimethylhydrazine
if (FluidUtils.getFluidStack("1,1dimethylhydrazine", 1) == null){
Unsymmetrical_Dimethylhydrazine = FluidUtils.generateFluidNonMolten("UnsymmetricalDimethylhydrazine", "Unsymmetrical Dimethylhydrazine", -57, new short[]{70, 210, 20, 100}, null, null);
@@ -728,31 +733,31 @@ public class RocketFuels extends ItemPackage {
new BaseItemComponent("LiquidOxygen", "Liquid Oxygen", new short[] {10, 10, 175});
}
}
-
+
//Create Liquid_Hydrogen
- if (FluidUtils.getFluidStack("LiquidHydrogen", 1) == null && FluidUtils.getFluidStack("liquidhydrogen", 1) == null){
- Liquid_Hydrogen = FluidUtils.generateFluidNonMolten("LiquidHydrogen", "Liquid Hydrogen", -240, new short[]{75, 75, 220, 100}, null, null);
- }
- else {
- if (FluidUtils.getFluidStack("LiquidHydrogen", 1) != null ) {
- Liquid_Hydrogen = FluidUtils.getFluidStack("LiquidHydrogen", 1).getFluid();
- }
- else {
- Liquid_Hydrogen = FluidUtils.getFluidStack("liquidhydrogen", 1).getFluid();
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidHydrogen", 1) == null){
- new BaseItemComponent("LiquidHydrogen", "Liquid Hydrogen", new short[] {10, 10, 175});
- }
- }
+ if (FluidUtils.getFluidStack("LiquidHydrogen", 1) == null && FluidUtils.getFluidStack("liquidhydrogen", 1) == null){
+ Liquid_Hydrogen = FluidUtils.generateFluidNonMolten("LiquidHydrogen", "Liquid Hydrogen", -240, new short[]{75, 75, 220, 100}, null, null);
+ }
+ else {
+ if (FluidUtils.getFluidStack("LiquidHydrogen", 1) != null ) {
+ Liquid_Hydrogen = FluidUtils.getFluidStack("LiquidHydrogen", 1).getFluid();
+ }
+ else {
+ Liquid_Hydrogen = FluidUtils.getFluidStack("liquidhydrogen", 1).getFluid();
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidHydrogen", 1) == null){
+ new BaseItemComponent("LiquidHydrogen", "Liquid Hydrogen", new short[] {10, 10, 175});
+ }
+ }
Formaldehyde = FluidUtils.generateFluidNonMolten("Formaldehyde", "Formaldehyde", -92, new short[]{150, 75, 150, 100}, null, null);
-
+
Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("RocketFuelMixA", "H8N4C2O4 Rocket Fuel", -185, new short[]{50, 220, 50, 100}, null, null);
RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Fuel Mixture", -250, new short[]{250, 50, 50, 100}, null, null);
Monomethylhydrazine_Plus_Nitric_Acid = FluidUtils.generateFluidNonMolten("RocketFuelMixC", "CN3H7O3 Rocket Fuel", -300, new short[]{125, 75, 180, 100}, null, null);
Dense_Hydrazine_Mix = FluidUtils.generateFluidNonMolten("RocketFuelMixD", "Dense Hydrazine Fuel Mixture", -250, new short[]{175, 80, 120, 100}, null, null);
-
+
}
diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java
index 6b7f24ed37..5144a56663 100644
--- a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java
+++ b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java
@@ -1,27 +1,33 @@
package gtPlusPlus.nei;
import java.awt.Rectangle;
-import java.util.Collection;
import java.util.List;
+import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
-import crazypants.enderio.gui.IconEIO;
import crazypants.enderio.machine.enchanter.GuiEnchanter;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.handler.Recipes.DecayableRecipe;
import gtPlusPlus.core.item.materials.DustDecayable;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.VanillaColours;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.nei.handlers.NeiTextureHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
public class DecayableRecipeHandler extends TemplateRecipeHandler {
public String getRecipeName() {
- return StatCollector.translateToLocal("gtpp.nei.decayables");
+ return StatCollector.translateToLocal("GTPP.container.decaychest.name");
}
public String getGuiTexture() {
- return "enderio:textures/gui/enchanter.png";
+ return CORE.MODID+":textures/gui/nei/decayables.png";
}
public Class<? extends GuiContainer> getGuiClass() {
@@ -31,20 +37,31 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
public String getOverlayIdentifier() {
return "GTPP_Decayables";
}
+
+ public int recipiesPerPage() {
+ return 1;
+ }
public void loadTransferRects() {
- this.transferRects.add(new RecipeTransferRect(new Rectangle(149, -3, 16, 16), "GTPP_Decayables", new Object[0]));
+ this.transferRects.add(new RecipeTransferRect(new Rectangle(6, 3, 16, 16), "GTPP_Decayables", new Object[0]));
}
public void loadCraftingRecipes(ItemStack result) {
if (result == null || !DustDecayable.class.isInstance(result.getItem())) {
return;
}
+ if (result != null) {
+ Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result));
+ }
final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
for (final DecayableRecipe recipe : recipes) {
if (recipe.isValid()) {
final ItemStack input = recipe.mInput.copy();
final ItemStack output = recipe.mOutput.copy();
+ if (!GT_Utility.areStacksEqual(result, output, true)) {
+ continue;
+ }
+ Logger.INFO("Showing Usage result for "+ItemUtils.getItemName(result));
final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
this.arecipes.add(rec);
}
@@ -70,35 +87,128 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
public void loadUsageRecipes(ItemStack ingredient) {
final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
+ if (ingredient != null) {
+ Logger.INFO("Looking up Usage results for "+ItemUtils.getItemName(ingredient));
+ }
for (final DecayableRecipe recipe : recipes) {
if (recipe.isValid()) {
final ItemStack input = recipe.mInput.copy();
final ItemStack output = recipe.mOutput.copy();
- final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
- if (!rec.contains((Collection)rec.input, ingredient)) {
+ if (!GT_Utility.areStacksEqual(ingredient, input, true)) {
continue;
- }
- rec.setIngredientPermutation((Collection) rec.input, ingredient);
+ }
+ Logger.INFO("Showing up Usage results for "+ItemUtils.getItemName(ingredient));
+ final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
+ //rec.setIngredientPermutation((Collection) rec.input, ingredient);
this.arecipes.add(rec);
}
}}
public void drawExtras(int recipeIndex) {
DecayableRecipeNEI recipe = (DecayableRecipeNEI) this.arecipes.get(recipeIndex);
- //GuiDraw.drawStringC(recipe.getEnchantName(), 83, 10, 8421504, false);
- /*
- * int cost = TileEnchanter.getEnchantmentCost(recipe.recipe, 1); if (cost > 0)
- * { String s = I18n.format("container.repair.cost", new Object[]{cost});
- * GuiDraw.drawStringC(s, 83, 46, 8453920); }
- */
-
- IconEIO.RECIPE_BUTTON.renderIcon(149.0D, -3.0D, 16.0D, 16.0D, 0.0D, true);
+
+ //GuiDraw.drawStringC(I18n.format("GTPP.container.decaychest.result", new Object[]{}), 43, 10, 8421504, false);
+
+ int cost = recipe.time;
+ if (cost > 0){
+
+ // NEI Strings
+ String s = I18n.format("GTPP.nei.info", new Object[]{cost});
+ String s0 = I18n.format("GTPP.nei.timetaken", new Object[]{cost});
+
+ // Time Strings
+ String s1 = I18n.format("GTPP.time.ticks", new Object[]{cost});
+ String s2 = I18n.format("GTPP.time.seconds", new Object[]{cost});
+ String s3 = I18n.format("GTPP.time.minutes", new Object[]{cost});
+ String s4 = I18n.format("GTPP.time.hours", new Object[]{cost});
+ String s5 = I18n.format("GTPP.time.days", new Object[]{cost});
+ String s6 = I18n.format("GTPP.time.months", new Object[]{cost});
+ int y = 20;
+
+ int secs = cost / 20;
+ int mins = secs / 60;
+ int hours = mins / 60;
+ int days = hours / 24;
+ int months = days / 30;
+
+
+ String suffix;
+ int formattedTime;
+ if (cost <= 20) {
+ suffix = s1;
+ formattedTime = cost;
+ }
+ else if (cost <= (20 * 60)) {
+ suffix = s2;
+ formattedTime = secs;
+ }
+ else if (cost <= (20 * 60 * 60)) {
+ suffix = s3;
+ formattedTime = mins;
+ }
+ else if (cost <= (20 * 60 * 60 * 24)) {
+ suffix = s4;
+ formattedTime = hours;
+ }
+ else if (cost < (20 * 60 * 60 * 24 * 30)) {
+ suffix = s5;
+ formattedTime = days;
+ }
+ else if (cost <= (20 * 60 * 60 * 24 * 30)) {
+ suffix = s6;
+ formattedTime = months;
+ }
+ else {
+ suffix = s1;
+ formattedTime = cost;
+ }
+
+
+
+ int x = 5;
+ GuiDraw.drawString(s, x, 25, VanillaColours.DYE_BLACK.getAsInt(), false);
+ GuiDraw.drawString(s0, x, 40, VanillaColours.DYE_BLACK.getAsInt(), false);
+
+
+
+
+
+ GuiDraw.drawString(suffix, x + 16, y+30, VanillaColours.DYE_BLACK.getAsInt(), false);
+
+ //Values
+ GuiDraw.drawString((""+formattedTime), x, y+30, VanillaColours.DYE_GREEN.getAsInt(), false);
+
+
+ if (hours > 1) {
+ int aLeftoverMinutes = (cost - (hours * (20 * 60 * 60)));
+ if (aLeftoverMinutes > 0) {
+ int secs2 = aLeftoverMinutes / 20;
+ int mins2 = secs2 / 60;
+ GuiDraw.drawString(s3, x + 16, y+42, VanillaColours.DYE_BLACK.getAsInt(), false);
+ GuiDraw.drawString((""+mins2), x, y+42, VanillaColours.DYE_GREEN.getAsInt(), false);
+
+ }
+
+ }
+
+
+
+
+ }
+
+ NeiTextureHandler.RECIPE_BUTTON.renderIcon(6.0D, 3.0D, 16.0D, 16.0D, 0.0D, true);
}
public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe
{
private PositionedStack input;
- private PositionedStack output;
+ private PositionedStack output;
+ public int time;
+
+ @Override
+ public PositionedStack getIngredient() {
+ return this.input;
+ }
public PositionedStack getResult() {
return this.output;
@@ -106,8 +216,9 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
public DecayableRecipeNEI(final ItemStack input, final ItemStack result, final int time) {
super();
- this.input = new PositionedStack(input, 22, 24);
- this.output = new PositionedStack(result, 129, 24);
+ this.input = new PositionedStack(input, 93, 24);
+ this.output = new PositionedStack(result, 142, 42);
+ this.time = time;
}
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java b/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
new file mode 100644
index 0000000000..f433def57d
--- /dev/null
+++ b/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
@@ -0,0 +1,85 @@
+package gtPlusPlus.nei.handlers;
+
+import crazypants.render.RenderUtil;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Based on crazypants.enderio.gui.IconEIO
+ * @author Original EIO Author
+ *
+ */
+public final class NeiTextureHandler {
+
+ public static final NeiTextureHandler RECIPE = new NeiTextureHandler(16, 132, 16, 16);
+ public static final NeiTextureHandler RECIPE_BUTTON = new NeiTextureHandler(128, 116, 24, 24);
+
+ public final double minU;
+ public final double maxU;
+ public final double minV;
+ public final double maxV;
+ public final double width;
+ public final double height;
+
+ public static final ResourceLocation TEXTURE = new ResourceLocation(CORE.MODID+":textures/gui/nei/widgets.png");
+
+ public NeiTextureHandler(int x, int y) {
+ this(x, y, 16, 16);
+ }
+
+ public NeiTextureHandler(int x, int y, int width, int height) {
+ this((double) width, (double) height, (double) ((float) (0.00390625D * (double) x)),
+ (double) ((float) (0.00390625D * (double) (x + width))), (double) ((float) (0.00390625D * (double) y)),
+ (double) ((float) (0.00390625D * (double) (y + height))));
+ }
+
+ public NeiTextureHandler(double width, double height, double minU, double maxU, double minV, double maxV) {
+ this.width = width;
+ this.height = height;
+ this.minU = minU;
+ this.maxU = maxU;
+ this.minV = minV;
+ this.maxV = maxV;
+ }
+
+ public void renderIcon(double x, double y) {
+ this.renderIcon(x, y, this.width, this.height, 0.0D, false);
+ }
+
+ public void renderIcon(double x, double y, boolean doDraw) {
+ this.renderIcon(x, y, this.width, this.height, 0.0D, doDraw);
+ }
+
+ public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw) {
+ this.renderIcon(x, y, width, height, zLevel, doDraw, false);
+ }
+
+ public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw,
+ boolean flipY) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ Tessellator tessellator = Tessellator.instance;
+ if (doDraw) {
+ RenderUtil.bindTexture(TEXTURE);
+ tessellator.startDrawingQuads();
+ }
+
+ if (flipY) {
+ tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.minV);
+ tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.minV);
+ tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.maxV);
+ tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.maxV);
+ } else {
+ tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.maxV);
+ tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.maxV);
+ tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.minV);
+ tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.minV);
+ }
+
+ if (doDraw) {
+ tessellator.draw();
+ }
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index 31909b4018..cb091264dd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -53,6 +53,7 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_Multi_Basic_Slotted;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBattery;
@@ -98,6 +99,7 @@ GT_MetaTileEntity_MultiBlockBase {
//Control Core Hatch
public ArrayList<GT_MetaTileEntity_Hatch_ControlCore> mControlCoreBus = new ArrayList<GT_MetaTileEntity_Hatch_ControlCore>();
+ public ArrayList<GT_MetaTileEntity_Hatch_AirIntake> mAirIntakes = new ArrayList<GT_MetaTileEntity_Hatch_AirIntake>();
public ArrayList<GT_MetaTileEntity_Hatch_InputBattery> mChargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_InputBattery>();
public ArrayList<GT_MetaTileEntity_Hatch_OutputBattery> mDischargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_OutputBattery>();
@@ -835,7 +837,7 @@ GT_MetaTileEntity_MultiBlockBase {
log("GOOD RETURN - 1");
return true;
-}
+ }
@@ -932,10 +934,10 @@ GT_MetaTileEntity_MultiBlockBase {
ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
int aMaxParallelRecipes, int aEUPercent,
int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
-
+
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-
+
log("Running checkRecipeGeneric(0)");
GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe(
@@ -943,12 +945,12 @@ GT_MetaTileEntity_MultiBlockBase {
gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
log("Running checkRecipeGeneric(1)");
-
+
//First we check whether or not we have an input cached for boosting.
//If not, we set it to the current recipe.
//If we do, we compare it against the current recipe, if thy are the same, we try return a boosted recipe, if not, we boost a new recipe.
boolean isRecipeInputTheSame = false;
-
+
//No cached recipe inputs, assume first run.
if (mInputVerificationForBoosting == null) {
mInputVerificationForBoosting = tRecipe.mInputs;
@@ -963,7 +965,7 @@ GT_MetaTileEntity_MultiBlockBase {
isRecipeInputTheSame = false;
}
}
-
+
//Inputs are the same, let's see if there's a boosted version.
if (isRecipeInputTheSame) {
//Yes, let's just set that as the recipe
@@ -999,14 +1001,14 @@ GT_MetaTileEntity_MultiBlockBase {
mHasBoostedCurrentRecipe = false;
}
}
-
+
//Bad modify, let's just use the original recipe.
if (!mHasBoostedCurrentRecipe || mBoostedRecipe == null) {
tRecipe = aRecipe != null ? aRecipe : findRecipe(
getBaseMetaTileEntity(), mLastRecipe, false,
gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
}
-
+
// Remember last recipe - an optimization for findRecipe()
this.mLastRecipe = tRecipe;
@@ -1188,6 +1190,7 @@ GT_MetaTileEntity_MultiBlockBase {
this.mChargeHatches.clear();
this.mDischargeHatches.clear();
this.mControlCoreBus.clear();
+ this.mAirIntakes.clear();
this.mMultiDynamoHatches.clear();
}
}
@@ -1252,7 +1255,7 @@ GT_MetaTileEntity_MultiBlockBase {
ItemStack guiSlot = this.mInventory[1];
return guiSlot;
}
-
+
protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) {
boolean result = false;
if (this.mInventory[1] == null) {
@@ -1263,11 +1266,11 @@ GT_MetaTileEntity_MultiBlockBase {
}
return result;
}
-
+
protected boolean clearGUIItemSlot() {
return setGUIItemStack(null);
}
-
+
public ItemStack findItemInInventory(Item aSearchStack) {
return findItemInInventory(aSearchStack, 0);
@@ -1276,7 +1279,7 @@ GT_MetaTileEntity_MultiBlockBase {
public ItemStack findItemInInventory(Item aSearchStack, int aMeta) {
return findItemInInventory(ItemUtils.simpleMetaStack(aSearchStack, aMeta, 1));
}
-
+
public ItemStack findItemInInventory(ItemStack aSearchStack) {
if (aSearchStack != null && this.mInputBusses.size() > 0) {
for (GT_MetaTileEntity_Hatch_InputBus bus : this.mInputBusses) {
@@ -1365,14 +1368,14 @@ GT_MetaTileEntity_MultiBlockBase {
if (aTileEntity == null) {
return false;
}
-
+
//Check type
/*
* Class <?> aHatchType = ReflectionUtils.getTypeOfGenericObject(aList); if
* (!aHatchType.isInstance(aTileEntity)) { return false; }
*/
-
-
+
+
if (aList.isEmpty()) {
if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
@@ -1546,6 +1549,20 @@ GT_MetaTileEntity_MultiBlockBase {
return addToMachineList(aTileEntity, aBaseCasingIndex);
}
+ public boolean addAirIntakeToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) {
+ this.mAirIntakes.add((GT_MetaTileEntity_Hatch_AirIntake)aMetaTileEntity);
+ }
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+
public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
if (aTileEntity == null) {
return false;
@@ -2103,6 +2120,31 @@ GT_MetaTileEntity_MultiBlockBase {
log("A3");
return false;
}
+
+ @Override
+ public boolean depleteInput(final FluidStack aLiquid) {
+ if (aLiquid == null) {
+ return false;
+ }
+ for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
+ tHatch.mRecipeMap = this.getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ FluidStack tLiquid = tHatch.getFluid();
+ if (tLiquid == null || !tLiquid.isFluidEqual(aLiquid) || tLiquid.amount < aLiquid.amount) {
+ continue;
+ }
+ tLiquid = tHatch.drain(aLiquid.amount, false);
+ if (tLiquid != null && tLiquid.amount >= aLiquid.amount) {
+ tLiquid = tHatch.drain(aLiquid.amount, true);
+ return tLiquid != null && tLiquid.amount >= aLiquid.amount;
+ }
+ continue;
+ }
+ }
+ return false;
+ }
+
+
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
index de5d731dd5..2c3bf29119 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
@@ -432,6 +432,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
mChargeHatches.clear();
mDischargeHatches.clear();
mControlCoreBus.clear();
+ mAirIntakes.clear();
mMultiDynamoHatches.clear();
mMachine = aFormCheck;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
index ab5cbd84d2..9b6da487e8 100644
--- a/