From 887db109c18a1a0210033e2541ceee88c192b797 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 24 Jul 2024 19:31:00 -0500 Subject: [PATCH] parsing multi worded names --- src/engine/ConfigParsing/EffectsParser.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index 2d6aa75b..24a83be5 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -61,7 +61,17 @@ public class EffectsParser { effectData.conditions = new ArrayList<>(); try { - effectData.name = compiledLines.get(1).replace(" ", "").replace("\"", "").split(" ")[1]; + String rawData = compiledLines.get(1).replace(" ", ""); + if(compiledLines.get(1).contains("\"")){ + int startIndex = rawData.indexOf('"'); + int endIndex = rawData.lastIndexOf('"'); + char[] nameValue = rawData.toCharArray(); + String name = ""; + for(int i = startIndex; i < endIndex; i++){ + name += nameValue[i]; + } + effectData.name = name; + } int iconID; try { iconID = Integer.parseInt(compiledLines.get(1).replace(" ", "").split(" ")[2]);