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:
- Completed security question answer flow implement.
- Optimized code.
- 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