Browse Source

Effect Modifier parsing work.

feature-config-parsing2
MagicBot 3 months ago
parent
commit
74b37063bf
  1. 11
      src/engine/ConfigParsing/EffectsParser.java

11
src/engine/ConfigParsing/EffectsParser.java

@ -115,17 +115,14 @@ public class EffectsParser { @@ -115,17 +115,14 @@ public class EffectsParser {
EffectModifier effectModifier = new EffectModifier();
ArrayList<String> modValues = new ArrayList<>();
Matcher matcher = STRSPLIT_REGEX.matcher(modData);
String[] modEntries = modData.trim().split("\n");
while (matcher.find())
modValues.add(matcher.group(1).trim());
effectModifier.type = mbEnums.ModType.valueOf(modValues.get(0));
effectModifier.type = mbEnums.ModType.valueOf(modEntries[0]);
switch (effectModifier.type) {
case AnimOverride:
effectModifier.min = Integer.parseInt(modValues.get(1));
effectModifier.max = Integer.parseInt(modValues.get(2));
effectModifier.min = Integer.parseInt(modEntries[1]);
effectModifier.max = Integer.parseInt(modEntries[2]);
break;
default:
Logger.error("Unhandled type: " + effectModifier.type);

Loading…
Cancel
Save