diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-06 18:07:22 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-06 18:07:22 +0000 |
commit | a00d9f9245db7dc0c425044c0aeff84d15092dfd (patch) | |
tree | ddbe0c48420891b990688642bb5c155ff9788c23 /src/Java/gtPlusPlus/core/item/base | |
parent | 486aaa9c08a0bfa0cc6b890ae4131d3d90e85f91 (diff) | |
download | GT5-Unofficial-a00d9f9245db7dc0c425044c0aeff84d15092dfd.tar.gz GT5-Unofficial-a00d9f9245db7dc0c425044c0aeff84d15092dfd.tar.bz2 GT5-Unofficial-a00d9f9245db7dc0c425044c0aeff84d15092dfd.zip |
Better handling of Material chemical formulae.
Fixed some broken recipes.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/base')
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 9 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java | 11 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 1975e7770d..9ad8ea3feb 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -46,8 +46,6 @@ public class BaseItemComponent extends Item{ public final int componentColour; public Object extraData; - private static HashMap<String, String> mChemicalFormula = new HashMap<String, String>(); - protected IIcon base; protected IIcon overlay; @@ -61,7 +59,6 @@ public class BaseItemComponent extends Item{ this.setMaxStackSize(64); //this.setTextureName(this.getCorrectTextures()); this.componentColour = material.getRgbAsHex(); - mChemicalFormula.put(materialName.toLowerCase(), material.vChemicalFormula); GameRegistry.registerItem(this, this.unlocalName); //if (componentType != ComponentTypes.DUST) @@ -182,10 +179,10 @@ public class BaseItemComponent extends Item{ if (this.componentMaterial != null){ - if (!this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + if (!this.componentMaterial.vChemicalFormula.contains("?")) { list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); } - else if (this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + else if (this.componentMaterial.vChemicalFormula.contains("?")) { String temp = componentMaterial.vChemicalFormula; temp = temp.replace(" ", ""); temp = temp.replace("-", ""); @@ -208,7 +205,7 @@ public class BaseItemComponent extends Item{ } } else { - String aChemicalFormula = mChemicalFormula.get(materialName.toLowerCase()); + String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase()); if (aChemicalFormula != null && aChemicalFormula.length() > 0) { list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula)); } diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index 883eb241da..2cb23b3f97 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -14,7 +14,6 @@ import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -124,10 +123,10 @@ public class BaseOreComponent extends Item{ public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { if (this.materialName != null && !this.materialName.equals("")){ if (this.componentMaterial != null){ - if (!this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + if (!this.componentMaterial.vChemicalFormula.contains("?")) { list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); } - else if (this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + else if (this.componentMaterial.vChemicalFormula.contains("?")) { String temp = componentMaterial.vChemicalFormula; temp = temp.replace(" ", ""); temp = temp.replace("-", ""); @@ -142,6 +141,12 @@ public class BaseOreComponent extends Item{ list.add(CORE.GT_Tooltip_Radioactive+" | Level: "+this.componentMaterial.vRadiationLevel); } } + else { + String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase()); + if (aChemicalFormula != null && aChemicalFormula.length() > 0) { + list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula)); + } + } } super.addInformation(stack, aPlayer, list, bool); } |