From 78e03914a34fee288f23fdd4bd8ec9600e16e502 Mon Sep 17 00:00:00 2001 From: Antifluxfield Date: Mon, 21 Aug 2017 09:56:04 +0800 Subject: [PATCH 1/4] 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 +} From d5b0dcfa505e0cb5b6143633730bf5d1dc476e79 Mon Sep 17 00:00:00 2001 From: Antifluxfield Date: Mon, 21 Aug 2017 09:59:47 +0800 Subject: [PATCH 2/4] Multi-line tooltip of #1193 --- .../common/items/GT_MetaGenerated_Item_01.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 8f491ac5..43ea3079 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -484,11 +484,11 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { GregTech_API.registerCover(ItemList.Electric_Pump_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[7][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(131072)); GregTech_API.registerCover(ItemList.Electric_Pump_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(524288)); - ItemList.FluidRegulator_LV.set(addItem(tLastID = 615, "Fluid Regulator (LV)", "Configuable up to 640 L/sec (as Cover)", new Object[]{})); - ItemList.FluidRegulator_MV.set(addItem(tLastID = 616, "Fluid Regulator (MV)", "Configuable up to 2560 L/sec (as Cover)", new Object[]{})); - ItemList.FluidRegulator_HV.set(addItem(tLastID = 617, "Fluid Regulator (HV)", "Configuable up to 10240 L/sec (as Cover)", new Object[]{})); - ItemList.FluidRegulator_EV.set(addItem(tLastID = 618, "Fluid Regulator (EV)", "Configuable up to 40960 L/sec (as Cover)", new Object[]{})); - ItemList.FluidRegulator_IV.set(addItem(tLastID = 619, "Fluid Regulator (IV)", "Configuable up to 163840 L/sec (as Cover)", new Object[]{})); + ItemList.FluidRegulator_LV.set(addItem(tLastID = 615, "Fluid Regulator (LV)", "Configuable up to 640 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); + ItemList.FluidRegulator_MV.set(addItem(tLastID = 616, "Fluid Regulator (MV)", "Configuable up to 2560 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); + ItemList.FluidRegulator_HV.set(addItem(tLastID = 617, "Fluid Regulator (HV)", "Configuable up to 10240 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); + ItemList.FluidRegulator_EV.set(addItem(tLastID = 618, "Fluid Regulator (EV)", "Configuable up to 40960 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); + ItemList.FluidRegulator_IV.set(addItem(tLastID = 619, "Fluid Regulator (IV)", "Configuable up to 163840 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); GregTech_API.registerCover(ItemList.FluidRegulator_LV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(32)); GregTech_API.registerCover(ItemList.FluidRegulator_MV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(128)); From f6482e63ae4d4415c2e894118729d4aacb499c13 Mon Sep 17 00:00:00 2001 From: Antifluxfield Date: Mon, 21 Aug 2017 21:28:37 +0800 Subject: [PATCH 3/4] Use "/n " as seperator --- src/main/java/gregtech/api/items/GT_MetaBase_Item.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 395c1daf..237b15fa 100644 --- a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java +++ b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java @@ -190,7 +190,7 @@ 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"; - String[] tStrings = GT_LanguageManager.getTranslation(tKey).split("////"); + String[] tStrings = GT_LanguageManager.getTranslation(tKey).split("/n "); for (String tString : tStrings) if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString); From eb749f64cac9db103d4c61002d8f663e23b3f435 Mon Sep 17 00:00:00 2001 From: Antifluxfield Date: Mon, 21 Aug 2017 21:38:39 +0800 Subject: [PATCH 4/4] Use "/n " as seperator --- .../common/items/GT_MetaGenerated_Item_01.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 43ea3079..2e017d3b 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -484,11 +484,11 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { GregTech_API.registerCover(ItemList.Electric_Pump_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[7][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(131072)); GregTech_API.registerCover(ItemList.Electric_Pump_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(524288)); - ItemList.FluidRegulator_LV.set(addItem(tLastID = 615, "Fluid Regulator (LV)", "Configuable up to 640 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_MV.set(addItem(tLastID = 616, "Fluid Regulator (MV)", "Configuable up to 2560 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_HV.set(addItem(tLastID = 617, "Fluid Regulator (HV)", "Configuable up to 10240 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_EV.set(addItem(tLastID = 618, "Fluid Regulator (EV)", "Configuable up to 40960 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_IV.set(addItem(tLastID = 619, "Fluid Regulator (IV)", "Configuable up to 163840 L/sec (as Cover)////Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick////to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); + ItemList.FluidRegulator_LV.set(addItem(tLastID = 615, "Fluid Regulator (LV)", "Configuable up to 640 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); + ItemList.FluidRegulator_MV.set(addItem(tLastID = 616, "Fluid Regulator (MV)", "Configuable up to 2560 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); + ItemList.FluidRegulator_HV.set(addItem(tLastID = 617, "Fluid Regulator (HV)", "Configuable up to 10240 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); + ItemList.FluidRegulator_EV.set(addItem(tLastID = 618, "Fluid Regulator (EV)", "Configuable up to 40960 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); + ItemList.FluidRegulator_IV.set(addItem(tLastID = 619, "Fluid Regulator (IV)", "Configuable up to 163840 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); GregTech_API.registerCover(ItemList.FluidRegulator_LV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(32)); GregTech_API.registerCover(ItemList.FluidRegulator_MV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(128));