@@ -43,13 +43,11 @@ public boolean doesShowInCreative(DetravSimpleItems aPrefix, Materials aMaterial
4343 return aDoShowAllItems || !aPrefix .name ().startsWith ("toolHead" );
4444 }
4545
46- public boolean isConfiguredCircuit (ItemStack aStack )
47- {
48- return aStack .getUnlocalizedName ().indexOf ("gt.detrav.metaitem.01." + (mOffset +1 )) == 0 ;
46+ public boolean isConfiguredCircuit (ItemStack aStack ) {
47+ return aStack .getUnlocalizedName ().indexOf ("gt.detrav.metaitem.01." + (mOffset + 1 )) == 0 ;
4948 }
5049
5150
52-
5351 public void addAdditionalToolTips (List aList , ItemStack aStack , EntityPlayer aPlayer ) {
5452 int tOffset = aList .size ();
5553 String name = aStack .getUnlocalizedName ();
@@ -65,19 +63,17 @@ public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPl
6563 tOffset = addToList (tOffset , aList , detravPosition , "Percent" , true );
6664 tOffset = addToList (tOffset , aList , detravPosition , "XCurrent" , true );
6765 tOffset = addToList (tOffset , aList , detravPosition , "ZCurrent" , true );
68- tOffset = addToList (tOffset , aList , detravPosition , "XFrom" , true );
69- tOffset = addToList (tOffset , aList , detravPosition , "XTo" , true );
70- tOffset = addToList (tOffset , aList , detravPosition , "ZFrom" , true );
71- tOffset = addToList (tOffset , aList , detravPosition , "ZTo" , true );
72- tOffset = addToList (tOffset , aList , detravPosition , "Configurated" , false );
66+ tOffset = addToList (tOffset , aList , detravPosition , "X" , "XFrom" , "XTo" );
67+ tOffset = addToList (tOffset , aList , detravPosition , "Z" , "ZFrom" , "ZTo" );
68+ tOffset = addToList (tOffset , aList , detravPosition , "Y" , "YFrom" , "YTo" );
7369 }
7470 }
7571 }
7672 break ;
7773 }
7874 }
7975
80- public int addToList (int tOffset , List aList , NBTTagCompound tag ,String name , boolean integer ) {
76+ public int addToList (int tOffset , List aList , NBTTagCompound tag , String name , boolean integer ) {
8177 if (!tag .hasKey (name ))
8278 return tOffset ;
8379 if (integer ) {
@@ -88,6 +84,36 @@ public int addToList(int tOffset, List aList, NBTTagCompound tag,String name, bo
8884 aList .add (tOffset , EnumChatFormatting .WHITE + name + EnumChatFormatting .GRAY );
8985 }
9086 }
91- return tOffset + 1 ;
87+ return tOffset + 1 ;
88+ }
89+
90+
91+ public int addToList (int tOffset , List aList , NBTTagCompound tag , String text , String from , String to ) {
92+ String i_from = "" ;
93+ String i_to = "" ;
94+ boolean noFrom = true ;
95+ boolean noTo = true ;
96+ if (tag .hasKey (from )) {
97+ i_from = "" + tag .getInteger (from );
98+ noFrom = false ;
99+ }
100+
101+ if (tag .hasKey (to )) {
102+ i_to = "" + tag .getInteger (to );
103+ noTo = false ;
104+ }
105+
106+ if (noFrom && noTo )
107+ return tOffset ;
108+
109+ if (!noFrom && !noTo )
110+ aList .add (tOffset , EnumChatFormatting .WHITE + text + " from " + i_from + " to " + i_to + EnumChatFormatting .GRAY );
111+ else if (noFrom )
112+ aList .add (tOffset , EnumChatFormatting .WHITE + text + " to " + i_to + EnumChatFormatting .GRAY );
113+ else
114+ aList .add (tOffset , EnumChatFormatting .WHITE + text + " from " + i_from + EnumChatFormatting .GRAY );
115+
116+
117+ return tOffset + 1 ;
92118 }
93119}
0 commit comments