diff --git a/src/main/java/gregtechmod/api/GregTech_API.java b/src/main/java/gregtechmod/api/GregTech_API.java index 9107a14..78e755b 100644 --- a/src/main/java/gregtechmod/api/GregTech_API.java +++ b/src/main/java/gregtechmod/api/GregTech_API.java @@ -27,6 +27,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -330,7 +331,7 @@ public class GregTech_API { try { return (Item)Class.forName("gregtechmod.api.items.GT_CoolantCell_Item").getConstructors()[0].newInstance(aName, aMaxStore, aCellCount); } catch(Throwable e) {} - return new gregtechmod.api.items.GT_Generic_Item(aName, "Doesn't work as intended, this is a Bug", false); + return new gregtechmod.api.items.GT_Generic_Item(aName, I18n.format("item.bug.tooltip")); } /** @@ -347,7 +348,7 @@ public class GregTech_API { try { return (Item)Class.forName("gregtechmod.api.items.GT_RadioactiveCell_Item").getConstructors()[0].newInstance(aName, aMaxDelay, aCellcount, aPulseRate, aDepleted); } catch(Throwable e) {} - return new gregtechmod.api.items.GT_Generic_Item(aName, "Doesn't work as intended, this is a Bug", false); + return new gregtechmod.api.items.GT_Generic_Item(aName, I18n.format("item.bug.tooltip")); } /** @@ -360,7 +361,7 @@ public class GregTech_API { try { return (Item)Class.forName("gregtechmod.api.items.GT_EnergyArmor_Item").getConstructors()[0].newInstance(aName, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex); } catch(Throwable e) {} - return new gregtechmod.api.items.GT_Generic_Item(aName, "Doesn't work as intended, this is a Bug", false); + return new gregtechmod.api.items.GT_Generic_Item(aName, I18n.format("item.bug.tooltip")); } /** @@ -373,7 +374,7 @@ public class GregTech_API { try { return (Item)Class.forName("gregtechmod.api.items.GT_EnergyStore_Item").getConstructors()[0].newInstance(aName, aCharge, aTransfer, aTier, aEmptyID, aFullID); } catch(Throwable e) {} - return new gregtechmod.api.items.GT_Generic_Item(aName, "Doesn't work as intended, this is a Bug", false); + return new gregtechmod.api.items.GT_Generic_Item(aName, I18n.format("item.bug.tooltip")); } /** diff --git a/src/main/java/gregtechmod/api/items/GT_Generic_Item.java b/src/main/java/gregtechmod/api/items/GT_Generic_Item.java index cccb0e9..a5ea780 100644 --- a/src/main/java/gregtechmod/api/items/GT_Generic_Item.java +++ b/src/main/java/gregtechmod/api/items/GT_Generic_Item.java @@ -2,13 +2,13 @@ package gregtechmod.api.items; import gregtechmod.api.GregTech_API; import gregtechmod.api.util.GT_Config; -import gregtechmod.api.util.GT_LanguageManager; import gregtechmod.api.util.GT_ModHandler; import gregtechmod.api.util.GT_OreDictUnificator; import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -26,14 +26,10 @@ public class GT_Generic_Item extends Item { private final String mTooltip; public GT_Generic_Item(String aName, String aTooltip) { - this(aName, aTooltip, true); - } - - public GT_Generic_Item(String aName, String aTooltip, boolean aTranslateToolTip) { super(); setUnlocalizedName(aName); setCreativeTab(GregTech_API.TAB_GREGTECH); - mTooltip = aTooltip == null || aTooltip.equals("") ? "" : aTranslateToolTip ? GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_main", aTooltip) : aTooltip; + mTooltip = aTooltip == null || aTooltip.equals("") ? "" : aTooltip; } public final GT_Generic_Item registerAtOreDict(String aName, short aDamage) { @@ -60,8 +56,8 @@ public class GT_Generic_Item extends Item { @Override public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (getMaxDamage() > 0 && !getHasSubtypes()) aList.add((aStack.getMaxDamage() - aStack.getItemDamage()) + " / " + aStack.getMaxDamage()); - if (mTooltip != null && !mTooltip.equals("")) aList.add(mTooltip); - if (GT_ModHandler.isElectricItem(aStack)) aList.add("Tier: " + getTier(aStack)); + if (mTooltip != null && !mTooltip.equals("")) aList.add(I18n.format(mTooltip)); + if (GT_ModHandler.isElectricItem(aStack)) aList.add(I18n.format("item.electric.tier.tooltip", getTier(aStack))); addAdditionalToolTips(aList, aStack); } diff --git a/src/main/java/gregtechmod/api/items/GT_Tool_Item.java b/src/main/java/gregtechmod/api/items/GT_Tool_Item.java index 1a6aabe..a025045 100644 --- a/src/main/java/gregtechmod/api/items/GT_Tool_Item.java +++ b/src/main/java/gregtechmod/api/items/GT_Tool_Item.java @@ -55,7 +55,7 @@ public class GT_Tool_Item extends GT_Generic_Item { } public GT_Tool_Item(String aName, String aTooltip, int aMaxDamage, int aEntityDamage, int aChargedGTID, int aDisChargedGTID, int aToolQuality, float aToolStrength) { - super(aName, aTooltip, aTooltip != null && !aTooltip.equals("Doesn't work as intended, this is a Bug")); + super(aName, aTooltip); mEntityDamage = aEntityDamage; mDisChargedGTID = aDisChargedGTID; mChargedGTID = aChargedGTID; diff --git a/src/main/java/gregtechmod/common/items/GT_Debug_Item.java b/src/main/java/gregtechmod/common/items/GT_Debug_Item.java index b539c20..83f3c78 100644 --- a/src/main/java/gregtechmod/common/items/GT_Debug_Item.java +++ b/src/main/java/gregtechmod/common/items/GT_Debug_Item.java @@ -78,7 +78,7 @@ public class GT_Debug_Item extends GT_Generic_Item implements IElectricItem { @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float aClickX, float aClickY, float aClickZ) { if (aWorld.isRemote) { -// GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(108), 1.0F, aX, aY, aZ); +// GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(108), 1.0F, aX, aY, aZ); // FIXME sound return false; } if (aPlayer instanceof EntityPlayerMP && GT_ModHandler.canUseElectricItem(aStack, 25000)) { diff --git a/src/main/java/gregtechmod/common/items/GT_MetaItem_Abstract.java b/src/main/java/gregtechmod/common/items/GT_MetaItem_Abstract.java index 68933d9..270107a 100644 --- a/src/main/java/gregtechmod/common/items/GT_MetaItem_Abstract.java +++ b/src/main/java/gregtechmod/common/items/GT_MetaItem_Abstract.java @@ -56,7 +56,9 @@ public class GT_MetaItem_Abstract extends Item { @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - if (aStack.getItemDamage() >= 0 && aStack.getItemDamage() < MAXIMUM_META_IDS && !mToolTipList[aStack.getItemDamage()].equals("")) aList.add(mToolTipList[aStack.getItemDamage()]); + if (aStack.getItemDamage() >= 0 && aStack.getItemDamage() < MAXIMUM_META_IDS && !mToolTipList[aStack.getItemDamage()].equals("")) { + aList.add(mToolTipList[aStack.getItemDamage()]); + } } @Override diff --git a/src/main/java/gregtechmod/common/items/GT_MetaItem_Cell.java b/src/main/java/gregtechmod/common/items/GT_MetaItem_Cell.java index 28d2521..03e814f 100644 --- a/src/main/java/gregtechmod/common/items/GT_MetaItem_Cell.java +++ b/src/main/java/gregtechmod/common/items/GT_MetaItem_Cell.java @@ -4,7 +4,6 @@ import gregtechmod.api.GregTech_API; import gregtechmod.api.enums.Materials; import gregtechmod.api.enums.OrePrefixes; import gregtechmod.api.interfaces.ICapsuleCellContainer; -import gregtechmod.api.util.GT_LanguageManager; import gregtechmod.api.util.GT_ModHandler; import gregtechmod.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; @@ -23,8 +22,6 @@ public class GT_MetaItem_Cell extends GT_MetaItem_Abstract implements ICapsuleCe } public static ItemStack addItem(int aMeta, String aName, String aOreDictName, boolean aPlasma, Materials aMaterial) { - GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".name", aName); - instance.mToolTipList[aMeta] = aMaterial.getToolTip(OrePrefixes.cell.mMaterialAmount / GregTech_API.MATERIAL_UNIT); instance.mStackList[aMeta] = new ItemStack(instance, 1, aMeta); diff --git a/src/main/java/gregtechmod/common/items/GT_MetaItem_Component.java b/src/main/java/gregtechmod/common/items/GT_MetaItem_Component.java index 98e5c90..ec16310 100644 --- a/src/main/java/gregtechmod/common/items/GT_MetaItem_Component.java +++ b/src/main/java/gregtechmod/common/items/GT_MetaItem_Component.java @@ -1,6 +1,5 @@ package gregtechmod.common.items; -import gregtechmod.api.util.GT_LanguageManager; import gregtechmod.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; @@ -18,9 +17,7 @@ public class GT_MetaItem_Component extends GT_MetaItem_Abstract { } public static ItemStack addItem(int aMeta, String aName, String aMaterial, String aToolTip) { - GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".name", aName); - - instance.mToolTipList[aMeta] = GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".tooltip", aToolTip); + instance.mToolTipList[aMeta] = instance.getUnlocalizedName() + "." + aMeta + ".tooltip"; instance.mStackList[aMeta] = new ItemStack(instance, 1, aMeta); if (aMaterial != null && !aMaterial.equals("")) { diff --git a/src/main/java/gregtechmod/common/items/GT_MetaItem_DirtyDust.java b/src/main/java/gregtechmod/common/items/GT_MetaItem_DirtyDust.java index e3987f6..a765122 100644 --- a/src/main/java/gregtechmod/common/items/GT_MetaItem_DirtyDust.java +++ b/src/main/java/gregtechmod/common/items/GT_MetaItem_DirtyDust.java @@ -3,7 +3,6 @@ package gregtechmod.common.items; import gregtechmod.api.GregTech_API; import gregtechmod.api.enums.Materials; import gregtechmod.api.enums.OrePrefixes; -import gregtechmod.api.util.GT_LanguageManager; import gregtechmod.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; @@ -22,8 +21,6 @@ public class GT_MetaItem_DirtyDust extends GT_MetaItem_Abstract { @SuppressWarnings("deprecation") public static ItemStack addItem(int aMeta, String aName, Materials aMaterial, boolean aGlow) { - GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".name", "Dirty Pile of " + aName); - instance.mToolTipList[aMeta] = aMaterial.getToolTip(OrePrefixes.dustImpure.mMaterialAmount / GregTech_API.MATERIAL_UNIT); instance.mGlowList[aMeta] = aGlow; instance.mStackList[aMeta] = new ItemStack(instance, 1, aMeta); diff --git a/src/main/java/gregtechmod/common/items/GT_MetaItem_Dust.java b/src/main/java/gregtechmod/common/items/GT_MetaItem_Dust.java index 6d33caa..ee67a17 100644 --- a/src/main/java/gregtechmod/common/items/GT_MetaItem_Dust.java +++ b/src/main/java/gregtechmod/common/items/GT_MetaItem_Dust.java @@ -3,7 +3,6 @@ package gregtechmod.common.items; import gregtechmod.api.GregTech_API; import gregtechmod.api.enums.Materials; import gregtechmod.api.enums.OrePrefixes; -import gregtechmod.api.util.GT_LanguageManager; import gregtechmod.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; @@ -21,8 +20,6 @@ public class GT_MetaItem_Dust extends GT_MetaItem_Abstract { } public static ItemStack addItem(int aMeta, String aName, Materials aMaterial, boolean aGlow) { - GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".name", aName); - instance.mToolTipList[aMeta] = aMaterial.getToolTip(OrePrefixes.dust.mMaterialAmount / GregTech_API.MATERIAL_UNIT); instance.mGlowList[aMeta] = aGlow; instance.mStackList[aMeta] = new ItemStack(instance, 1, aMeta); diff --git a/src/main/java/gregtechmod/common/items/GT_MetaItem_Material.java b/src/main/java/gregtechmod/common/items/GT_MetaItem_Material.java index c0cbb28..715118b 100644 --- a/src/main/java/gregtechmod/common/items/GT_MetaItem_Material.java +++ b/src/main/java/gregtechmod/common/items/GT_MetaItem_Material.java @@ -4,7 +4,6 @@ import gregtechmod.api.GregTech_API; import gregtechmod.api.enums.MaterialStack; import gregtechmod.api.enums.Materials; import gregtechmod.api.enums.OrePrefixes; -import gregtechmod.api.util.GT_LanguageManager; import gregtechmod.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; @@ -21,9 +20,7 @@ public class GT_MetaItem_Material extends GT_MetaItem_Abstract { return instance.mStackList; } - public static ItemStack addItem(int aMeta, String aName, OrePrefixes aPrefix, Object aMaterial, boolean aGlowing) { - GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".name", aName); - + public static ItemStack addItem(int aMeta, String aName, OrePrefixes aPrefix, Object aMaterial, boolean aGlowing) { instance.mToolTipList[aMeta] = aMaterial==null?"":(aMaterial instanceof Materials)?((Materials)aMaterial).getToolTip(aPrefix.mMaterialAmount / GregTech_API.MATERIAL_UNIT):aMaterial.toString(); instance.mGlowList[aMeta] = aGlowing; instance.mStackList[aMeta] = new ItemStack(instance, 1, aMeta); diff --git a/src/main/java/gregtechmod/common/items/GT_MetaItem_Nugget.java b/src/main/java/gregtechmod/common/items/GT_MetaItem_Nugget.java index 84174c4..808e6a4 100644 --- a/src/main/java/gregtechmod/common/items/GT_MetaItem_Nugget.java +++ b/src/main/java/gregtechmod/common/items/GT_MetaItem_Nugget.java @@ -3,7 +3,6 @@ package gregtechmod.common.items; import gregtechmod.api.GregTech_API; import gregtechmod.api.enums.Materials; import gregtechmod.api.enums.OrePrefixes; -import gregtechmod.api.util.GT_LanguageManager; import gregtechmod.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; @@ -21,8 +20,6 @@ public class GT_MetaItem_Nugget extends GT_MetaItem_Abstract { } public static ItemStack addItem(int aMeta, Materials aMaterial, boolean aGlow) { - GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".name", aMaterial + " Nugget"); - instance.mToolTipList[aMeta] = aMaterial.getToolTip(OrePrefixes.nugget.mMaterialAmount / GregTech_API.MATERIAL_UNIT); instance.mGlowList[aMeta] = aGlow; diff --git a/src/main/java/gregtechmod/common/items/GT_MetaItem_SmallDust.java b/src/main/java/gregtechmod/common/items/GT_MetaItem_SmallDust.java index 000c8b7..55c5ce0 100644 --- a/src/main/java/gregtechmod/common/items/GT_MetaItem_SmallDust.java +++ b/src/main/java/gregtechmod/common/items/GT_MetaItem_SmallDust.java @@ -3,7 +3,6 @@ package gregtechmod.common.items; import gregtechmod.api.GregTech_API; import gregtechmod.api.enums.Materials; import gregtechmod.api.enums.OrePrefixes; -import gregtechmod.api.util.GT_LanguageManager; import gregtechmod.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; @@ -21,8 +20,6 @@ public class GT_MetaItem_SmallDust extends GT_MetaItem_Abstract { } public static ItemStack addItem(int aMeta, String aName, Materials aMaterial, boolean aGlow) { - GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".name", "Small Pile of " + aName); - instance.mToolTipList[aMeta] = aMaterial.getToolTip(OrePrefixes.dustSmall.mMaterialAmount / GregTech_API.MATERIAL_UNIT); instance.mGlowList[aMeta] = aGlow; instance.mStackList[aMeta] = new ItemStack(instance, 1, aMeta); diff --git a/src/main/java/gregtechmod/common/items/GT_MetaItem_TinyDust.java b/src/main/java/gregtechmod/common/items/GT_MetaItem_TinyDust.java index 6cd3252..d6925fe 100644 --- a/src/main/java/gregtechmod/common/items/GT_MetaItem_TinyDust.java +++ b/src/main/java/gregtechmod/common/items/GT_MetaItem_TinyDust.java @@ -3,7 +3,6 @@ package gregtechmod.common.items; import gregtechmod.api.GregTech_API; import gregtechmod.api.enums.Materials; import gregtechmod.api.enums.OrePrefixes; -import gregtechmod.api.util.GT_LanguageManager; import gregtechmod.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; @@ -21,8 +20,6 @@ public class GT_MetaItem_TinyDust extends GT_MetaItem_Abstract { } public static ItemStack addItem(int aMeta, String aName, Materials aMaterial, boolean aGlow) { - GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".name", "Tiny Pile of " + aName); - instance.mToolTipList[aMeta] = aMaterial.getToolTip(OrePrefixes.dustTiny.mMaterialAmount / GregTech_API.MATERIAL_UNIT); instance.mGlowList[aMeta] = aGlow; instance.mStackList[aMeta] = new ItemStack(instance, 1, aMeta); diff --git a/src/main/java/gregtechmod/loaders/load/GT_ItemLoader.java b/src/main/java/gregtechmod/loaders/load/GT_ItemLoader.java index 3a3a8ca..f4c774c 100644 --- a/src/main/java/gregtechmod/loaders/load/GT_ItemLoader.java +++ b/src/main/java/gregtechmod/loaders/load/GT_ItemLoader.java @@ -500,8 +500,8 @@ public class GT_ItemLoader implements Runnable { GregTech_API.sItemList[ 16] = new GT_SensorCard_Item (GT_LanguageManager.mNameListItem[ 16]); GregTech_API.sItemList[ 17] = new GT_SensorKit_Item (GT_LanguageManager.mNameListItem[ 17]); } catch (Throwable e) { - GregTech_API.sItemList[ 16] = new GT_Generic_Item (GT_LanguageManager.mNameListItem[ 16], "Nuclear Control not installed", false); - GregTech_API.sItemList[ 17] = new GT_Generic_Item (GT_LanguageManager.mNameListItem[ 17], "Nuclear Control not installed", false); + GregTech_API.sItemList[ 16] = new GT_Generic_Item (GT_LanguageManager.mNameListItem[ 16], "Nuclear Control not installed"); + GregTech_API.sItemList[ 17] = new GT_Generic_Item (GT_LanguageManager.mNameListItem[ 17], "Nuclear Control not installed"); } GregTech_API.sItemList[ 18] = GregTech_API.constructElectricArmorItem (GT_LanguageManager.mNameListItem[ 18], 1000000000, Integer.MAX_VALUE, 1, 10, -1, 100.0D, true, 1, tArmorID1); diff --git a/src/main/resources/assets/gregtech_addon/lang/en_US.lang b/src/main/resources/assets/gregtech_addon/lang/en_US.lang index c983c8d..4bed20a 100644 --- a/src/main/resources/assets/gregtech_addon/lang/en_US.lang +++ b/src/main/resources/assets/gregtech_addon/lang/en_US.lang @@ -906,5 +906,8 @@ item.Teslastaff.name=Tesla Staff item.Thoriumcell.name=Thorium Cell item.Ultimate_Cheat_Armor.name=Ultimate Cheat Armor -itemGroup.GregTech=GregTech Intergalactical +item.electric.tier.tooltip=Tier: %s +item.bug.tooltip=Doesn't work as intended, this is a Bug + +itemGroup.gregtech=GregTech Intergalactical block.deny_mobs_spawn.tooltip=Mobs can't spawn on this block