From acea3875a141dff718b270372354b0874c586232 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 19 Feb 2024 03:54:47 -0500 Subject: [PATCH] String cleanup for skill enums. --- src/engine/objects/ItemTemplate.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index cf569597..0513e657 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -107,12 +107,19 @@ public class ItemTemplate { String skills_used = (String) jsonObject.get("item_skill_used"); - if (skills_used.length() > 1) + if (skills_used.length() > 1) { + skills_used = skills_used.replaceAll("\\s", ""); + skills_used = skills_used.replaceAll(",", ""); item_skill_used.add(Enum.CharacterSkills.valueOf(skills_used)); + } String mastery_used = (String) jsonObject.get("item_skill_mastery_used"); - if (mastery_used.length() > 1) + if (mastery_used.length() > 1) { + mastery_used = mastery_used.replaceAll("\\s", ""); + mastery_used = mastery_used.replaceAll(",", ""); item_skill_mastery_used.add(Enum.CharacterSkills.valueOf(mastery_used)); + } + } }