@SideOnly(Side.CLIENT) public static int renderTooltip(int x,int y,List<String> tooltipData,int color,int color2){
  boolean lighting=GL11.glGetBoolean(GL11.GL_LIGHTING);
  if (lighting)   RenderHelper.disableStandardItemLighting();
  if (!tooltipData.isEmpty()) {
    int var5=0;
    int var6;
    int var7;
    FontRenderer fontRenderer=Minecraft.getMinecraft().fontRendererObj;
    for (var6=0; var6 < tooltipData.size(); ++var6) {
      var7=fontRenderer.getStringWidth(tooltipData.get(var6));
      if (var7 > var5)       var5=var7;
    }
    var6=x + 12;
    var7=y - 12;
    int var9=8;
    if (tooltipData.size() > 1)     var9+=2 + (tooltipData.size() - 1) * 10;
    float z=300F;
    drawGradientRect(var6 - 3,var7 - 4,z,var6 + var5 + 3,var7 - 3,color2,color2);
    drawGradientRect(var6 - 3,var7 + var9 + 3,z,var6 + var5 + 3,var7 + var9 + 4,color2,color2);
    drawGradientRect(var6 - 3,var7 - 3,z,var6 + var5 + 3,var7 + var9 + 3,color2,color2);
    drawGradientRect(var6 - 4,var7 - 3,z,var6 - 3,var7 + var9 + 3,color2,color2);
    drawGradientRect(var6 + var5 + 3,var7 - 3,z,var6 + var5 + 4,var7 + var9 + 3,color2,color2);
    int var12=(color & 0xFFFFFF) >> 1 | color & -16777216;
    drawGradientRect(var6 - 3,var7 - 3 + 1,z,var6 - 3 + 1,var7 + var9 + 3 - 1,color,var12);
    drawGradientRect(var6 + var5 + 2,var7 - 3 + 1,z,var6 + var5 + 3,var7 + var9 + 3 - 1,color,var12);
    drawGradientRect(var6 - 3,var7 - 3,z,var6 + var5 + 3,var7 - 3 + 1,color,color);
    drawGradientRect(var6 - 3,var7 + var9 + 2,z,var6 + var5 + 3,var7 + var9 + 3,var12,var12);
    GlStateManager.disableDepth();
    for (int var13=0; var13 < tooltipData.size(); ++var13) {
      String var14=tooltipData.get(var13);
      fontRenderer.drawStringWithShadow(var14,var6,var7,-1);
      if (var13 == 0)       var7+=2;
      var7+=10;
    }
    GlStateManager.enableDepth();
    return var7 + 12;
  }
  if (!lighting)   RenderHelper.disableStandardItemLighting();
  GlStateManager.color(1F,1F,1F,1F);
  return 0;
}

@ SideOnly ( Side . CLIENT ) public static int renderTooltip ( int x , int y , List < String > tooltipData , int color , int color2 ) { boolean lighting = GL11 . glGetBoolean ( GL11 . GL_LIGHTING ) ; if ( lighting ) RenderHelper . disableStandardItemLighting ( ) ; if ( ! tooltipData . isEmpty ( ) ) { int var5 = 0 ; int var6 ; int var7 ; FontRenderer fontRenderer = Minecraft . getMinecraft ( ) . fontRendererObj ; for ( var6 = 0 ; var6 < tooltipData . size ( ) ; ++ var6 ) { var7 = fontRenderer . getStringWidth ( tooltipData . get ( var6 ) ) ; if ( var7 > var5 ) var5 = var7 ; } var6 = x + 12 ; var7 = y - 12 ; int var9 = 8 ; if ( tooltipData . size ( ) > 1 ) var9 += 2 + ( tooltipData . size ( ) - 1 ) * 10 ; float z = 300F ; drawGradientRect ( var6 - 3 , var7 - 4 , z , var6 + var5 + 3 , var7 - 3 , color2 , color2 ) ; drawGradientRect ( var6 - 3 , var7 + var9 + 3 , z , var6 + var5 + 3 , var7 + var9 + 4 , color2 , color2 ) ; drawGradientRect ( var6 - 3 , var7 - 3 , z , var6 + var5 + 3 , var7 + var9 + 3 , color2 , color2 ) ; drawGradientRect ( var6 - 4 , var7 - 3 , z , var6 - 3 , var7 + var9 + 3 , color2 , color2 ) ; drawGradientRect ( var6 + var5 + 3 , var7 - 3 , z , var6 + var5 + 4 , var7 + var9 + 3 , color2 , color2 ) ; int var12 = ( color & 0xFFFFFF ) > > 1 | color & - 16777216 ; drawGradientRect ( var6 - 3 , var7 - 3 + 1 , z , var6 - 3 + 1 , var7 + var9 + 3 - 1 , color , var12 ) ; drawGradientRect ( var6 + var5 + 2 , var7 - 3 + 1 , z , var6 + var5 + 3 , var7 + var9 + 3 - 1 , color , var12 ) ; drawGradientRect ( var6 - 3 , var7 - 3 , z , var6 + var5 + 3 , var7 - 3 + 1 , color , color ) ; drawGradientRect ( var6 - 3 , var7 + var9 + 2 , z , var6 + var5 + 3 , var7 + var9 + 3 , var12 , var12 ) ; GlStateManager . disableDepth ( ) ; for ( int var13 = 0 ; var13 < tooltipData . size ( ) ; ++ var13 ) { String var14 = tooltipData . get ( var13 ) ; fontRenderer . drawStringWithShadow ( var14 , var6 , var7 , - 1 ) ; if ( var13 == 0 ) var7 += 2 ; var7 += 10 ; } GlStateManager . enableDepth ( ) ; return var7 + 12 ; } if ( ! lighting ) RenderHelper . disableStandardItemLighting ( ) ; GlStateManager . color ( 1F , 1F , 1F , 1F ) ; return 0 ; }
renders a tooltip at the cursor
