Browse Source

Regex split update

feature-config-parsing2
MagicBot 4 months ago
parent
commit
a5864b74f8
  1. 13
      src/engine/ConfigParsing/EffectsParser.java

13
src/engine/ConfigParsing/EffectsParser.java

@ -10,7 +10,6 @@ package engine.ConfigParsing;
import engine.ConfigParsing.EffectEntry.EffectEntry; import engine.ConfigParsing.EffectEntry.EffectEntry;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import org.pmw.tinylog.Logger;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
@ -54,15 +53,15 @@ public class EffectsParser {
// Parse effect entry description // Parse effect entry description
String firstLine = ""; String firstLine;
ArrayList<String> effectDescription = new ArrayList<>();
try { if (effectData.indexOf('\n') > 0)
firstLine = effectData.substring(0, effectData.indexOf('\n')); firstLine = effectData.substring(0, effectData.indexOf('\n'));
} catch (Exception e) { else
Logger.error(e); firstLine = effectData;
}
ArrayList<String> effectDescription = new ArrayList<>(); // Regex ignores spaces within quotes
Matcher matcher = STRSPLIT_REGEX.matcher(firstLine); Matcher matcher = STRSPLIT_REGEX.matcher(firstLine);

Loading…
Cancel
Save