forked from MagicBane/Server
Regex split update
This commit is contained in:
@@ -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,16 +53,16 @@ public class EffectsParser {
|
|||||||
|
|
||||||
// Parse effect entry description
|
// Parse effect entry description
|
||||||
|
|
||||||
String firstLine = "";
|
String firstLine;
|
||||||
|
|
||||||
try {
|
|
||||||
firstLine = effectData.substring(0, effectData.indexOf('\n'));
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList<String> effectDescription = new ArrayList<>();
|
ArrayList<String> effectDescription = new ArrayList<>();
|
||||||
|
|
||||||
|
if (effectData.indexOf('\n') > 0)
|
||||||
|
firstLine = effectData.substring(0, effectData.indexOf('\n'));
|
||||||
|
else
|
||||||
|
firstLine = effectData;
|
||||||
|
|
||||||
|
// Regex ignores spaces within quotes
|
||||||
|
|
||||||
Matcher matcher = STRSPLIT_REGEX.matcher(firstLine);
|
Matcher matcher = STRSPLIT_REGEX.matcher(firstLine);
|
||||||
|
|
||||||
while (matcher.find())
|
while (matcher.find())
|
||||||
|
|||||||
Reference in New Issue
Block a user