Locale fixes
This commit is contained in:
parent
213bdca24d
commit
ab5a03afaf
15 changed files with 22 additions and 44 deletions
|
@ -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"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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("")) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -22,8 +21,6 @@ public class GT_MetaItem_Material extends GT_MetaItem_Abstract {
|
|||
}
|
||||
|
||||
public static ItemStack addItem(int aMeta, String aName, OrePrefixes aPrefix, Object aMaterial, boolean aGlowing) {
|
||||
GT_LanguageManager.addStringLocalization(instance.getUnlocalizedName() + "." + aMeta + ".name", aName);
|
||||
|
||||
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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue