aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/material
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2017-12-24 11:54:30 +1000
committerJordan Byrne <draknyte1@hotmail.com>2017-12-24 11:54:30 +1000
commitecf908e98ccee72a713091e8ab547e35a41d7436 (patch)
treef0dade1481aa02fd0ac4fcf8a672cc7a761a0547 /src/Java/gtPlusPlus/core/material
parentb9fe3352840abe0846834cefd578895ec6f5e520 (diff)
parentfa5de3584ce7bc97ce6f32b31f6062b5b6e89e75 (diff)
downloadGT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.tar.gz
GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.tar.bz2
GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.zip
> Why does Git make me do these? arghhh...
Merge branch 'master' of https://github.com/draknyte1/GTplusplus # Conflicts: # src/Java/gtPlusPlus/core/material/ALLOY.java # src/Java/gtPlusPlus/core/material/ELEMENT.java # src/Java/gtPlusPlus/core/material/Material.java # src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
Diffstat (limited to 'src/Java/gtPlusPlus/core/material')
-rw-r--r--src/Java/gtPlusPlus/core/material/ALLOY.java2
-rw-r--r--src/Java/gtPlusPlus/core/material/ELEMENT.java17
-rw-r--r--src/Java/gtPlusPlus/core/material/Material.java303
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java32
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialStack.java10
-rw-r--r--src/Java/gtPlusPlus/core/material/ORES.java84
-rw-r--r--src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java1
-rw-r--r--src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java14
-rw-r--r--src/Java/gtPlusPlus/core/material/state/MaterialState.java3
9 files changed, 336 insertions, 130 deletions
diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java
index 8d1d4e5ecd..84bd859ed4 100644
--- a/src/Java/gtPlusPlus/core/material/ALLOY.java
+++ b/src/Java/gtPlusPlus/core/material/ALLOY.java
@@ -589,7 +589,7 @@ public final class ALLOY {
-1, //Boiling Point in C
-1,
-1,
- true, //Uses Blast furnace?
+ false, //Uses Blast furnace?
new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 5),
new MaterialStack(ELEMENT.getInstance().NAQUADAH, 9)
diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java
index 859ebd86cf..eccd283da9 100644
--- a/src/Java/gtPlusPlus/core/material/ELEMENT.java
+++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java
@@ -1,6 +1,7 @@
package gtPlusPlus.core.material;
import gregtech.api.enums.Materials;
+import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.StringUtils;
import gtPlusPlus.core.util.materials.MaterialUtils;
@@ -10,7 +11,17 @@ public final class ELEMENT {
private static final ELEMENT thisClass = new ELEMENT();
public ELEMENT(){
-
+
+ //GTNH Trinium Handling
+ if (CORE.GTNH){
+ TRINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.valueOf("Trinium"));
+ TRINIUM_REFINED = new Material("Refined Trinium", MaterialState.SOLID, new short[]{210, 255, 170}, 4304, 14057, 181, 133, false, "Ke", 0, new MaterialStack[]{new MaterialStack(TRINIUM, 1)});//Not a GT Inherited Material
+ }
+ else {
+ TRINIUM = new Material("Trinium", MaterialState.SOLID, new short[]{70, 110, 30}, 604, 4057, 181, 133, false, "Ke", 0, false);//Not a GT Inherited Material
+ TRINIUM_REFINED = new Material("Refined Trinium", MaterialState.SOLID, new short[]{210, 255, 170}, 4304, 14057, 181, 133, false, "Ke", 0, new MaterialStack[]{new MaterialStack(TRINIUM, 1)});//Not a GT Inherited Material
+ }
+
}
public static ELEMENT getInstance(){
@@ -131,7 +142,7 @@ public final class ELEMENT {
//Fictional
public final Material NAQUADAH = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadah);
- public final Material TRINIUM = new Material("Trinium", MaterialState.SOLID, new short[]{170, 210, 130}, 604, 4057, 181, 133, false, "Ke", 0, false);//Not a GT Inherited Material
- public final Material TRINIUM_REFINED = new Material("Refined Trinium", MaterialState.SOLID, new short[]{210, 255, 170}, 4304, 14057, 181, 133, false, "Ke", 0, new MaterialStack[]{new MaterialStack(TRINIUM, 1)});//Not a GT Inherited Material
+ public final Material TRINIUM;
+ public final Material TRINIUM_REFINED;
//https://github.com/Blood-Asp/GT5-Unofficial/issues/609
}
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java
index 40d8461209..b04ce3baac 100644
--- a/src/Java/gtPlusPlus/core/material/Material.java
+++ b/src/Java/gtPlusPlus/core/material/Material.java
@@ -2,9 +2,10 @@ package gtPlusPlus.core.material;
import static gregtech.api.enums.GT_Values.M;
-import java.util.ArrayList;
+import java.util.*;
import gregtech.api.enums.*;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.base.cell.BaseItemCell;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.StringUtils;
@@ -28,7 +29,7 @@ public class Material {
private final Fluid vMoltenFluid;
private final Fluid vPlasma;
-
+
private final boolean vGenerateCells;
protected Object dataVar = MathUtils.generateSingularRandomHexValue();
@@ -60,10 +61,21 @@ public class Material {
public final int vToolQuality;
public final int vHarvestLevel;
+
+ public static Map<Integer, Materials> invalidMaterials = new HashMap<Integer, Materials>();
+
+ public Material(String materialName, MaterialState defaultState, short[] rgba, int radiationLevel, MaterialStack[] materialStacks) {
+ this (materialName, defaultState, 0, rgba, -1, -1, -1, -1, false, "", radiationLevel, false, materialStacks);
+ }
+
public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final MaterialStack... inputs){
this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, inputs);
}
+ public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, boolean generateCells, final MaterialStack... inputs){
+ this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, generateCells, inputs);
+ }
+
public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final int radiationLevel, final MaterialStack... inputs){
this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", radiationLevel, inputs);
}
@@ -83,7 +95,7 @@ public class Material {
public Material(final String materialName, final MaterialState defaultState, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){
this (materialName, defaultState, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, inputs);
}
-
+
public Material(final String materialName, final MaterialState defaultState, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean generateCells, final MaterialStack... inputs){
this.unlocalizedName = Utils.sanitizeString(materialName);
@@ -105,7 +117,7 @@ public class Material {
}
}
}
-
+
//Set Melting/Boiling point, if value is -1 calculate it from compound inputs.
if (meltingPoint != -1){
@@ -128,7 +140,7 @@ public class Material {
this.meltingPointK = (int) MathUtils.celsiusToKelvin(this.meltingPointC);
this.boilingPointK = (int) MathUtils.celsiusToKelvin(this.boilingPointC);
-
+
//Set Proton/Neutron count, if value is -1 calculate it from compound inputs.
if (protons != -1){
this.vProtons = protons;
@@ -142,10 +154,10 @@ public class Material {
else {
this.vNeutrons = this.calculateNeutrons();
}
-
-
-
-
+
+
+
+
this.vMass = this.getMass();
//Sets tool Durability
@@ -239,20 +251,20 @@ public class Material {
this.vChemicalFormula = this.getToolTip(chemicalSymbol, OrePrefixes.dust.mMaterialAmount / M, true);
}
else if (!this.vChemicalSymbol.equals("")){
- Utils.LOG_WARNING("materialInput is null, using a valid chemical symbol.");
+ Logger.WARNING("materialInput is null, using a valid chemical symbol.");
this.vChemicalFormula = this.vChemicalSymbol;
}
else{
- Utils.LOG_WARNING("MaterialInput == null && chemicalSymbol probably equals nothing");
+ Logger.WARNING("MaterialInput == null && chemicalSymbol probably equals nothing");
this.vChemicalFormula = "??";
}
+
final Materials isValid = Materials.get(this.getLocalizedName());
-
if (FluidUtils.getFluidStack(localizedName, 1) != null){
this.vMoltenFluid = FluidUtils.getFluidStack(localizedName, 1).getFluid();
}
- else if (isValid == Materials._NULL){
+ else if (isValid == null || isValid == Materials._NULL){
this.vMoltenFluid = this.generateFluid();
}
else {
@@ -269,8 +281,6 @@ public class Material {
this.vPlasma = this.generatePlasma();
- //dataVar = MathUtils.generateSingularRandomHexValue();
-
String ratio = "";
if (this.vSmallestRatio != null) {
for (int hu=0;hu<this.vSmallestRatio.length;hu++){
@@ -283,14 +293,14 @@ public class Material {
}
}
- Utils.LOG_WARNING("Creating a Material instance for "+materialName);
- Utils.LOG_WARNING("Formula: "+this.vChemicalFormula + " Smallest Stack: "+this.smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio);
- Utils.LOG_WARNING("Protons: "+this.vProtons);
- Utils.LOG_WARNING("Neutrons: "+this.vNeutrons);
- Utils.LOG_WARNING("Mass: "+this.vMass+"/units");
- Utils.LOG_WARNING("Melting Point: "+this.meltingPointC+"C.");
- Utils.LOG_WARNING("Boiling Point: "+this.boilingPointC+"C.");
- }
+ Logger.WARNING("Creating a Material instance for "+materialName);
+ Logger.WARNING("Formula: "+this.vChemicalFormula + " Smallest Stack: "+this.smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio);
+ Logger.WARNING("Protons: "+this.vProtons);
+ Logger.WARNING("Neutrons: "+this.vNeutrons);
+ Logger.WARNING("Mass: "+this.vMass+"/units");
+ Logger.WARNING("Melting Point: "+this.meltingPointC+"C.");
+ Logger.WARNING("Boiling Point: "+this.boilingPointC+"C.");
+ }
public final String getLocalizedName(){
if (this.localizedName != null) {
@@ -448,8 +458,8 @@ public class Material {
try {
testNull = this.vMaterialInput.get(i).getValidStack();
} catch (final Throwable r){
- Utils.LOG_WARNING("Failed gathering material stack for "+this.localizedName+".");
- Utils.LOG_WARNING("What Failed: Length:"+this.vMaterialInput.size()+" current:"+i);
+ Logger.WARNING("Failed gathering material stack for "+this.localizedName+".");
+ Logger.WARNING("What Failed: Length:"+this.vMaterialInput.size()+" current:"+i);
}
try {
if (testNull != null){
@@ -457,7 +467,7 @@ public class Material {
temp[i] = this.vMaterialInput.get(i).getValidStack();
}
} catch (final Throwable r){
- Utils.LOG_WARNING("Failed setting slot "+i+", using "+this.localizedName);
+ Logger.WARNING("Failed setting slot "+i+", using "+this.localizedName);
}
}
return temp;
@@ -505,8 +515,8 @@ public class Material {
public final long[] getSmallestRatio(final ArrayList<MaterialStack> tempInput){
if (tempInput != null){
if (!tempInput.isEmpty()){
- Utils.LOG_WARNING("length: "+tempInput.size());
- Utils.LOG_WARNING("(inputs != null): "+(tempInput != null));
+ Logger.WARNING("length: "+tempInput.size());
+ Logger.WARNING("(inputs != null): "+(tempInput != null));
//Utils.LOG_WARNING("length: "+inputs.length);
final long[] tempRatio = new long[tempInput.size()];
for (int x=0;x<tempInput.size();x++){
@@ -524,7 +534,7 @@ public class Material {
for (int r=0;r<tempRatio.length;r++){
tempRatioStringThing1 = tempRatioStringThing1 + tempRatio[r] +" : ";
}
- Utils.LOG_WARNING("Default Ratio: "+tempRatioStringThing1);
+ Logger.WARNING("Default Ratio: "+tempRatioStringThing1);
String tempRatioStringThing = "";
int tempSmallestCraftingUseSize = 0;
@@ -533,7 +543,7 @@ public class Material {
tempSmallestCraftingUseSize = (int) (tempSmallestCraftingUseSize + smallestRatio[r]);
}
//this.smallestStackSizeWhenProcessing = tempSmallestCraftingUseSize;
- Utils.LOG_WARNING("Smallest Ratio: "+tempRatioStringThing);
+ Logger.WARNING("Smallest Ratio: "+tempRatioStringThing);
return smallestRatio;
}
}
@@ -545,7 +555,7 @@ public class Material {
if (!aShowQuestionMarks && (this.vChemicalFormula.equals("?")||this.vChemicalFormula.equals("??"))) {
return "";
}
- Utils.LOG_WARNING("===============| Calculating Atomic Formula for "+this.localizedName+" |===============");
+ Logger.WARNING("===============| Calculating Atomic Formula for "+this.localizedName+" |===============");
if (!chemSymbol.equals("")) {
return chemSymbol;
}
@@ -588,101 +598,164 @@ public class Material {
return StringUtils.subscript(dummyFormula);
//return dummyFormula;
}
- Utils.LOG_WARNING("dummyFormulaArray <= 0");
+ Logger.WARNING("dummyFormulaArray <= 0");
}
- Utils.LOG_WARNING("dummyFormulaArray == null");
+ Logger.WARNING("dummyFormulaArray == null");
}
- Utils.LOG_WARNING("tempInput.length <= 0");
+ Logger.WARNING("tempInput.length <= 0");
}
- Utils.LOG_WARNING("tempInput == null");
+ Logger.WARNING("tempInput == null");
return "??";
}
public final Fluid generateFluid(){
- try {
- if (Materials.get(this.localizedName) == Materials.Clay){
- return null;
- }
- } catch (final Throwable e){}
-
- if (Materials.get(this.localizedName).mFluid == null){
- Utils.LOG_WARNING("Generating our own fluid.");
-
- //Generate a Cell if we need to
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){
- if (this.vGenerateCells){
- final Item temp = new BaseItemCell(this);
+ final Materials isValid = Materials.get(this.getLocalizedName());
+ Logger.WARNING("Is "+this.getLocalizedName()+" a Gregtech material? "+(isValid != null && isValid != Materials._NULL)+" | Found "+isValid.mDefaultLocalName);
+ if (isValid != Materials._NULL){
+ for (Materials m : invalidMaterials.values()){
+ if (isValid == m){
+ Logger.WARNING("Trying to generate a fluid for blacklisted material: "+m.mDefaultLocalName);
+ FluidStack a1 = m.getFluid(1);
+ FluidStack a2 = m.getGas(1);
+ FluidStack a3 = m.getMolten(1);
+ FluidStack a4 = m.getSolid(1);
+ FluidStack a5 = m.getPlasma(1);
+ if (a1 != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. Fluid.");
+ return a1.getFluid();
+ }
+ if (a2 != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. Gas.");
+ return a2.getFluid();
+ }
+ if (a3 != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. Molten.");
+ return a3.getFluid();
+ }
+ if (a4 != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. Solid.");
+ return a4.getFluid();
+ }
+ if (a5 != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. Plasma.");
+ return a5.getFluid();
+ }
+ Logger.WARNING("Using null.");
+ return null;
}
}
+ }
- if (this.materialState == MaterialState.SOLID){
- return FluidUtils.addGTFluid(
- this.getUnlocalizedName(),
- "Molten "+this.getLocalizedName(),
- this.RGBA,
- this.materialState.ID(),
- this.getMeltingPointK(),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1),
- ItemList.Cell_Empty.get(1L, new Object[0]),
- 1000);
+ if (this.materialState == MaterialState.SOLID){
+ if (isValid.mFluid != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. mFluid.");
+ return isValid.mFluid;
+ }
+ else if (isValid.mStandardMoltenFluid != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. mStandardMoltenFluid.");
+ return isValid.mStandardMoltenFluid;
}
- else if (this.materialState == MaterialState.LIQUID){
- return FluidUtils.addGTFluid(
- this.getUnlocalizedName(),
- this.getLocalizedName(),
- this.RGBA,
- this.materialState.ID(),
- this.getMeltingPointK(),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1),
- ItemList.Cell_Empty.get(1L, new Object[0]),
- 1000);
+ }
+ else if (this.materialState == MaterialState.GAS){
+ if (isValid.mGas != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. mGas.");
+ return isValid.mGas;
+ }
+ }
+ else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){
+ if (isValid.mFluid != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. mFluid.");
+ return isValid.mFluid;
+ }
+ else if (isValid.mGas != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. mGas.");
+ return isValid.mGas;
}
- else if (this.materialState == MaterialState.GAS){
- return FluidUtils.addGTFluid(
- this.getUnlocalizedName(),
- this.getLocalizedName()+" Gas",
- this.RGBA,
- this.materialState.ID(),
- this.getMeltingPointK(),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1),
- ItemList.Cell_Empty.get(1L, new Object[0]),
- 1000);
+ else if (isValid.mStandardMoltenFluid != null){
+ Logger.WARNING("Using a pre-defined Fluid from GT. mStandardMoltenFluid.");
+ return isValid.mStandardMoltenFluid;
}
- else { //Plasma
- return this.generatePlasma();
+ }
+
+ Logger.WARNING("Generating our own fluid.");
+ //Generate a Cell if we need to
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){
+ if (this.vGenerateCells){
+ final Item temp = new BaseItemCell(this);
+ Logger.WARNING("Generated a cell for "+this.getUnlocalizedName());
}
+ else {
+ Logger.WARNING("Did not generate a cell for "+this.getUnlocalizedName());
+ }
+ }
+
+ if (this.materialState == MaterialState.SOLID){
+ return FluidUtils.addGTFluid(
+ this.getUnlocalizedName(),
+ "Molten "+this.getLocalizedName(),
+ this.RGBA,
+ this.materialState.ID(),
+ this.getMeltingPointK(),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1),
+ ItemList.Cell_Empty.get(1L, new Object[0]),
+ 1000);
+ }
+ else if (this.materialState == MaterialState.LIQUID){
+ return FluidUtils.addGTFluid(
+ this.getUnlocalizedName(),
+ this.getLocalizedName(),
+ this.RGBA,
+ this.materialState.ID(),
+ this.getMeltingPointK(),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1),
+ ItemList.Cell_Empty.get(1L, new Object[0]),
+ 1000);
+ }
+ else if (this.materialState == MaterialState.GAS){
+ return FluidUtils.addGTFluid(
+ this.getUnlocalizedName(),
+ this.getLocalizedName()+" Gas",
+ this.RGBA,
+ this.materialState.ID(),
+ this.getMeltingPointK(),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1),
+ ItemList.Cell_Empty.get(1L, new Object[0]),
+ 1000);
+ }
+ else { //Plasma
+ return this.generatePlasma();
}
- Utils.LOG_WARNING("Getting the fluid from a GT material instead.");
- return Materials.get(this.localizedName).mFluid;
}
public final Fluid generatePlasma(){
- final Materials isValid = Materials.get(this.getLocalizedName());
- if ((isValid != Materials._NULL) && (isValid != null) && (isValid != Materials.Clay) && (isValid != Materials.Clay)
- && (isValid != Materials.Phosphorus) && (isValid != Materials.Steel) && (isValid != Materials.Bronze)){
- if (isValid.mPlasma != null){
- Utils.LOG_WARNING("Using a pre-defined Plasma from GT.");
- return isValid.mPlasma;
- }
- }
-
- if (this.vGenerateCells){
+ final Materials isValid = Materials.get(this.getLocalizedName());
+
+ if (!this.vGenerateCells){
return null;
}
-
- Utils.LOG_WARNING("Generating our own Plasma.");
+ for (Materials m : invalidMaterials.values()){
+ if (isValid == m){
+ return (m.mPlasma != null ? m.mPlasma : null);
+ }
+ }
+ if (isValid.mPlasma != null){
+ Logger.WARNING("Using a pre-defined Plasma from GT.");
+ return isValid.mPlasma;
+ }
+
+ Logger.WARNING("Generating our own Plasma.");
return FluidUtils.addGTPlasma(this);
- //return null;
}
- final public FluidStack getFluid(final int fluidAmount) {
- //Utils.LOG_WARNING("Attempting to get "+fluidAmount+"L of "+this.vMoltenFluid.getName());
+ final public FluidStack getFluid(final int fluidAmount) {
+ if (this.vMoltenFluid == null){
+ return null;
+ }
final FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount);
- //Utils.LOG_WARNING("Info: "+moltenFluid.getFluid().getName()+" Info: "+moltenFluid.amount+" Info: "+moltenFluid.getFluidID());
return moltenFluid;
}
@@ -690,12 +763,17 @@ public class Material {
final public int calculateMeltingPoint(){
int meltingPoint = 0;
for (MaterialStack part : this.vMaterialInput){
- int incrementor = part.getStackMaterial().getMeltingPointC();
- meltingPoint += incrementor;
- Utils.LOG_WARNING("Melting Point for "+this.getLocalizedName()+" increased to "+ incrementor);
+ if (part != null){
+ int incrementor = part.getStackMaterial().getMeltingPointC();
+ meltingPoint += incrementor;
+ Logger.WARNING("Melting Point for "+this.getLocalizedName()+" increased to "+ incrementor);
+ }
+ else {
+ Logger.MATERIALS(this.getLocalizedName()+" has a really invalid composition.");
+ }
}
int divisor = (this.vMaterialInput.size()>0 ? this.vMaterialInput.size() : 1);
- Utils.LOG_WARNING("Dividing "+meltingPoint+" / "+divisor+" to get average melting point.");
+ Logger.WARNING("Dividing "+meltingPoint+" / "+divisor+" to get average melting point.");
meltingPoint = (meltingPoint/divisor);
return meltingPoint;
}
@@ -703,7 +781,12 @@ public class Material {
final public int calculateBoilingPoint(){
int boilingPoint = 0;
for (MaterialStack part : this.vMaterialInput){
- boilingPoint += part.getStackMaterial().getBoilingPointC();
+ if (part != null){
+ boilingPoint += part.getStackMaterial().getBoilingPointC();
+ }
+ else {
+ Logger.MATERIALS(this.getLocalizedName()+" has a really invalid composition.");
+ }
}
int divisor = (this.vMaterialInput.size()>0 ? this.vMaterialInput.size() : 1);
boilingPoint = (boilingPoint/divisor);
@@ -713,7 +796,12 @@ public class Material {
final public long calculateProtons(){
long protonCount = 0;
for (MaterialStack part : this.vMaterialInput){
- protonCount += (part.getStackMaterial().getProtons());
+ if (part != null){
+ protonCount += (part.getStackMaterial().getProtons());
+ }
+ else {
+ Logger.MATERIALS(this.getLocalizedName()+" has a really invalid composition.");
+ }
}
int divisor = (this.vMaterialInput.size()>0 ? this.vMaterialInput.size() : 1);
protonCount = (protonCount/divisor);
@@ -723,7 +811,12 @@ public class Material {
final public long calculateNeutrons(){
long neutronCount = 0;
for (MaterialStack part : this.vMaterialInput){
- neutronCount += (part.getStackMaterial().getNeutrons());
+ if (part != null){
+ neutronCount += (part.getStackMaterial().getNeutrons());
+ }
+ else {
+ Logger.MATERIALS(this.getLocalizedName()+" has a really invalid composition.");
+ }
}
int divisor = (this.vMaterialInput.size()>0 ? this.vMaterialInput.size() : 1);
neutronCount = (neutronCount/divisor);
diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
index 65c0f1e6c0..727f929036 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -1,5 +1,6 @@
package gtPlusPlus.core.material;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
import gtPlusPlus.core.block.base.BlockBaseModular;
import gtPlusPlus.core.item.base.bolts.BaseItemBolt;
@@ -8,6 +9,7 @@ import gtPlusPlus.core.item.base.gears.BaseItemGear;
import gtPlusPlus.core.item.base.ingots.BaseItemIngot;
import gtPlusPlus.core.item.base.ingots.BaseItemIngotHot;
import gtPlusPlus.core.item.base.nugget.BaseItemNugget;
+import gtPlusPlus.core.item.base.ore.BaseItemCrushedOre;
import gtPlusPlus.core.item.base.plates.BaseItemPlate;
import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble;
import gtPlusPlus.core.item.base.rings.BaseItemRing;
@@ -19,15 +21,7 @@ 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.loaders.RecipeGen_AlloySmelter;
-import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Assembler;
-import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelter;
-import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration;
-import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder;
-import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Fluids;
-import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates;
-import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling;
-import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting;
+import gtPlusPlus.xmod.gregtech.loaders.*;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
@@ -132,6 +126,18 @@ public class MaterialGenerator {
FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C);
return true;
}
+ else if (matInfo.getState() == MaterialState.ORE){
+ if (sRadiation >= 1){
+ Item temp;
+ Block tempBlock;
+ tempBlock = new BlockBaseModular(matInfo ,BlockTypes.ORE, Colour);
+
+ 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 BaseItemCrushedOre(matInfo);
+ }
+ }
//Add A jillion Recipes - old code
RecipeGen_AlloySmelter.generateRecipes(matInfo);
@@ -146,9 +152,11 @@ public class MaterialGenerator {
RecipeGen_ShapedCrafting.generateRecipes(matInfo);
new RecipeGen_Recycling(matInfo);
return true;
- } catch (final Throwable t)
+
+ } catch (final Throwable t)
+
{
- Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate.");
+ Logger.WARNING(""+matInfo.getLocalizedName()+" failed to generate.");
return false;
}
}
@@ -219,7 +227,7 @@ public class MaterialGenerator {
RecipeGen_DustGeneration.generateRecipes(matInfo, true);
new RecipeGen_Recycling(matInfo);
} catch (final Throwable t){
- Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate.");
+ Logger.WARNING(""+matInfo.getLocalizedName()+" failed to generate.");
}
}
diff --git a/src/Java/gtPlusPlus/core/material/MaterialStack.java b/src/Java/gtPlusPlus/core/material/MaterialStack.java
index e18d738b97..ad7af2052f 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialStack.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialStack.java
@@ -3,7 +3,9 @@ package gtPlusPlus.core.material;
import java.math.BigDecimal;
import java.math.RoundingMode;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.item.ItemUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.ItemStack;
public class MaterialStack {
@@ -51,6 +53,14 @@ public class MaterialStack {
}
public Material getStackMaterial(){
+ if (this.stackMaterial == null){
+ Logger.MATERIALS("Tried getStackMaterial, got an invalid material.");
+ Logger.MATERIALS(ReflectionUtils.getMethodName(0));
+ Logger.MATERIALS(ReflectionUtils.getMethodName(1));
+ Logger.MATERIALS(ReflectionUtils.getMethodName(2));
+ Logger.MATERIALS(ReflectionUtils.getMethodName(3));
+ return null;
+ }
return this.stackMaterial;
}
diff --git a/src/Java/gtPlusPlus/core/material/ORES.java b/src/Java/gtPlusPlus/core/material/ORES.java
new file mode 100644
index 0000000000..4057092a48
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/material/ORES.java
@@ -0,0 +1,84 @@
+package gtPlusPlus.core.material;
+
+import gtPlusPlus.core.material.state.MaterialState;
+
+public final class ORES {
+
+ public static final Material GEIKIELITE = new Material(
+ "Geikielite", //Material Name
+ MaterialState.ORE, //State
+ new short[]{187, 193, 204, 0}, //Material Colour
+ 0, //Radiation
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3)
+ });
+
+ public static final Material ZIMBABWEITE = new Material(
+ "Zimbabweite", //Material Name
+ MaterialState.ORE, //State
+ new short[]{193, 187, 131, 0}, //Material Colour
+ 0, //Radiation
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().POTASSIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().LEAD, 1),
+ new MaterialStack(ELEMENT.getInstance().ARSENIC, 4),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().TANTALUM, 4),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 18)
+ });
+
+ public static final Material TITANITE = new Material(
+ "Titanite", //Material Name
+ MaterialState.ORE, //State
+ new short[]{184, 198, 105, 0}, //Material Colour
+ 0, //Radiation
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 2),
+ new MaterialStack(ELEMENT.getInstance().THORIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 10)
+ });
+
+ public static final Material ZIRCONILITE = new Material(
+ "Zirconolite", //Material Name
+ MaterialState.ORE, //State
+ new short[]{45, 26, 0, 0}, //Material Colour
+ 0, //Radiation
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 14)
+ });
+
+ public static final Material CROCROITE = new Material(
+ "Crocoite", //Material Name
+ MaterialState.ORE, //State
+ new short[]{255, 143, 84, 0}, //Material Colour
+ 0, //Radiation
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().LEAD, 1),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 4)
+ });
+
+ public static final Material NICHROMITE = new Material(
+ "Nichromite", //Material Name
+ MaterialState.ORE, //State
+ new short[]{22, 19, 19, 0}, //Material Colour
+ 0, //Radiation
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 1),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 1),
+ new MaterialStack(ELEMENT.getInstance().IRON, 3),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 8)
+ });
+}
diff --git a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
index c6043a1b3d..5f83074a0d 100644
--- a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
+++ b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
@@ -19,6 +19,7 @@ public class FLUORIDES {
((ELEMENT.getInstance().CALCIUM.getProtons()+(ELEMENT.getInstance().FLUORINE.getProtons()*2))/3), //Protons
((ELEMENT.getInstance().CALCIUM.getNeutrons()+(ELEMENT.getInstance().FLUORINE.getNeutrons()*2))/3), //Neutrons
false, //Uses Blast furnace?
+ false, //Generate cells
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
diff --git a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java
index f6c7d952b8..ea21a1d270 100644
--- a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java
+++ b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java
@@ -13,18 +13,16 @@ public final class NUCLIDE {
public static NUCLIDE getInstance(){return thisClass;}
//Custom Isotopes
- public final Material LITHIUM7 = new Material("Lithium 7", MaterialState.LIQUID, Materials.Lithium.mRGBa, Materials.Lithium.mMeltingPoint, Materials.Lithium.mBlastFurnaceTemp, Materials.Lithium.getProtons(), Materials.Lithium.getNeutrons(), Materials.Lithium.mBlastFurnaceRequired, StringUtils.superscript("7Li"), 0);//Not a GT Inherited Material
+ public final Material LITHIUM7 = new Material("Lithium 7", MaterialState.LIQUID, Materials.Lithium.mRGBa, Materials.Lithium.mMeltingPoint, Materials.Lithium.mBlastFurnaceTemp, Materials.Lithium.getProtons(), Materials.Lithium.getNeutrons(), Materials.Lithium.mBlastFurnaceRequired, StringUtils.superscript("7Li"), 0, false);//Not a GT Inherited Material
public final Material URANIUM232 = new Material("Uranium 232", MaterialState.SOLID, new short[]{88, 220, 103, 0}, 1132, 4131, 92, 140, false, StringUtils.superscript("232U"), 4);//Not a GT Inherited Material
public final Material URANIUM233 = new Material("Uranium 233", MaterialState.SOLID, new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, StringUtils.superscript("233U"), 2);//Not a GT Inherited Material
- public final Material THORIUM232 = new Material("Thorium 232", MaterialState.SOLID, new short[]{15, 60, 15, 0}, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("232Th"), 1);//Not a GT Inherited Material
+ public final Material THORIUM232 = new Material("Thorium 232", MaterialState.SOLID, new short[]{15, 60, 15, 0}, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("232Th"), 1, false);//Not a GT Inherited Material
//RTG Fuels
- public final Material PLUTONIUM238 = new Material("Plutonium-238", MaterialState.SOLID, Materials.Plutonium241.mDurability, Materials.Plutonium241.mRGBa, Materials.Plutonium241.mMeltingPoint, Materials.Plutonium241.mBlastFurnaceTemp, 94, 144, false, StringUtils.superscript("238Pu"), 2);//Not a GT Inherited Material
- public final Material STRONTIUM90 = new Material("Strontium-90", MaterialState.SOLID, Materials.Strontium.mDurability, Materials.Strontium.mRGBa, Materials.Strontium.mMeltingPoint, Materials.Strontium.mBlastFurnaceTemp, 38, 52, false, StringUtils.superscript("90Sr"), 2);//Not a GT Inherited Material
- public final Material POLONIUM210 = new Material("Polonium-210", MaterialState.SOLID, ELEMENT.getInstance().POLONIUM.vDurability, ELEMENT.getInstance().POLONIUM.getRGBA(), ELEMENT.getInstance().POLONIUM.getMeltingPointK(), ELEMENT.getInstance().POLONIUM.getBoilingPointK(), 84, 126, false, StringUtils.superscript("210Po"), 2);//Not a GT Inherited Material
- public final Material AMERICIUM241 = new Material("Americium-241", MaterialState.SOLID, Materials.Americium.mDurability, Materials.Americium.mRGBa, Materials.Americium.mMeltingPoint, Materials.Americium.mBlastFurnaceTemp, 95, 146, false, StringUtils.superscript("241Am"), 2);//Not a GT Inherited Material
-
-
+ public final Material PLUTONIUM238 = new Material("Plutonium-238", MaterialState.SOLID, Materials.Plutonium241.mDurability, Materials.Plutonium241.mRGBa, Materials.Plutonium241.mMeltingPoint, Materials.Plutonium241.mBlastFurnaceTemp, 94, 144, false, StringUtils.superscript("238Pu"), 2, false);//Not a GT Inherited Material
+ public final Material STRONTIUM90 = new Material("Strontium-90", MaterialState.SOLID, Materials.Strontium.mDurability, Materials.Strontium.mRGBa, Materials.Strontium.mMeltingPoint, Materials.Strontium.mBlastFurnaceTemp, 38, 52, false, StringUtils.superscript("90Sr"), 2, false);//Not a GT Inherited Material
+ public final Material POLONIUM210 = new Material("Polonium-210", MaterialState.SOLID, ELEMENT.getInstance().POLONIUM.vDurability, ELEMENT.getInstance().POLONIUM.getRGBA(), ELEMENT.getInstance().POLONIUM.getMeltingPointK(), ELEMENT.getInstance().POLONIUM.getBoilingPointK(), 84, 126, false, StringUtils.superscript("210Po"), 2, false);//Not a GT Inherited Material
+ public final Material AMERICIUM241 = new Material("Americium-241", MaterialState.SOLID, Materials.Americium.mDurability, Materials.Americium.mRGBa, Materials.Americium.mMeltingPoint, Materials.Americium.mBlastFurnaceTemp, 95, 146, false, StringUtils.superscript("241Am"), 2, false);//Not a GT Inherited Material
public static final Material LiFBeF2ThF4UF4 = new Material(
"LiFBeF2ThF4UF4", //Material Name
diff --git a/src/Java/gtPlusPlus/core/material/state/MaterialState.java b/src/Java/gtPlusPlus/core/material/state/MaterialState.java
index 88447395db..284e9582f1 100644
--- a/src/Java/gtPlusPlus/core/material/state/MaterialState.java
+++ b/src/Java/gtPlusPlus/core/material/state/MaterialState.java
@@ -5,7 +5,8 @@ public enum MaterialState {
LIQUID(1),
GAS(2),
PLASMA(3),
- PURE_LIQUID(4);
+ PURE_LIQUID(4),
+ ORE(5);
private int STATE;
private MaterialState (final int State){
this.STATE = State;