From 3d6bfcf48fbcf94fc87ba4dda4d8f830881caccf Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 8 Aug 2024 12:57:03 -0400 Subject: [PATCH] Trim fields before adding to array --- src/engine/ConfigParsing/EffectsParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index 52092ccd..ff391a27 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -56,6 +56,8 @@ public class EffectsParser { String firstLine; ArrayList effectDescription = new ArrayList<>(); + // Some effects exist without sources/mods or conditions + // (ACID "MOB" 0) if (effectData.indexOf('\n') > 0) firstLine = effectData.substring(0, effectData.indexOf('\n')); else @@ -66,7 +68,7 @@ public class EffectsParser { Matcher matcher = STRSPLIT_REGEX.matcher(firstLine); while (matcher.find()) - effectDescription.add(matcher.group(1)); + effectDescription.add(matcher.group(1).trim()); effectEntry.id = effectDescription.get(0); effectEntry.name = effectDescription.get(1);