diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-29 20:47:47 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-29 20:47:47 +1000 |
commit | bcd8344c3732f08e331cf048f1f748c5b55f2812 (patch) | |
tree | 90c0824156056fe69b6dd72d57b51e8b724f00c8 /src/Java/gtPlusPlus/core/util/materials | |
parent | 2e56743afd8a5108083b90bb4f76dc14b808b9a2 (diff) | |
download | GT5-Unofficial-bcd8344c3732f08e331cf048f1f748c5b55f2812.tar.gz GT5-Unofficial-bcd8344c3732f08e331cf048f1f748c5b55f2812.tar.bz2 GT5-Unofficial-bcd8344c3732f08e331cf048f1f748c5b55f2812.zip |
+ Added more new ore veins.
% Tweaked some ore veins.
% Tweaked size of debug tool's area clear to double.
$ Fixed an issue that broke tooltips.
$ Quite a lot of back-end work for ore generation in the dark dimension.
$ Fixed improper generation of the GT++ WorldGen configuration file.
$ Fixed ore vein densities.
$ Fixed ore veins not generating as expected.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/materials')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java index cc9a679193..7db80c70fb 100644 --- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java @@ -47,15 +47,20 @@ public class MaterialUtils { final int durability = material.mDurability; boolean mGenerateCell = false; MaterialState materialState; - final String chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mChemicalFormula)); + String chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mChemicalFormula)); final Element element = material.mElement; int radioactivity = 0; if (material.isRadioactive()){ radioactivity = 1; } - + + //Weird Blacklist of Bad Chemical Strings + if (material.mElement == Element.Pb || material.mElement == Element.Na || material.mElement == Element.Ar){ + chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mElement.name())); + } + //Determine default state - Logger.MATERIALS("[Debug] Setting State of GT generated material."); + Logger.MATERIALS("[Debug] Setting State of GT generated material. "+material.mDefaultLocalName); if (material.getMolten(1) != null || material.getSolid(1) != null){ materialState = MaterialState.SOLID; Logger.MATERIALS("[Debug] Molten or Solid was not null."); @@ -96,6 +101,9 @@ public class MaterialUtils { //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material); return new Material(name, materialState, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity, mGenerateCell); } + else { + Logger.DEBUG_MATERIALS("Failed to generate GT++ material instance for "+material.name() +" | Valid RGB? "+(hasValidRGBA(rgba))); + } return null; } @@ -116,26 +124,10 @@ public class MaterialUtils { return temp; } - public static boolean hasValidRGBA(final short[] rgba){ - boolean test1 = false; - boolean test2 = false; - boolean test3 = false; - for (int r=0;r<rgba.length;r++){ - if (rgba[r] == 0){ - if (r == 0){ - test1 = true; - } - else if (r == 1){ - test2 = true; - } - else if (r == 2){ - test3 = true; - } - } - } - if ((test1 && test2) || (test1 && test3) || (test3 && test2)){ + public static boolean hasValidRGBA(final short[] rgba){ + if (rgba == null || rgba.length < 3 || rgba.length > 4){ return false; - } + } return true; } |