aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/material
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-08-24 18:47:40 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-08-24 18:47:40 +1000
commit9532786295e39c639ae40fcdaa90e5b9faf1a73f (patch)
tree749497fd09aab181b17687737ebcc2a3717202ad /src/Java/gtPlusPlus/core/material
parent7573ee56c6d8ee08319ef17ca28b46efcc5c6ed1 (diff)
parent4928538ba331e835cbe640c36d1324f375282629 (diff)
downloadGT5-Unofficial-9532786295e39c639ae40fcdaa90e5b9faf1a73f.tar.gz
GT5-Unofficial-9532786295e39c639ae40fcdaa90e5b9faf1a73f.tar.bz2
GT5-Unofficial-9532786295e39c639ae40fcdaa90e5b9faf1a73f.zip
Merge branch 'master' of https://github.com/draknyte1/GTplusplus
Diffstat (limited to 'src/Java/gtPlusPlus/core/material')
-rw-r--r--src/Java/gtPlusPlus/core/material/Material.java6
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java162
-rw-r--r--src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java107
-rw-r--r--src/Java/gtPlusPlus/core/material/state/MaterialState.java3
4 files changed, 196 insertions, 82 deletions
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java
index d4d306d5af..c25b818aa2 100644
--- a/src/Java/gtPlusPlus/core/material/Material.java
+++ b/src/Java/gtPlusPlus/core/material/Material.java
@@ -237,7 +237,11 @@ public class Material {
}
final Materials isValid = Materials.get(this.getLocalizedName());
- if (isValid == Materials._NULL){
+
+ if (FluidUtils.getFluidStack(localizedName, 1) != null){
+ this.vMoltenFluid = FluidUtils.getFluidStack(localizedName, 1).getFluid();
+ }
+ else if (isValid == Materials._NULL){
this.vMoltenFluid = this.generateFluid();
}
else {
diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
index fd53a9be4d..00388c4a5c 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -17,7 +17,9 @@ import gtPlusPlus.core.item.base.rotors.BaseItemRotor;
import gtPlusPlus.core.item.base.screws.BaseItemScrew;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.fluid.FluidUtils;
import gtPlusPlus.core.util.item.ItemUtils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.loaders.*;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
@@ -33,64 +35,78 @@ public class MaterialGenerator {
generate(matInfo, generateEverything, true);
}
- public static void generate(final Material matInfo, final boolean generateEverything, final boolean generateBlastSmelterRecipes){
- final String unlocalizedName = matInfo.getUnlocalizedName();
- final String materialName = matInfo.getLocalizedName();
- final short[] C = matInfo.getRGBA();
- final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
- final boolean hotIngot = matInfo.requiresBlastFurnace();
- int materialTier = matInfo.vTier; //TODO
-
- if ((materialTier > 10) || (materialTier <= 0)){
- materialTier = 2;
- }
-
- int sRadiation = 0;
- if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){
- sRadiation = matInfo.vRadiationLevel;
- }
+ public static boolean generate(final Material matInfo, final boolean generateEverything, final boolean generateBlastSmelterRecipes){
+ try {
+ final String unlocalizedName = matInfo.getUnlocalizedName();
+ final String materialName = matInfo.getLocalizedName();
+ final short[] C = matInfo.getRGBA();
+ final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
+ final boolean hotIngot = matInfo.requiresBlastFurnace();
+ int materialTier = matInfo.vTier; //TODO
+
+ if ((materialTier > 10) || (materialTier <= 0)){
+ materialTier = 2;
+ }
- if (matInfo.getState() == MaterialState.SOLID){
- if (generateEverything == true){
- if (sRadiation >= 1){
- Item temp;
- Block tempBlock;
- tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
- temp = new BaseItemIngot(matInfo);
+ int sRadiation = 0;
+ if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){
+ sRadiation = matInfo.vRadiationLevel;
+ }
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation);
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation);
- temp = new BaseItemNugget(matInfo);
- temp = new BaseItemPlate(matInfo);
- temp = new BaseItemRod(matInfo);
- temp = new BaseItemRodLong(matInfo);
- }
+ if (matInfo.getState() == MaterialState.SOLID){
+ if (generateEverything == true){
+ if (sRadiation >= 1){
+ Item temp;
+ Block tempBlock;
+ tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
+ temp = new BaseItemIngot(matInfo);
+
+ temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation);
+ temp = new BaseItemNugget(matInfo);
+ temp = new BaseItemPlate(matInfo);
+ temp = new BaseItemRod(matInfo);
+ temp = new BaseItemRodLong(matInfo);
+ }
- else {
+ else {
+ Item temp;
+ Block tempBlock;
+ tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
+ tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour);
+ temp = new BaseItemIngot(matInfo);
+ if (hotIngot){
+ temp = new BaseItemIngotHot(matInfo);
+ }
+ temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation);
+ temp = new BaseItemNugget(matInfo);
+ temp = new BaseItemPlate(matInfo);
+ temp = new BaseItemPlateDouble(matInfo);
+ temp = new BaseItemBolt(matInfo);
+ temp = new BaseItemRod(matInfo);
+ temp = new BaseItemRodLong(matInfo);
+ temp = new BaseItemRing(matInfo);
+ temp = new BaseItemScrew(matInfo);
+ temp = new BaseItemRotor(matInfo);
+ temp = new BaseItemGear(matInfo);
+ }
+ } else {
Item temp;
Block tempBlock;
tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
- tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour);
temp = new BaseItemIngot(matInfo);
- if (hotIngot){
- temp = new BaseItemIngotHot(matInfo);
- }
temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation);
temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation);
temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation);
temp = new BaseItemNugget(matInfo);
temp = new BaseItemPlate(matInfo);
temp = new BaseItemPlateDouble(matInfo);
- temp = new BaseItemBolt(matInfo);
- temp = new BaseItemRod(matInfo);
- temp = new BaseItemRodLong(matInfo);
- temp = new BaseItemRing(matInfo);
- temp = new BaseItemScrew(matInfo);
- temp = new BaseItemRotor(matInfo);
- temp = new BaseItemGear(matInfo);
}
- } else {
+ }
+ else if (matInfo.getState() == MaterialState.LIQUID){
Item temp;
Block tempBlock;
tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
@@ -101,33 +117,29 @@ public class MaterialGenerator {
temp = new BaseItemNugget(matInfo);
temp = new BaseItemPlate(matInfo);
temp = new BaseItemPlateDouble(matInfo);
+ }
+ else if (matInfo.getState() == MaterialState.PURE_LIQUID){
+ FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C);
+ return true;
}
- }
- else if (matInfo.getState() == MaterialState.LIQUID){
- Item temp;
- Block tempBlock;
- tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
- temp = new BaseItemIngot(matInfo);
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation);
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation);
- temp = new BaseItemNugget(matInfo);
- temp = new BaseItemPlate(matInfo);
- temp = new BaseItemPlateDouble(matInfo);
- }
-
- //Add A jillion Recipes - old code
- RecipeGen_AlloySmelter.generateRecipes(matInfo);
- RecipeGen_Assembler.generateRecipes(matInfo);
- RecipeGen_BlastSmelter.generateARecipe(matInfo);
- RecipeGen_DustGeneration.generateRecipes(matInfo);
- RecipeGen_Extruder.generateRecipes(matInfo);
- RecipeGen_Fluids.generateRecipes(matInfo);
- RecipeGen_Plates.generateRecipes(matInfo);
- RecipeGen_ShapedCrafting.generateRecipes(matInfo);
+ //Add A jillion Recipes - old code
+ RecipeGen_AlloySmelter.generateRecipes(matInfo);
+ RecipeGen_Assembler.generateRecipes(matInfo);
+ RecipeGen_BlastSmelter.generateARecipe(matInfo);
+ RecipeGen_DustGeneration.generateRecipes(matInfo);
+ RecipeGen_Extruder.generateRecipes(matInfo);
+ RecipeGen_Fluids.generateRecipes(matInfo);
+ RecipeGen_Plates.generateRecipes(matInfo);
+ RecipeGen_ShapedCrafting.generateRecipes(matInfo);
+ return true;
+ } catch (Throwable t)
+ {
+ Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate.");
+ return false;
+ }
}
-
+
public static void generateDusts(final Material matInfo){
final String unlocalizedName = matInfo.getUnlocalizedName();
final String materialName = matInfo.getLocalizedName();
@@ -145,23 +157,24 @@ public class MaterialGenerator {
}
if (matInfo.getState() == MaterialState.SOLID){
- Item temp;
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation, false);
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation, false);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation, false);
+ Item temp;
+ temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation, false);
+ temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation, false);
+ temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation, false);
}
//Add A jillion Recipes - old code
RecipeGen_DustGeneration.addMixerRecipe_Standalone(matInfo);
RecipeGen_Fluids.generateRecipes(matInfo);
}
-
+
public static void generateNuclearMaterial(final Material matInfo){
generateNuclearMaterial(matInfo, true);
}
@SuppressWarnings("unused")
public static void generateNuclearMaterial(final Material matInfo, final boolean generatePlates){
+ try {
final String unlocalizedName = matInfo.getUnlocalizedName();
final String materialName = matInfo.getLocalizedName();
final short[] C = matInfo.getRGBA();
@@ -190,6 +203,9 @@ public class MaterialGenerator {
RecipeGen_Fluids.generateRecipes(matInfo);
RecipeGen_Assembler.generateRecipes(matInfo);
RecipeGen_DustGeneration.generateRecipes(matInfo, true);
+ } catch (Throwable t){
+ Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate.");
+ }
}
diff --git a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
index e4576eea7b..87830ab493 100644
--- a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
+++ b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
@@ -106,11 +106,11 @@ public class FLUORIDES {
public static final Material BERYLLIUM_FLUORIDE = new Material(
"Beryllium Fluoride", //Material Name
MaterialState.LIQUID, //State
- new short[]{120, 180, 120, 0}, //Material Colour
- Materials.Beryllium.mMeltingPoint, //Melting Point in C
- Materials.Beryllium.mBlastFurnaceTemp, //Boiling Point in C
- ((ELEMENT.getInstance().BERYLLIUM.getProtons()+(ELEMENT.getInstance().FLUORINE.getProtons()*2))/3), //Protons
- ((ELEMENT.getInstance().BERYLLIUM.getNeutrons()+(ELEMENT.getInstance().FLUORINE.getNeutrons()*2))/3), //Neutrons
+ new short[]{120, 210, 120, 0}, //Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
false, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
@@ -134,9 +134,102 @@ public class FLUORIDES {
});
+ //LFTR sub components
+
+ public static final Material HYDROXIDE = new Material(
+ "Hydroxide", //Material Name
+ MaterialState.PURE_LIQUID, //State
+ new short[]{240, 220, 240, 0}, //Material Colour
+ -1, //Melting Point in C
+ -1, //Boiling Point in C
+ -1, //Protons
+ -1,
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1)
+ });
+
+ public static final Material AMMONIA = new Material(
+ "Ammonia", //Material Name
+ MaterialState.PURE_LIQUID, //State
+ new short[]{240, 220, 240, 0}, //Material Colour
+ -77, //Melting Point in C
+ -33, //Boiling Point in C
+ -1, //Protons
+ -1,
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3)
+ });
+
+ public static final Material AMMONIUM = new Material(
+ "Ammonium", //Material Name
+ MaterialState.PURE_LIQUID, //State
+ new short[]{240, 220, 240, 0}, //Material Colour
+ -1, //Melting Point in C
+ -1, //Boiling Point in C
+ -1, //Protons
+ -1,
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4)
+ });
+
+ public static final Material AMMONIUM_BIFLUORIDE = new Material(
+ "Ammonium Bifluoride", //Material Name
+ MaterialState.PURE_LIQUID, //State
+ new short[]{240, 220, 240, 0}, //Material Colour
+ 126, //Melting Point in C
+ 240, //Boiling Point in C
+ -1, //Protons
+ -1,
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(FLUORIDES.AMMONIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 2)
+ });
+
+ public static final Material BERYLLIUM_HYDROXIDE = new Material(
+ "Beryllium Hydroxide", //Material Name
+ MaterialState.PURE_LIQUID, //State
+ new short[]{180, 250, 180, 0}, //Material Colour
+ 1000, //Melting Point in C
+ -1, //Boiling Point in C
+ -1,
+ -1,
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 1),
+ new MaterialStack(FLUORIDES.HYDROXIDE, 2)
+ });
+
+ public static final Material AMMONIUM_TETRAFLUOROBERYLLATE = new Material(
+ "Ammonium Tetrafluoroberyllate", //Material Name
+ MaterialState.PURE_LIQUID, //State
+ new short[]{140, 220, 140, 0}, //Material Colour
+ 280, //Melting Point in C
+ -1, //Boiling Point in C
+ -1, //Protons
+ -1,
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(FLUORIDES.AMMONIUM, 2),
+ new MaterialStack(FLUORIDES.BERYLLIUM_HYDROXIDE, 1)
+ });
+
+
+
//LFTR Output
-
-
public static final Material NEPTUNIUM_HEXAFLUORIDE = new Material(
"Neptunium Hexafluoride", //Material Name
MaterialState.GAS, //State
diff --git a/src/Java/gtPlusPlus/core/material/state/MaterialState.java b/src/Java/gtPlusPlus/core/material/state/MaterialState.java
index 200e80e8ab..88447395db 100644
--- a/src/Java/gtPlusPlus/core/material/state/MaterialState.java
+++ b/src/Java/gtPlusPlus/core/material/state/MaterialState.java
@@ -4,7 +4,8 @@ public enum MaterialState {
SOLID(0),
LIQUID(1),
GAS(2),
- PLASMA(3);
+ PLASMA(3),
+ PURE_LIQUID(4);
private int STATE;
private MaterialState (final int State){
this.STATE = State;