diff options
| author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-08 03:14:13 +0000 |
|---|---|---|
| committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-08 03:14:13 +0000 |
| commit | 064c0dc0cfab1cc677dfffc4b3b56642017e412b (patch) | |
| tree | 4ca26291abe64632a63bc0d72a510079a1766d7f /src/Java/gtPlusPlus/core/item/base | |
| parent | 5ec18de508e12da48c68ef679f6b8646f12cb0c2 (diff) | |
| download | GT5-Unofficial-064c0dc0cfab1cc677dfffc4b3b56642017e412b.tar.gz GT5-Unofficial-064c0dc0cfab1cc677dfffc4b3b56642017e412b.tar.bz2 GT5-Unofficial-064c0dc0cfab1cc677dfffc4b3b56642017e412b.zip | |
+ Added some AgriChem. (You can now use Raw waste as a fuel source)
+ Added OreDict names to vanilla items, as was done in Forge 1.8.9.
+ Added functions to allow other mods to add Semifluid Fuels.
+ Added functions to handle String data into StringUtils.java.
% Renamed getItemStack -> getItemStackFromFQRN.
$ Fixed handling of custom cells for fluids using '.' within their names.
$ Fixed HF exploit.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/base')
| -rw-r--r-- | src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 522b7e900e..fd69c97ff5 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -18,6 +18,7 @@ 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.data.StringUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -77,18 +78,33 @@ public class BaseItemComponent extends Item{ //For Cell Generation public BaseItemComponent(final String unlocalName, final String localName, final short[] RGBA) { + + // Handles .'s from fluid internal names. + String aFormattedNameForFluids; + if (unlocalName.contains(".")) { + if (StringUtils.characterCount(unlocalName, '.') > 1) { + aFormattedNameForFluids = StringUtils.splitAndUppercase(unlocalName, "."); + } + else { + aFormattedNameForFluids = unlocalName.replace(".", ""); + } + } + else { + aFormattedNameForFluids = unlocalName; + } + this.componentMaterial = null; - this.unlocalName = "itemCell"+unlocalName; + this.unlocalName = "itemCell"+aFormattedNameForFluids; this.materialName = localName; this.componentType = ComponentTypes.CELL; this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalName); + this.setUnlocalizedName(aFormattedNameForFluids); this.setMaxStackSize(64); this.componentColour = MathUtils.getRgbAsHex(RGBA); this.extraData = RGBA; this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME); - GameRegistry.registerItem(this, unlocalName); - GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+unlocalName, ItemUtils.getSimpleStack(this)); + GameRegistry.registerItem(this, aFormattedNameForFluids); + GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+aFormattedNameForFluids, ItemUtils.getSimpleStack(this)); registerComponent(); } |
