From 78e03914a34fee288f23fdd4bd8ec9600e16e502 Mon Sep 17 00:00:00 2001 From: Antifluxfield Date: Mon, 21 Aug 2017 09:56:04 +0800 Subject: [PATCH] Improve tooltip Now the metaitems can automatically seperate its tooltip to multiple lines with "////". --- src/main/java/gregtech/api/items/GT_MetaBase_Item.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java index 77966915..395c1daf 100644 --- a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java +++ b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java @@ -189,8 +189,10 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci @Override public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - String tKey = getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey); - if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString); + String tKey = getUnlocalizedName(aStack) + ".tooltip"; + String[] tStrings = GT_LanguageManager.getTranslation(tKey).split("////"); + for (String tString : tStrings) + if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString); Long[] 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) { return false; } -} \ No newline at end of file +}