Skip to content

MojangAPI-in-Java v0.1.1.Final released!

Latest
Compare
Choose a tag to compare
@XiaoPangxie732 XiaoPangxie732 released this 24 Nov 13:58
· 8 commits to master since this release

A new release of MojangAPI-in-Java. 0.1.1 will be 0.1 and this version will be 0.1.1.
Changes:

  1. Completed security question answer flow implement.
  2. Optimized code.
  3. Improved Javadoc

Here is an example code of getting and answering the security questions:

ArrayList<Skin.SecurityQA.Question> questions = Skin.SecurityQA.getQuestionList(accessToken); //Get question list by player access token
ArrayList<Skin.SecurityQA.Answer> answers = new ArrayList<>(3);
try(Scanner sc = new Scanner(System.in)) { //Use scanner to detect input
  questions.forEach(question -> {
    System.out.println(question.getQuestionName());
    answers.add(question.getAnswer().setAnswer(sc.next()));
  });
}
Skin.SecurityQA.sendBackAnswers(accessToken, answers); // Send back the answers