use of com.glitchcog.fontificator.emoji.loader.frankerfacez.Room in project ChatGameFontificator by GlitchCog.
the class EmojiParser method parseFrankerFaceZModBadge.
/**
* Parse the FrankerFaceZ room data for the optional moderator badge
*
* @param manager
* @param jsonData
* @throws IOException
*/
public void parseFrankerFaceZModBadge(EmojiManager manager, String jsonData) throws IOException {
Gson gson = new Gson();
Type roomType = new TypeToken<Room>() {
}.getType();
JsonObject jsonObject = new JsonParser().parse(jsonData).getAsJsonObject();
Room room = gson.fromJson(jsonObject.get("room"), roomType);
final boolean customFfzModBadgeExists = room != null && room.getModerator_badge() != null;
if (customFfzModBadgeExists) {
LazyLoadEmoji modLle = new LazyLoadEmoji(UserType.MOD.getKey(), UserType.MOD.getKey(), "https:" + room.getModerator_badge(), ConfigEmoji.MOD_BADGE_COLOR, EmojiType.FRANKERFACEZ_BADGE);
manager.getEmojiByType(EmojiType.FRANKERFACEZ_BADGE).put(UserType.MOD.getKey(), modLle);
logBox.log("Loaded the custom FrankerFaceZ moderator badge");
}
}
Aggregations