Implemented SBR recipes, Added method for LCM recipes, adjusted

polymerization

Polymerization now requires Titaniumtetrachloride instead of Titanium
Dust; Can only be performed in a LCM.

Adjusted the visual representation of LCM recipes in NEI
This commit is contained in:
Johannes Gäßler 2017-05-30 02:10:13 +02:00
parent 407c77fd31
commit 56bb017df6
5 changed files with 87 additions and 19 deletions

View file

@ -537,8 +537,8 @@ public class Materials implements IColorModulationContainer, ISubTagContainer {
public static Materials HeavyFuel = new Materials(741, TextureSet.SET_FLUID, 1.0F, 0, 0, 16, 255, 255, 0, 0, "HeavyFuel", "Heavy Fuel", 3, 192, -1, 0, false, false, 1, 1, 1, Dyes.dyeBlack).setCanBeCracked(true);
public static Materials LPG = new Materials(742, TextureSet.SET_FLUID, 1.0F, 0, 0, 16, 255, 255, 0, 0, "LPG", "LPG", 1, 256, -1, 0, false, false, 1, 1, 1, Dyes.dyeYellow);
public static Materials Polystyrene = new MaterialBuilder(636, TextureSet.SET_DULL, "Polystyrene").addDustItems().addMetalItems().addToolHeadItems().addGearItems().setToolSpeed(3.0f).setDurability(32).setToolQuality(1).setRGB(162, 150, 138).setColor(Dyes.dyeLightGray).setMaterialList(new MaterialStack(Carbon, 8), new MaterialStack(Hydrogen, 8)).constructMaterial();
public static Materials Styrene = new MaterialBuilder(637, TextureSet.SET_FLUID, "Styrene").addCell().addFluid().setRGB(180, 168, 154).setColor(Dyes.dyeBlack).setMaterialList(new MaterialStack(Carbon, 8), new MaterialStack(Hydrogen, 8)).addElectrolyzerRecipe().constructMaterial();
public static Materials Polystyrene = new MaterialBuilder(636, TextureSet.SET_DULL, "Polystyrene").addDustItems().addMetalItems().addToolHeadItems().addGearItems().setToolSpeed(3.0f).setDurability(32).setToolQuality(1).setRGB(190, 180, 170).setColor(Dyes.dyeLightGray).setMaterialList(new MaterialStack(Carbon, 8), new MaterialStack(Hydrogen, 8)).constructMaterial();
public static Materials Styrene = new MaterialBuilder(637, TextureSet.SET_FLUID, "Styrene").addCell().addFluid().setRGB(210, 200, 190).setColor(Dyes.dyeBlack).setMaterialList(new MaterialStack(Carbon, 8), new MaterialStack(Hydrogen, 8)).addElectrolyzerRecipe().constructMaterial();
public static Materials Isoprene = new MaterialBuilder(638, TextureSet.SET_FLUID, "Isoprene").addCell().addFluid().setRGB(20, 20, 20).setColor(Dyes.dyeBlack).setMaterialList(new MaterialStack(Carbon, 5), new MaterialStack(Hydrogen, 8)).addElectrolyzerRecipe().constructMaterial();
public static Materials Tetranitromethane = new MaterialBuilder(639, TextureSet.SET_FLUID, "Tetranitromethane").addCell().addFluid().setRGB(20, 20, 70).setColor(Dyes.dyeBlack).setMaterialList(new MaterialStack(Carbon, 2), new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 1)).addElectrolyzerRecipe().constructMaterial();
public static Materials Ethenone = new MaterialBuilder(641, TextureSet.SET_FLUID, "Ethenone").addCell().addGas().setRGB(20, 20, 70).setColor(Dyes.dyeBlack).setMaterialList(new MaterialStack(Carbon, 2), new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 1)).addElectrolyzerRecipe().constructMaterial();

View file

@ -1,5 +1,6 @@
package gregtech.api.interfaces.internal;
import gregtech.api.util.GT_Recipe;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@ -148,7 +149,20 @@ public interface IGT_RecipeAdder {
*/
public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick);
/**
* Adds a Chemical Recipe that only exists in the Large Chemical Reactor
*
* @param aInputs item inputs
* @param aFluidInputs fluid inputs
* @param aFluidOutputs fluid outputs
* @param aOutputs item outputs
* @param aDuration must be > 0
* @param aEUtick must be > 0
* aInputs and aFluidInputs must contain at least one valid input.
* aOutputs and aFluidOutputs must contain at least one valid output.
*/
public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick);
/**
* Adds a Blast Furnace Recipe
*

View file

@ -1458,8 +1458,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public static class GT_Recipe_Map_LargeChemicalReactor extends GT_Recipe_Map{
private static int INPUT_COUNT = 2;
private static int OUTPUT_COUNT = 2;
private static int FLUID_INPUT_COUNT = 3;
private static int FLUID_OUTPUT_COUNT = 3;
private static int FLUID_INPUT_COUNT = 4;
private static int FLUID_OUTPUT_COUNT = 4;
public GT_Recipe_Map_LargeChemicalReactor() {
super(new HashSet<GT_Recipe>(200), "gt.recipe.largechemicalreactor", "Large Chemical Reactor", null, RES_PATH_GUI + "basicmachines/Default", INPUT_COUNT, OUTPUT_COUNT, 0, 0, 1, E, 1, E, true, true);
@ -1467,12 +1467,14 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Override
public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
aOptimize = false;
ArrayList<ItemStack> adjustedInputs = new ArrayList<ItemStack>();
ArrayList<ItemStack> adjustedOutputs = new ArrayList<ItemStack>();
ArrayList<FluidStack> adjustedFluidInputs = new ArrayList<FluidStack>();
ArrayList<FluidStack> adjustedFluidOutputs = new ArrayList<FluidStack>();
if (aInputs == null) {
aInputs = new ItemStack[0];
}
for (ItemStack input : aInputs) {
FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input);
if (inputFluidContent != null) {
@ -1499,12 +1501,18 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
}
}
if (aFluidInputs == null) {
aFluidInputs = new FluidStack[0];
}
for (FluidStack fluidInput : aFluidInputs) {
adjustedFluidInputs.add(fluidInput);
}
aInputs = adjustedInputs.toArray(new ItemStack[adjustedInputs.size()]);
aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[adjustedFluidInputs.size()]);
if (aOutputs == null) {
aOutputs = new ItemStack[0];
}
for (ItemStack output : aOutputs) {
FluidStack outputFluidContent = FluidContainerRegistry.getFluidForFilledItem(output);
if (outputFluidContent != null) {
@ -1522,6 +1530,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
}
}
if (aFluidOutputs == null) {
aFluidOutputs = new FluidStack[0];
}
for (FluidStack fluidOutput : aFluidOutputs) {
adjustedFluidOutputs.add(fluidOutput);
}
@ -1548,7 +1560,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
for (int i = 0; i < fluidLimit; i++) {
inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - i * 18, 23));
if (i < 3) {
inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - i * 18, 23));
} else {
inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 12, 5));
}
}
return inputStacks;

View file

@ -114,18 +114,32 @@ public class GT_RecipeAdder
return false;
}
GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0);
GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0);
GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0);
return true;
}
public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick){
if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) {
return false;
}
if (aEUtick <= 0) {
return false;
}
GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0);
return true;
}
@Override
public void addDefaultPolymerizationRecipes(Fluid aBasicMaterial, Fluid aPolymer){
//Oxygen/Titanium -> +50% Output each
GT_Values.RA.addChemicalRecipe(ItemList.Cell_Air.get(2, new Object[0]), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 144), Materials.Empty.getCells(2), 160);
GT_Values.RA.addChemicalRecipe(Materials.Oxygen.getCells(2), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 216), Materials.Empty.getCells(2), 160);
GT_Values.RA.addChemicalRecipe(ItemList.Cell_Air.get(12, new Object[0]),Materials.Titanium.getDustTiny(1), new GT_FluidStack(aBasicMaterial, 1728), new GT_FluidStack(aPolymer, 2592), Materials.Empty.getCells(12), 640);
GT_Values.RA.addChemicalRecipe(Materials.Oxygen.getCells(12), Materials.Titanium.getDustTiny(1), new GT_FluidStack(aBasicMaterial, 1728), new GT_FluidStack(aPolymer, 3456), Materials.Empty.getCells(12), 640);
//Oxygen/Titaniumtetrafluoride -> +50% Output each
addChemicalRecipe(ItemList.Cell_Air.get(2, new Object[0]), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 144), Materials.Empty.getCells(2), 160);
addChemicalRecipe(Materials.Oxygen.getCells(2), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 216), Materials.Empty.getCells(2), 160);
addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)},
new FluidStack[]{new GT_FluidStack(aBasicMaterial, 2160), Materials.Air.getGas(15000), Materials.Titaniumtetrachloride.getFluid(100)},
new FluidStack[]{new GT_FluidStack(aPolymer, 3240)}, null, 800, 30);
addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)},
new FluidStack[]{new GT_FluidStack(aBasicMaterial, 2160), Materials.Oxygen.getGas(15000), Materials.Titaniumtetrachloride.getFluid(100)},
new FluidStack[]{new GT_FluidStack(aPolymer, 4320)}, null, 800, 30);
}
public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) {
@ -886,7 +900,27 @@ public class GT_RecipeAdder
return true;
}
private boolean areItemsAndFluidsBothNull(ItemStack[] items, FluidStack[] fluids){
boolean itemsNull = true;
if (items != null) {
for (ItemStack itemStack : items) {
if (itemStack != null) {
itemsNull = false;
break;
}
}
}
boolean fluidsNull = true;
if (fluids != null) {
for (FluidStack fluidStack : fluids) {
if (fluidStack != null) {
fluidsNull = false;
break;
}
}
}
return itemsNull && fluidsNull;
}
}

View file

@ -2638,7 +2638,7 @@ if(Loader.isModLoaded("Railcraft")){
GT_Values.RA.addChemicalRecipe(Materials.Sulfur.getDust(1), GT_Values.NI, Materials.Hydrogen.getGas(2000), Materials.HydricSulfide.getGas(1000), GT_Values.NI, 60, 8);
GT_Values.RA.addChemicalRecipe(Materials.Sulfur.getDust(1), GT_Values.NI, Materials.Oxygen.getGas(2000), Materials.SulfurDioxide.getGas(1000), GT_Values.NI, 60, 8);
GT_Values.RA.addChemicalRecipe(Materials.Sulfur.getDust(1), GT_Utility.getIntegratedCircuit(2), Materials.Oxygen.getGas(2000), Materials.SulfurDioxide.getGas(1000), GT_Values.NI, 60, 8);
GT_Values.RA.addChemicalRecipe(Materials.HydricSulfide.getCells(1), GT_Values.NI, Materials.Oxygen.getGas(3000), Materials.SulfurDioxide.getGas(1000), Materials.Water.getCells(1), 120);
GT_Values.RA.addChemicalRecipe(Materials.Oxygen.getCells(3), GT_Values.NI, Materials.HydricSulfide.getGas(1000), Materials.Water.getFluid(1000), Materials.SulfurDioxide.getCells(1), 120);
@ -2682,14 +2682,18 @@ if(Loader.isModLoaded("Railcraft")){
GT_Values.RA.addChemicalRecipe(ItemList.Cell_Air.get(2, new Object[0]), GT_Utility.getIntegratedCircuit(1), Materials.Isoprene.getFluid(144), null, Materials.RawRubber.getDust(1), Materials.Empty.getCells(2), 160);
GT_Values.RA.addChemicalRecipe(Materials.Oxygen.getCells(4), GT_Utility.getIntegratedCircuit(1), Materials.Isoprene.getFluid(288), null, Materials.RawRubber.getDust(3), Materials.Empty.getCells(4), 320);
GT_Values.RA.addChemicalRecipe(ItemList.Cell_Air.get(12, new Object[0]),Materials.Titanium.getDustTiny(1), Materials.Isoprene.getFluid(1728), null, Materials.RawRubber.getDust(18), Materials.Empty.getCells(12), 640);
GT_Values.RA.addChemicalRecipe(Materials.Oxygen.getCells(12), Materials.Titanium.getDustTiny(1), Materials.Isoprene.getFluid(1728), null, Materials.RawRubber.getDust(24), Materials.Empty.getCells(12), 640);
GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{Materials.Isoprene.getFluid(1728), Materials.Air.getGas(12000), Materials.Titaniumtetrachloride.getFluid(80)}, null, new ItemStack[]{Materials.RawRubber.getDust(18)}, 640, 30);
GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{Materials.Isoprene.getFluid(1728), Materials.Oxygen.getGas(12000), Materials.Titaniumtetrachloride.getFluid(80)}, null, new ItemStack[]{Materials.RawRubber.getDust(24)}, 640, 30);
GT_Values.RA.addChemicalRecipe(Materials.Benzene.getCells(1), null, Materials.Ethylene.getGas(1000), Materials.Hydrogen.getGas(2000), Materials.Styrene.getCells(1), 120);
GT_Values.RA.addChemicalRecipe(Materials.Ethylene.getCells(1), Materials.Empty.getCells(1), Materials.Benzene.getGas(1000), Materials.Styrene.getFluid(1000), Materials.Hydrogen.getCells(2), 120);
GT_Values.RA.addChemicalRecipe(Materials.Ethylene.getCells(1), Materials.Empty.getCells(1), Materials.Benzene.getFluid(1000), Materials.Styrene.getFluid(1000), Materials.Hydrogen.getCells(2), 120);
GT_Values.RA.addDefaultPolymerizationRecipes(Materials.Styrene.mFluid, Materials.Polystyrene.mStandardMoltenFluid);
GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(3), Materials.Sulfur.getDust(1)}, new FluidStack[]{Materials.Styrene.getFluid(324), Materials.Butadiene.getGas(972), Materials.Air.getGas(18000)}, new FluidStack[]{Materials.StyreneButadieneRubber.getMolten(1296)}, null, 160, 240);
GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(3), Materials.Sulfur.getDust(1)}, new FluidStack[]{Materials.Styrene.getFluid(324), Materials.Butadiene.getGas(972), Materials.Oxygen.getGas(18000)}, new FluidStack[]{Materials.StyreneButadieneRubber.getMolten(1944)}, null, 160, 240);
GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(4),Materials.Sulfur.getDust(3)}, new FluidStack[]{Materials.Styrene.getFluid(540), Materials.Butadiene.getGas(1620), Materials.Titaniumtetrachloride.getFluid(100), Materials.Air.getGas(15000)}, new FluidStack[]{Materials.StyreneButadieneRubber.getMolten(3240)}, null, 640, 240);
GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(4),Materials.Sulfur.getDust(3)}, new FluidStack[]{Materials.Styrene.getFluid(540), Materials.Butadiene.getGas(1620), Materials.Titaniumtetrachloride.getFluid(100), Materials.Oxygen.getGas(15000)}, new FluidStack[]{Materials.StyreneButadieneRubber.getMolten(4320)}, null, 640, 240);
}
private void addSimplifiedChemicalRecipes() {