diff options
| author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-11-28 16:46:38 +0000 |
|---|---|---|
| committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-11-28 16:46:38 +0000 |
| commit | d76fe6c897d28af0f99c0fa04c7de7c654497742 (patch) | |
| tree | a1dc2c2eba611dc9695176c890a2db7cf969b01d /src/Java/gtPlusPlus/core/item/base | |
| parent | eda554bf83a499efb07b502b7aa3c91db6f380b0 (diff) | |
| download | GT5-Unofficial-d76fe6c897d28af0f99c0fa04c7de7c654497742.tar.gz GT5-Unofficial-d76fe6c897d28af0f99c0fa04c7de7c654497742.tar.bz2 GT5-Unofficial-d76fe6c897d28af0f99c0fa04c7de7c654497742.zip | |
Added NEI handler for LFTR Sparging.
Fixed Material generation for noble gases.
Fixed Chemical Formula not being applied to some cells.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/base')
| -rw-r--r-- | src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 9b732e38e1..1975e7770d 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -46,6 +46,8 @@ 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; @@ -59,6 +61,7 @@ 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) @@ -84,8 +87,9 @@ public class BaseItemComponent extends Item{ else { aFormattedNameForFluids = unlocalName; } - - this.componentMaterial = null; + Material aTempMaterial = Material.mMaterialCache.get(localName.toLowerCase()); + Logger.INFO("Attempted to get "+localName+" cell material from cache. Valid? "+(aTempMaterial != null)); + this.componentMaterial = aTempMaterial; this.unlocalName = "itemCell"+aFormattedNameForFluids; this.materialName = localName; this.componentType = ComponentTypes.CELL; @@ -94,6 +98,7 @@ public class BaseItemComponent extends Item{ this.setMaxStackSize(64); this.componentColour = MathUtils.getRgbAsHex(RGBA); this.extraData = RGBA; + this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME); GameRegistry.registerItem(this, aFormattedNameForFluids); GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+Utils.sanitizeStringKeepBrackets(localName), ItemUtils.getSimpleStack(this)); @@ -202,6 +207,12 @@ public class BaseItemComponent extends Item{ } } } + else { + String aChemicalFormula = mChemicalFormula.get(materialName.toLowerCase()); + if (aChemicalFormula != null && aChemicalFormula.length() > 0) { + list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula)); + } + } //Hidden Tooltip if (KeyboardUtils.isCtrlKeyDown()) { |
