diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 945aa9d0..cf569597 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -105,22 +105,14 @@ public class ItemTemplate { item_render_object_female = ((Long) jsonObject.get("item_render_object_female")).intValue(); item_health_full = ((Double) jsonObject.get("item_health_full")).floatValue(); - Object skills_used = jsonObject.get("item_skill_used"); - - if (((JSONObject) jsonObject.get("item_skill_used")).containsValue(0) == false) - for (Object o : (JSONArray) jsonObject.get("item_skill_used")) { - String skilString = ((String) o).replaceAll("\\s", ""); - Enum.CharacterSkills characterSkill = Enum.CharacterSkills.valueOf(skilString); - item_skill_used.add(characterSkill); - } - - Object mastery_used = jsonObject.get("item_skill_mastery_used"); - - if ((int) mastery_used != 0) - for (Object o : (JSONArray) mastery_used) { - String masteryString = ((String) o).replaceAll("\\s", ""); - Enum.CharacterSkills masterySkill = Enum.CharacterSkills.valueOf(masteryString); - item_skill_mastery_used.add(masterySkill); - } + String skills_used = (String) jsonObject.get("item_skill_used"); + + if (skills_used.length() > 1) + item_skill_used.add(Enum.CharacterSkills.valueOf(skills_used)); + + String mastery_used = (String) jsonObject.get("item_skill_mastery_used"); + + if (mastery_used.length() > 1) + item_skill_mastery_used.add(Enum.CharacterSkills.valueOf(mastery_used)); } }