code: public static boolean blockVariantMatches(IBlockState bs, List<Variation> allowedVariants)
      {
          for (IProperty prop : bs.getProperties().keySet())
          {
              if (prop.getName().equals("variant") && prop.getValueClass().isEnum())
              {
                  Object current = bs.getValue(prop);
                  if (current != null)
                  {
                      for (Variation var : allowedVariants)
                      {
                          if (var.getValue().equalsIgnoreCase(current.toString()))
                              return true;
                      }
                  }
              }
          }
          return false;
      }
docs: Test whether this block has a variant attribute which matches the list of allowed variants
  @param bs the blockstate to test
  @param allowedVariants list of allowed Variant enum values
  @return true if the block matches.