From a5864b74f8af106a55b8694e43ec35af59ec1b78 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 8 Aug 2024 12:54:58 -0400 Subject: [PATCH] Regex split update --- src/engine/ConfigParsing/EffectsParser.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index 86a75af5..52092ccd 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -10,7 +10,6 @@ package engine.ConfigParsing; import engine.ConfigParsing.EffectEntry.EffectEntry; import engine.gameManager.ConfigManager; -import org.pmw.tinylog.Logger; import java.io.IOException; import java.nio.file.Files; @@ -54,15 +53,15 @@ public class EffectsParser { // Parse effect entry description - String firstLine = ""; + String firstLine; + ArrayList effectDescription = new ArrayList<>(); - try { + if (effectData.indexOf('\n') > 0) firstLine = effectData.substring(0, effectData.indexOf('\n')); - } catch (Exception e) { - Logger.error(e); - } + else + firstLine = effectData; - ArrayList effectDescription = new ArrayList<>(); + // Regex ignores spaces within quotes Matcher matcher = STRSPLIT_REGEX.matcher(firstLine);