diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-10-26 15:46:55 +0100 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-10-26 15:46:55 +0100 |
commit | 2cf05c4deaf3a26626853431f725d0ca375ffec3 (patch) | |
tree | 025ae135b88af6b9a0437a3721bcc2dec9ccc3e3 /src/Java/gtPlusPlus/core/material | |
parent | e9dbe58c39b56d562bcdc17b1100a7c26ce7c10e (diff) | |
download | GT5-Unofficial-2cf05c4deaf3a26626853431f725d0ca375ffec3.tar.gz GT5-Unofficial-2cf05c4deaf3a26626853431f725d0ca375ffec3.tar.bz2 GT5-Unofficial-2cf05c4deaf3a26626853431f725d0ca375ffec3.zip |
+ Added 4 new High-Tier Alloys. Lafium, Cinobite, Pikyonite & Abyssal.
+ Added missing Germanium Dust.
+ Added compatibility for Witchery.
- Removed portability of Tanks for GTNH, tanks are still portable otherwise.
$ Fixed calculations for automatic recipe generation, EBF and ABS recipe requirements for GT++ Alloys are now significantly increased.
$ Fixed missing Control Core textures.
% Cleaned up some recipe generation.
% Improved Material.java.
Diffstat (limited to 'src/Java/gtPlusPlus/core/material')
-rw-r--r-- | src/Java/gtPlusPlus/core/material/ALLOY.java | 113 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/material/ELEMENT.java | 4 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/material/Material.java | 198 |
3 files changed, 197 insertions, 118 deletions
diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index e42a3e5501..23cb359ec9 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -13,6 +13,9 @@ public final class ALLOY { public static final Material INVAR = MaterialUtils.generateMaterialFromGtENUM(Materials.Invar); public static final Material KANTHAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Kanthal); public static final Material NICHROME = MaterialUtils.generateMaterialFromGtENUM(Materials.Nichrome); + public static final Material TUNGSTENSTEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.TungstenSteel); + public static final Material STAINLESSSTEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.StainlessSteel); + public static final Material OSMIRIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Osmiridium); public static final Material ENERGYCRYSTAL = new Material( "Energy Crystal", //Material Name @@ -614,14 +617,120 @@ public final class ALLOY { }); + public static final Material KOBOLDITE = new Material( + "Koboldite", //Material Name + MaterialState.SOLID, //State + new short[]{80, 210, 255, 0}, //Material Colour + -1, //Melting Point in C + -1, + -1, + -1, + true, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().NICKEL, 35), + new MaterialStack(ELEMENT.getInstance().THAUMIUM, 30), + new MaterialStack(ELEMENT.getInstance().IRON, 35) + }); + + /* + * Top Tier Alloys + */ + + //0lafe Compound + public static final Material LAFIUM = new Material( + "Lafium Compound", //Material Name + MaterialState.SOLID, //State + new short[]{75,180,255, 0}, //Material Colour + 6750, //Melting Point in C + 9865, //Boiling Point in C + -1, + -1, + true, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ALLOY.HASTELLOY_N, 8), + new MaterialStack(ELEMENT.getInstance().NAQUADAH, 4), + new MaterialStack(ELEMENT.getInstance().SAMARIUM, 2), + new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4), + new MaterialStack(ELEMENT.getInstance().ARGON, 2), + new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 6), + new MaterialStack(ELEMENT.getInstance().NICKEL, 8), + new MaterialStack(ELEMENT.getInstance().CARBON, 2) + }); - + //Cinobi Alloy + public static final Material CINOBITE = new Material( + "Cinobite A243", //Material Name + MaterialState.SOLID, //State + new short[]{255,75,45, 0}, //Material Colour + 7350, //Melting Point in C + 12565, //Boiling Point in C + -1, + -1, + true, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ALLOY.ZERON_100, 16), + new MaterialStack(ELEMENT.getInstance().NAQUADRIA, 7), + new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 5), + new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 3), + new MaterialStack(ELEMENT.getInstance().MERCURY, 2), + new MaterialStack(ELEMENT.getInstance().TIN, 2), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 12), + new MaterialStack(ALLOY.OSMIRIDIUM, 6) + }); + + //Piky Alloy + public static final Material PIKYONIUM = new Material( + "Pikyonium 64B", //Material Name + MaterialState.SOLID, //State + new short[]{110,255,20, 0}, //Material Colour + 7850, //Melting Point in C + 11765, //Boiling Point in C + -1, + -1, + true, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ALLOY.INCONEL_792, 16), + new MaterialStack(ALLOY.EGLIN_STEEL, 10), + new MaterialStack(ELEMENT.getInstance().NAQUADAH_ENRICHED, 8), + new MaterialStack(ELEMENT.getInstance().CERIUM, 6), + new MaterialStack(ELEMENT.getInstance().ANTIMONY, 4), + new MaterialStack(ELEMENT.getInstance().PLATINUM, 4), + new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2), + new MaterialStack(ALLOY.TUNGSTENSTEEL, 8) + }); + + //Piky Alloy + public static final Material ABYSSAL = new Material( + "Abyssal Alloy", //Material Name + MaterialState.SOLID, //State + new short[]{85,0,85, 0}, //Material Colour + 9650, //Melting Point in C + 13765, //Boiling Point in C + -1, + -1, + true, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ALLOY.STAINLESSSTEEL, 10), + new MaterialStack(ALLOY.TUNGSTEN_CARBIDE, 10), + new MaterialStack(ALLOY.NICHROME, 10), + new MaterialStack(ALLOY.BRONZE, 10), + new MaterialStack(ALLOY.INCOLOY_MA956, 10), + new MaterialStack(ELEMENT.getInstance().IODINE, 2), + new MaterialStack(ELEMENT.getInstance().RADON, 2), + new MaterialStack(ELEMENT.getInstance().GERMANIUM, 2), + }); + //Quantum public static final Material QUANTUM = new Material( "Quantum", //Material Name MaterialState.SOLID, //State new short[]{128, 128, 255, 50}, //Material Colour - 9999, //Melting Point in C + 9500, //Melting Point in C 25000, //Boiling Point in C 150, //Protons 200, //Neutrons diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index fd8df711e9..9f37164aa0 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -125,6 +125,8 @@ public final class ELEMENT { //Fictional public final Material YELLORIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yellorium, new short[] {255, 242, 10}); public final Material NAQUADAH = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadah); + public final Material NAQUADAH_ENRICHED = MaterialUtils.generateMaterialFromGtENUM(Materials.NaquadahEnriched); + public final Material NAQUADRIA = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadria); public final Material TRINIUM; public final Material TRINIUM_REFINED; //https://github.com/Blood-Asp/GT5-Unofficial/issues/609 @@ -142,6 +144,8 @@ public final class ELEMENT { public final Material POLONIUM210 = new Material("Polonium-210", MaterialState.SOLID, Materials.Plutonium241.mIconSet, POLONIUM.vDurability, POLONIUM.getRGBA(), POLONIUM.getMeltingPointK(), 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.mIconSet, 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 final Material MAGIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Magic, new short[] {10, 185, 140}); + public final Material THAUMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thaumium); static { diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 01999ecbd4..4dd88030bd 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -255,17 +255,39 @@ public class Material { this.isRadioactive = true; this.vRadiationLevel = (byte) radiationLevel; } - else { - Logger.MATERIALS(this.getLocalizedName()+" is not radioactive."); - this.isRadioactive = false; - this.vRadiationLevel = 0; + else { + if (vMaterialInput.size() > 0) { + AutoMap<Byte> aDataSet = new AutoMap<Byte>(); + for (MaterialStack m : this.vMaterialInput) { + aDataSet.put(m.getStackMaterial().vRadiationLevel); + } + byte aAverage = MathUtils.getByteAverage(aDataSet); + if (aAverage > Byte.MAX_VALUE || aAverage < Byte.MIN_VALUE) { + aAverage = 0; + } + if (aAverage > 0) { + Logger.MATERIALS(this.getLocalizedName()+" is radioactive due to trace elements. Level: "+aAverage+"."); + this.isRadioactive = true; + this.vRadiationLevel = (byte) aAverage; + } + else { + Logger.MATERIALS(this.getLocalizedName()+" is not radioactive."); + this.isRadioactive = false; + this.vRadiationLevel = 0; + } + } + else { + Logger.MATERIALS(this.getLocalizedName()+" is not radioactive."); + this.isRadioactive = false; + this.vRadiationLevel = 0; + } } //Sets the materials 'tier'. Will probably replace this logic. this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint)); this.usesBlastFurnace = blastFurnace; - this.vVoltageMultiplier = this.getMeltingPointK() >= 2800 ? 60 : 15; + this.vVoltageMultiplier = MaterialUtils.getVoltageForTier(vTier); this.vComponentCount = this.getComponentCount(inputs); this.vSmallestRatio = this.getSmallestRatio(this.vMaterialInput); @@ -288,11 +310,11 @@ public class Material { this.vChemicalFormula = this.getToolTip(chemicalSymbol, OrePrefixes.dust.mMaterialAmount / M, true); } else if (!this.vChemicalSymbol.equals("")){ - Logger.WARNING("materialInput is null, using a valid chemical symbol."); + Logger.MATERIALS("materialInput is null, using a valid chemical symbol."); this.vChemicalFormula = this.vChemicalSymbol; } else{ - Logger.WARNING("MaterialInput == null && chemicalSymbol probably equals nothing"); + Logger.MATERIALS("MaterialInput == null && chemicalSymbol probably equals nothing"); this.vChemicalFormula = "??"; } @@ -335,13 +357,13 @@ public class Material { } } - 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."); + Logger.MATERIALS("Creating a Material instance for "+materialName); + Logger.MATERIALS("Formula: "+this.vChemicalFormula + " Smallest Stack: "+this.smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio); + Logger.MATERIALS("Protons: "+this.vProtons); + Logger.MATERIALS("Neutrons: "+this.vNeutrons); + Logger.MATERIALS("Mass: "+this.vMass+"/units"); + Logger.MATERIALS("Melting Point: "+this.meltingPointC+"C."); + Logger.MATERIALS("Boiling Point: "+this.boilingPointC+"C."); } catch (Throwable t){ t.printStackTrace(); @@ -487,6 +509,10 @@ public class Material { return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingot"+this.unlocalizedName, stacksize); } + public final ItemStack getHotIngot(final int stacksize){ + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHot"+this.unlocalizedName, stacksize); + } + public final ItemStack getPlate(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plate"+this.unlocalizedName, stacksize); } @@ -595,21 +621,21 @@ public class Material { if (this.vMaterialInput != null && !this.vMaterialInput.isEmpty()){ final ItemStack[] temp = new ItemStack[this.vMaterialInput.size()]; for (int i=0;i<this.vMaterialInput.size();i++){ - //Utils.LOG_WARNING("i:"+i); + //Utils.LOG_MATERIALS("i:"+i); ItemStack testNull = null; try { testNull = this.vMaterialInput.get(i).getValidStack(); } catch (final Throwable r){ - Logger.WARNING("Failed gathering material stack for "+this.localizedName+"."); - Logger.WARNING("What Failed: Length:"+this.vMaterialInput.size()+" current:"+i); + Logger.MATERIALS("Failed gathering material stack for "+this.localizedName+"."); + Logger.MATERIALS("What Failed: Length:"+this.vMaterialInput.size()+" current:"+i); } try { if (testNull != null){ - //Utils.LOG_WARNING("not null"); + //Utils.LOG_MATERIALS("not null"); temp[i] = this.vMaterialInput.get(i).getValidStack(); } } catch (final Throwable r){ - Logger.WARNING("Failed setting slot "+i+", using "+this.localizedName); + Logger.MATERIALS("Failed setting slot "+i+", using "+this.localizedName); } } return temp; @@ -659,9 +685,9 @@ public class Material { public final long[] getSmallestRatio(final ArrayList<MaterialStack> tempInput){ if (tempInput != null){ if (!tempInput.isEmpty()){ - Logger.WARNING("length: "+tempInput.size()); - Logger.WARNING("(inputs != null): "+(tempInput != null)); - //Utils.LOG_WARNING("length: "+inputs.length); + Logger.MATERIALS("length: "+tempInput.size()); + Logger.MATERIALS("(inputs != null): "+(tempInput != null)); + //Utils.LOG_MATERIALS("length: "+inputs.length); final long[] tempRatio = new long[tempInput.size()]; for (int x=0;x<tempInput.size();x++){ //tempPercentage = tempPercentage+inputs[x].percentageToUse; @@ -678,7 +704,7 @@ public class Material { for (int r=0;r<tempRatio.length;r++){ tempRatioStringThing1 = tempRatioStringThing1 + tempRatio[r] +" : "; } - Logger.WARNING("Default Ratio: "+tempRatioStringThing1); + Logger.MATERIALS("Default Ratio: "+tempRatioStringThing1); String tempRatioStringThing = ""; int tempSmallestCraftingUseSize = 0; @@ -687,7 +713,7 @@ public class Material { tempSmallestCraftingUseSize = (int) (tempSmallestCraftingUseSize + smallestRatio[r]); } //this.smallestStackSizeWhenProcessing = tempSmallestCraftingUseSize; - Logger.WARNING("Smallest Ratio: "+tempRatioStringThing); + Logger.MATERIALS("Smallest Ratio: "+tempRatioStringThing); return smallestRatio; } } @@ -699,7 +725,7 @@ public class Material { if (!aShowQuestionMarks && (this.vChemicalFormula.equals("?")||this.vChemicalFormula.equals("??"))) { return ""; } - Logger.WARNING("===============| Calculating Atomic Formula for "+this.localizedName+" |==============="); + Logger.MATERIALS("===============| Calculating Atomic Formula for "+this.localizedName+" |==============="); if (!chemSymbol.equals("")) { return chemSymbol; } @@ -742,13 +768,13 @@ public class Material { return StringUtils.subscript(dummyFormula); //return dummyFormula; } - Logger.WARNING("dummyFormulaArray <= 0"); + Logger.MATERIALS("dummyFormulaArray <= 0"); } - Logger.WARNING("dummyFormulaArray == null"); + Logger.MATERIALS("dummyFormulaArray == null"); } - Logger.WARNING("tempInput.length <= 0"); + Logger.MATERIALS("tempInput.length <= 0"); } - Logger.WARNING("tempInput == null"); + Logger.MATERIALS("tempInput == null"); return "??"; } @@ -778,33 +804,33 @@ public class Material { if (isValid != Materials._NULL){ for (Materials m : invalidMaterials.values()){ if (isValid == m){ - Logger.WARNING("Trying to generate a fluid for blacklisted material: "+m.mDefaultLocalName); + Logger.MATERIALS("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."); + Logger.MATERIALS("Using a pre-defined Fluid from GT. Fluid."); return a1.getFluid(); } if (a2 != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. Gas."); + Logger.MATERIALS("Using a pre-defined Fluid from GT. Gas."); return a2.getFluid(); } if (a3 != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. Molten."); + Logger.MATERIALS("Using a pre-defined Fluid from GT. Molten."); return a3.getFluid(); } if (a4 != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. Solid."); + Logger.MATERIALS("Using a pre-defined Fluid from GT. Solid."); return a4.getFluid(); } if (a5 != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. Plasma."); + Logger.MATERIALS("Using a pre-defined Fluid from GT. Plasma."); return a5.getFluid(); } - Logger.WARNING("Using null."); + Logger.MATERIALS("Using null."); return null; } } @@ -812,31 +838,31 @@ public class Material { if (this.materialState == MaterialState.SOLID){ if (isValid.mFluid != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. mFluid."); + Logger.MATERIALS("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."); + Logger.MATERIALS("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); return isValid.mStandardMoltenFluid; } } else if (this.materialState == MaterialState.GAS){ if (isValid.mGas != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. mGas."); + Logger.MATERIALS("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."); + Logger.MATERIALS("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."); + Logger.MATERIALS("Using a pre-defined Fluid from GT. mGas."); return isValid.mGas; } else if (isValid.mStandardMoltenFluid != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); + Logger.MATERIALS("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); return isValid.mStandardMoltenFluid; } } @@ -846,28 +872,28 @@ public class Material { FluidStack aTest3 = FluidUtils.getFluidStack(Utils.sanitizeString(this.getLocalizedName()), 1); if (aTest1 != null) { - Logger.WARNING("Found FluidRegistry entry for "+"molten."+Utils.sanitizeString(this.getLocalizedName())); + Logger.MATERIALS("Found FluidRegistry entry for "+"molten."+Utils.sanitizeString(this.getLocalizedName())); return aTest1.getFluid(); } if (aTest2 != null) { - Logger.WARNING("Found FluidRegistry entry for "+"fluid."+Utils.sanitizeString(this.getLocalizedName())); + Logger.MATERIALS("Found FluidRegistry entry for "+"fluid."+Utils.sanitizeString(this.getLocalizedName())); return aTest2.getFluid(); } if (aTest3 != null) { - Logger.WARNING("Found FluidRegistry entry for "+Utils.sanitizeString(this.getLocalizedName())); + Logger.MATERIALS("Found FluidRegistry entry for "+Utils.sanitizeString(this.getLocalizedName())); return aTest3.getFluid(); } - Logger.WARNING("Generating our own fluid."); + Logger.MATERIALS("Generating our own fluid."); //Generate a Cell if we need to if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ if (this.vGenerateCells){ new BaseItemCell(this); - Logger.WARNING("Generated a cell for "+this.getUnlocalizedName()); + Logger.MATERIALS("Generated a cell for "+this.getUnlocalizedName()); } else { - Logger.WARNING("Did not generate a cell for "+this.getUnlocalizedName()); + Logger.MATERIALS("Did not generate a cell for "+this.getUnlocalizedName()); } } @@ -924,11 +950,11 @@ public class Material { } } if (isValid.mPlasma != null){ - Logger.WARNING("Using a pre-defined Plasma from GT."); + Logger.MATERIALS("Using a pre-defined Plasma from GT."); return isValid.mPlasma; } - Logger.WARNING("Generating our own Plasma."); + Logger.MATERIALS("Generating our own Plasma."); return FluidUtils.addGTPlasma(this); } @@ -950,27 +976,8 @@ public class Material { for (MaterialStack m : this.vMaterialInput) { aDataSet.put(m.getStackMaterial().getMeltingPointC()); } - long aAverage = MathUtils.getAverage(aDataSet); + long aAverage = MathUtils.getLongAverage(aDataSet); return MathUtils.safeInt(aAverage); - - - - - /*int meltingPoint = 0; - for (MaterialStack part : this.vMaterialInput){ - if (part != null){ - int incrementor = part.getStackMaterial().getMeltingPointC(); - meltingPoint += incrementor; - Logger.WARNING("Melting Point for "+this.getLocalizedName()+" increased by "+ incrementor); - } - else { - Logger.MATERIALS(this.getLocalizedName()+" has a really invalid composition."); - } - } - int divisor = (this.vMaterialInput.size()>0 ? this.vMaterialInput.size() : 1); - Logger.WARNING("Dividing "+meltingPoint+" / "+divisor+" to get average melting point."); - meltingPoint = (meltingPoint/divisor); - return meltingPoint;*/ } catch (Throwable r){ return 500; @@ -984,23 +991,8 @@ public class Material { for (MaterialStack m : this.vMaterialInput) { aDataSet.put(m.getStackMaterial().getBoilingPointC()); } - long aAverage = MathUtils.getAverage(aDataSet); + long aAverage = MathUtils.getLongAverage(aDataSet); return MathUtils.safeInt(aAverage); - - - /*int boilingPoint = 0; - for (MaterialStack part : this.vMaterialInput){ - if (part != null){ - boilingPoint += part.getStackMaterial().getBoilingPointC(); - Logger.WARNING("Boiling Point for "+this.getLocalizedName()+" increased by "+ 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); - return boilingPoint;*/ } catch (Throwable r){ return 2500; @@ -1014,21 +1006,8 @@ public class Material { for (MaterialStack m : this.vMaterialInput) { aDataSet.put(m.getStackMaterial().getProtons()); } - long aAverage = MathUtils.getAverage(aDataSet); - return aAverage; - - /*long protonCount = 0; - for (MaterialStack part : this.vMaterialInput){ - 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); - return protonCount;*/ + long aAverage = MathUtils.getLongAverage(aDataSet); + return MathUtils.safeInt(aAverage); } catch (Throwable r){ return 50; @@ -1042,21 +1021,8 @@ public class Material { for (MaterialStack m : this.vMaterialInput) { aDataSet.put(m.getStackMaterial().getNeutrons()); } - long aAverage = MathUtils.getAverage(aDataSet); - return aAverage; - - /*long neutronCount = 0; - for (MaterialStack part : this.vMaterialInput){ - 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); - return neutronCount;*/ + long aAverage = MathUtils.getLongAverage(aDataSet); + return MathUtils.safeInt(aAverage); } catch (Throwable r){ return 75; |