diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r-- | src/Java/gtPlusPlus/core/item/ModItems.java | 1 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/material/ALLOY.java | 61 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/material/Material.java | 84 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java | 2 |
4 files changed, 92 insertions, 56 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 1d1b38bcfc..05e5661c69 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -449,6 +449,7 @@ public final class ModItems { GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStack(CORE.MODID+":itemStickyRubber", 1)); itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc).setTextureName(CORE.MODID + ":itemHeliumBlob"); + GT_OreDictUnificator.registerOre("dustHydrogen", new ItemStack(ModItems.itemHeliumBlob)); //GameRegistry.registerItem(itemHeliumBlob, "itemHeliumBlob"); itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit").setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit"); diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index ae1928a749..642e402917 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -65,8 +65,7 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TUNGSTEN, 20), - new MaterialStack(ELEMENT.TANTALUM, 60), + new MaterialStack(ALLOY.TANTALLOY_60, 2), new MaterialStack(ELEMENT.TITANIUM, 12), new MaterialStack(ELEMENT.YTTRIUM, 8) }); @@ -212,10 +211,12 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.CHROMIUM, 25), + new MaterialStack(ELEMENT.CHROMIUM, 26), new MaterialStack(ELEMENT.NICKEL, 6), - new MaterialStack(ELEMENT.COBALT, 9), - new MaterialStack(ALLOY.STEEL, 60) + new MaterialStack(ELEMENT.MOLYBDENUM, 4), + new MaterialStack(ELEMENT.COPPER, 20), + new MaterialStack(ELEMENT.TUNGSTEN, 4), + new MaterialStack(ALLOY.STEEL, 40) }); public static final Material MARAGING250 = new Material( @@ -228,10 +229,11 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TITANIUM, 5), - new MaterialStack(ELEMENT.NICKEL, 25), - new MaterialStack(ELEMENT.COBALT, 10), - new MaterialStack(ALLOY.STEEL, 60) + new MaterialStack(ALLOY.STEEL, 64), + new MaterialStack(ELEMENT.MOLYBDENUM, 4), + new MaterialStack(ELEMENT.TITANIUM, 4), + new MaterialStack(ELEMENT.NICKEL, 16), + new MaterialStack(ELEMENT.COBALT, 8), }); public static final Material MARAGING300 = new Material( @@ -244,10 +246,11 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TITANIUM, 10), - new MaterialStack(ELEMENT.NICKEL, 20), - new MaterialStack(ELEMENT.COBALT, 15), - new MaterialStack(ALLOY.STEEL, 55) + new MaterialStack(ALLOY.STEEL, 64), + new MaterialStack(ELEMENT.TITANIUM, 4), + new MaterialStack(ELEMENT.ALUMINIUM, 4), + new MaterialStack(ELEMENT.NICKEL, 16), + new MaterialStack(ELEMENT.COBALT, 8), }); public static final Material MARAGING350 = new Material( @@ -260,10 +263,11 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TITANIUM, 15), - new MaterialStack(ELEMENT.NICKEL, 20), - new MaterialStack(ELEMENT.COBALT, 10), - new MaterialStack(ALLOY.STEEL, 55) + new MaterialStack(ALLOY.STEEL, 64), + new MaterialStack(ELEMENT.ALUMINIUM, 4), + new MaterialStack(ELEMENT.MOLYBDENUM, 4), + new MaterialStack(ELEMENT.NICKEL, 16), + new MaterialStack(ELEMENT.COBALT, 8), }); public static final Material STELLITE = new Material( @@ -450,8 +454,9 @@ public final class ALLOY { false, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ + new MaterialStack(ELEMENT.SILICON, 40), new MaterialStack(ELEMENT.CARBON, 50), - new MaterialStack(ELEMENT.SILICON, 50) + new MaterialStack(ELEMENT.OXYGEN, 10) }); public static final Material TANTALUM_CARBIDE = new Material( @@ -464,8 +469,9 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ + new MaterialStack(ELEMENT.TANTALUM, 40), new MaterialStack(ELEMENT.CARBON, 50), - new MaterialStack(ELEMENT.TANTALUM, 50) + new MaterialStack(ELEMENT.OXYGEN, 10) }); public static final Material ZIRCONIUM_CARBIDE = new Material( @@ -478,8 +484,9 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ + new MaterialStack(ELEMENT.ZIRCONIUM, 40), new MaterialStack(ELEMENT.CARBON, 50), - new MaterialStack(ELEMENT.ZIRCONIUM, 50) + new MaterialStack(ELEMENT.OXYGEN, 10) }); public static final Material NIOBIUM_CARBIDE = new Material( @@ -492,8 +499,9 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ + new MaterialStack(ELEMENT.NIOBIUM, 40), new MaterialStack(ELEMENT.CARBON, 50), - new MaterialStack(ELEMENT.NIOBIUM, 50) + new MaterialStack(ELEMENT.OXYGEN, 10) }); @@ -506,11 +514,12 @@ public final class ALLOY { 128, //Neutrons true, //Uses Blast furnace? new MaterialStack[]{ - new MaterialStack(ELEMENT.NICKEL, 30), - new MaterialStack(ELEMENT.CHROMIUM, 10), - new MaterialStack(ELEMENT.ZIRCONIUM, 20), - new MaterialStack(ELEMENT.IRON, 30), - new MaterialStack(ELEMENT.TUNGSTEN, 10) + new MaterialStack(ELEMENT.TITANIUM, 18), + new MaterialStack(ELEMENT.CARBON, 18), + new MaterialStack(ELEMENT.POTASSIUM, 18), + new MaterialStack(ELEMENT.LITHIUM, 18), + new MaterialStack(ELEMENT.SULFUR, 18), + new MaterialStack(ELEMENT.HYDROGEN, 10) }); //Material Stacks with Percentage of required elements. diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index c79fc04636..104414ee4c 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -167,14 +167,25 @@ public class Material { Utils.LOG_WARNING("MaterialInput == null && chemicalSymbol probably equals nothing"); this.vChemicalFormula = "??"; } - + this.vMoltenFluid = generateFluid(); dataVar = MathUtils.generateSingularRandomHexValue(); + String ratio = ""; + if (vSmallestRatio != null) + for (int hu=0;hu<vSmallestRatio.length;hu++){ + if (ratio.equals("")){ + ratio = String.valueOf(vSmallestRatio[hu]); + } + else { + ratio = ratio + ":" +vSmallestRatio[hu]; + } + } + Utils.LOG_INFO("Creating a Material instance for "+materialName); - Utils.LOG_INFO("Formula: "+vChemicalFormula + " Smallest Stack: "+smallestStackSizeWhenProcessing+" Smallest Ratio:"+vSmallestRatio); + Utils.LOG_INFO("Formula: "+vChemicalFormula + " Smallest Stack: "+smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio); Utils.LOG_INFO("Protons: "+vProtons); Utils.LOG_INFO("Neutrons: "+vNeutrons); Utils.LOG_INFO("Mass: "+vMass+"/units"); @@ -296,11 +307,11 @@ public class Material { } public ItemStack[] getMaterialComposites(){ - //Utils.LOG_INFO("Something requested the materials needed for "+localizedName); + //Utils.LOG_WARNING("Something requested the materials needed for "+localizedName); if (vMaterialInput != null && vMaterialInput.length >= 1){ ItemStack[] temp = new ItemStack[vMaterialInput.length]; for (int i=0;i<vMaterialInput.length;i++){ - //Utils.LOG_INFO("i:"+i); + //Utils.LOG_WARNING("i:"+i); ItemStack testNull = null; try { testNull = vMaterialInput[i].getDustStack(); @@ -310,7 +321,7 @@ public class Material { } try { if (testNull != null){ - //Utils.LOG_INFO("not null"); + //Utils.LOG_WARNING("not null"); temp[i] = vMaterialInput[i].getDustStack(); } } catch (Throwable r){ @@ -395,7 +406,7 @@ public class Material { if (inputs.length > 0){ Utils.LOG_WARNING("length: "+inputs.length); Utils.LOG_WARNING("(inputs != null): "+(inputs != null)); - //Utils.LOG_INFO("length: "+inputs.length); + //Utils.LOG_WARNING("length: "+inputs.length); double tempPercentage=0; long[] tempRatio = new long[inputs.length]; for (int x=0;x<inputs.length;x++){ @@ -407,7 +418,7 @@ public class Material { } //Check if % of added materials equals roughly 100% /*if (tempPercentage <= 95 || tempPercentage >= 101){ - Utils.LOG_INFO("The compound for "+localizedName+" doesn't equal 98-100%, this isn't good."); + Utils.LOG_WARNING("The compound for "+localizedName+" doesn't equal 98-100%, this isn't good."); }*/ long[] smallestRatio = MathUtils.simplifyNumbersToSmallestForm(tempRatio); @@ -465,19 +476,34 @@ public class Material { if (dummyFormulaArray.length >= 1){ for (int e=0;e<tempInput.length;e++){ if (tempInput[e] != null){ - if (!tempInput[e].stackMaterial.vChemicalSymbol.equals("??")){ - if (dummyFormulaArray[e] > 1){ - dummyFormula = dummyFormula + tempInput[e].stackMaterial.vChemicalSymbol + dummyFormulaArray[e]; - } - else if (dummyFormulaArray[e] == 1){ - dummyFormula = dummyFormula + tempInput[e].stackMaterial.vChemicalSymbol; - } - else if (dummyFormulaArray[e] <= 0){ - dummyFormula = dummyFormula+""; + if (tempInput[e].stackMaterial != null){ + if (!tempInput[e].stackMaterial.vChemicalSymbol.equals("??")){ + if (dummyFormulaArray[e] > 1){ + + if (tempInput[e].stackMaterial.vChemicalFormula.length() > 3){ + dummyFormula = dummyFormula + "(" + tempInput[e].stackMaterial.vChemicalFormula + ")" + dummyFormulaArray[e]; + } + else { + dummyFormula = dummyFormula + tempInput[e].stackMaterial.vChemicalFormula + dummyFormulaArray[e]; + } + } + else if (dummyFormulaArray[e] == 1){ + if (tempInput[e].stackMaterial.vChemicalFormula.length() > 3){ + dummyFormula = dummyFormula + "(" +tempInput[e].stackMaterial.vChemicalFormula + ")"; + } + else { + dummyFormula = dummyFormula + "" +tempInput[e].stackMaterial.vChemicalFormula + ""; + } + } + else if (dummyFormulaArray[e] <= 0){ + dummyFormula = dummyFormula+""; + } } - - }else - dummyFormula = dummyFormula + "??"; + else + dummyFormula = dummyFormula + "??"; + } + else + dummyFormula = dummyFormula + "▓▓"; } else { dummyFormula = dummyFormula+""; @@ -496,11 +522,11 @@ public class Material { return "??"; } - + Fluid generateFluid(){ if (Materials.get(localizedName).mFluid == null){ - Utils.LOG_INFO("Generating our own fluid."); - + Utils.LOG_WARNING("Generating our own fluid."); + //Generate a Cell if we need to if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+getUnlocalizedName(), 1) == null){ Item temp = new BaseItemCell(this); @@ -515,21 +541,21 @@ public class Material { ItemList.Cell_Empty.get(1L, new Object[0]), 1000); } - Utils.LOG_INFO("Getting the fluid from a GT material instead."); + Utils.LOG_WARNING("Getting the fluid from a GT material instead."); return Materials.get(localizedName).mFluid; } public FluidStack getFluid(int fluidAmount) { - Utils.LOG_INFO("Attempting to get "+fluidAmount+"L of "+this.vMoltenFluid.getName()); + Utils.LOG_WARNING("Attempting to get "+fluidAmount+"L of "+this.vMoltenFluid.getName()); FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount); - - Utils.LOG_INFO("Info: "+moltenFluid.getFluid().getName()+" Info: "+moltenFluid.amount+" Info: "+moltenFluid.getFluidID()); - + + Utils.LOG_WARNING("Info: "+moltenFluid.getFluid().getName()+" Info: "+moltenFluid.amount+" Info: "+moltenFluid.getFluidID()); + //FluidStack moltenFluid = FluidUtils.getFluidStack(this.vMoltenFluid.getName(), fluidAmount); /*boolean isNull = (moltenFluid == null); - if (isNull) Utils.LOG_INFO("Did not obtain fluid."); - else Utils.LOG_INFO("Found fluid."); + if (isNull) Utils.LOG_WARNING("Did not obtain fluid."); + else Utils.LOG_WARNING("Found fluid."); if (isNull){ return null; }*/ diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java index 52e925df0e..35605169c5 100644 --- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java @@ -59,7 +59,7 @@ public class MaterialUtils { if (material.isRadioactive()){ radioactivity = 1; } - if (hasValidRGBA(rgba)){ + if (hasValidRGBA(rgba) || element == Element.H){ //ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material); //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material); return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, null, chemicalFormula, radioactivity); |