Improve tooltip

Now the metaitems can automatically seperate its tooltip to multiple lines with "////".
This commit is contained in:
Antifluxfield 2017-08-21 09:56:04 +08:00 committed by GitHub
parent 3b39210348
commit 78e03914a3

View file

@ -189,8 +189,10 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
@Override @Override
public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
String tKey = getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey); String tKey = getUnlocalizedName(aStack) + ".tooltip";
if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString); String[] tStrings = GT_LanguageManager.getTranslation(tKey).split("////");
for (String tString : tStrings)
if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString);
Long[] Long[]
tStats = getElectricStats(aStack); tStats = getElectricStats(aStack);
@ -607,4 +609,4 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) { public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
return false; return false;
} }
} }