From 74b37063bf3e8dabf2641e2329b1587f40bfcaa8 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 10 Aug 2024 18:07:54 -0400 Subject: [PATCH] Effect Modifier parsing work. --- src/engine/ConfigParsing/EffectsParser.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index 03220380..e434d912 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -115,17 +115,14 @@ public class EffectsParser { EffectModifier effectModifier = new EffectModifier(); ArrayList modValues = new ArrayList<>(); - Matcher matcher = STRSPLIT_REGEX.matcher(modData); + String[] modEntries = modData.trim().split("\n"); - while (matcher.find()) - modValues.add(matcher.group(1).trim()); - - effectModifier.type = mbEnums.ModType.valueOf(modValues.get(0)); + effectModifier.type = mbEnums.ModType.valueOf(modEntries[0]); switch (effectModifier.type) { case AnimOverride: - effectModifier.min = Integer.parseInt(modValues.get(1)); - effectModifier.max = Integer.parseInt(modValues.get(2)); + effectModifier.min = Integer.parseInt(modEntries[1]); + effectModifier.max = Integer.parseInt(modEntries[2]); break; default: Logger.error("Unhandled type: " + effectModifier.type);