From 47cb824b3f622f88cead47f3da458d46e7bdf822 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 24 Jul 2024 19:44:29 -0500 Subject: [PATCH] parsing multi worded names --- src/engine/ConfigParsing/EffectsParser.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index 7f9e9cc0..605d25c1 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -88,10 +88,23 @@ public class EffectsParser { //log all sources for (String line : compiledLines) { + String rawValue; + if (line.contains("SOURCEBEGIN")) { + rawValue = compiledLines.get(index + 1).replace(" ", ""); + switch (rawValue) { + case "Crush": + rawValue = "Crushing"; + break; + case "Slash": + rawValue = "Slashing"; + break; + case "Pierce": + rawValue = "Piercing"; + break; - if (line.contains("SOURCEBEGIN")) - effectData.sources.add(mbEnums.EffectSourceType.valueOf(compiledLines.get(index + 1).replace(" ", ""))); - + } + effectData.sources.add(mbEnums.EffectSourceType.valueOf(rawValue)); + } index++; }