use of com.glitchcog.fontificator.emoji.loader.frankerfacez.FfzBadgesAndUsers in project ChatGameFontificator by GlitchCog.
the class EmojiParser method parseFrankerFaceZBadges.
private void parseFrankerFaceZBadges(EmojiManager manager, String jsonData) throws IOException {
JsonElement ffzBadgesAndUsersElement = new JsonParser().parse(jsonData);
Gson gson = new Gson();
Type emoteType = new TypeToken<FfzBadgesAndUsers>() {
}.getType();
FfzBadgesAndUsers badgesAndUsers = gson.fromJson(ffzBadgesAndUsersElement, emoteType);
for (Badge b : badgesAndUsers.getBadges()) {
manager.getEmojiByType(EmojiType.FRANKERFACEZ_BADGE).put("" + b.getId(), new LazyLoadEmoji(b.getName(), "moderator".equals(b.getReplaces()) ? UserType.MOD.getKey() : b.getReplaces(), "http:" + b.getImage(), b.getColorParsed(), EmojiType.FRANKERFACEZ_BADGE));
}
manager.setFfzBadgeUsers(badgesAndUsers.getUsers());
}
Aggregations