diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index ab20b087..548c02ac 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -44,6 +44,7 @@ public class ItemTemplate { public float item_health_full; public EnumSet item_skill_used = EnumSet.noneOf(Enum.CharacterSkills.class); + public EnumSet item_skill_mastery_used = EnumSet.noneOf(Enum.CharacterSkills.class); public ItemTemplate(JSONObject jsonObject) { @@ -108,7 +109,21 @@ public class ItemTemplate { Object skills_used = jsonObject.get("item_skill_used"); if (skills_used instanceof JSONArray) - for (Object o : (JSONArray) skills_used) - item_skill_used.add(Enum.CharacterSkills.valueOf((String) o)); + for (Object o : (JSONArray) skills_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 (mastery_used instanceof JSONArray) + 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); + } } }