From 2cf05c4deaf3a26626853431f725d0ca375ffec3 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 26 Oct 2018 15:46:55 +0100 Subject: + 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. --- src/Java/gtPlusPlus/core/material/ALLOY.java | 113 +++++++++++++- src/Java/gtPlusPlus/core/material/ELEMENT.java | 4 + src/Java/gtPlusPlus/core/material/Material.java | 198 ++++++++++-------------- 3 files changed, 197 insertions(+), 118 deletions(-) (limited to 'src/Java/gtPlusPlus/core/material') 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 aDataSet = new AutoMap(); + 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 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;x0 ? 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; -- cgit