From ae8a4b14a0de47c081d518681647d14122163f8e Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 23 Nov 2016 21:53:04 +1000 Subject: $ Heavily improved the code for item replacements in CoreItem.java. + Added handlers in Material.java for materials with invalid names. % Changed logging on some math related functions in Utils.java. + Added an extra case for Infused dusts into MaterialUtils.java. --- src/Java/gtPlusPlus/core/material/Material.java | 56 ++++++++++++++----------- 1 file changed, 31 insertions(+), 25 deletions(-) (limited to 'src/Java/gtPlusPlus/core/material') diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index b7263d26a6..1ddd93003a 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -23,7 +23,7 @@ public class Material { private final Fluid vMoltenFluid; - protected Object dataVar; + protected Object dataVar = MathUtils.generateSingularRandomHexValue(); private ArrayList vMaterialInput = new ArrayList(); public final long[] vSmallestRatio; @@ -172,15 +172,21 @@ public class Material { } final public String getLocalizedName(){ - return localizedName; + if (this.localizedName != null) + return this.localizedName; + return "ERROR BAD LOCALIZED NAME"; } final public String getUnlocalizedName(){ - return unlocalizedName; + if (this.unlocalizedName != null) + return this.unlocalizedName; + return "ERROR.BAD.UNLOCALIZED.NAME"; } final public short[] getRGBA(){ - return this.RGBA; + if (this.RGBA != null) + return this.RGBA; + return new short[] {255,0,0}; } final public int getRgbAsHex(){ @@ -287,29 +293,29 @@ public class Material { final public ItemStack[] getMaterialComposites(){ //Utils.LOG_WARNING("Something requested the materials needed for "+localizedName); if (vMaterialInput != null){ - if (!vMaterialInput.isEmpty()){ - ItemStack[] temp = new ItemStack[vMaterialInput.size()]; - for (int i=0;i