Browse Source

Comment update

feature-config-parsing2
MagicBot 3 months ago
parent
commit
adde3fc3a8
  1. 14
      src/engine/ConfigParsing/EffectsParser.java

14
src/engine/ConfigParsing/EffectsParser.java

@ -54,10 +54,10 @@ public class EffectsParser { @@ -54,10 +54,10 @@ public class EffectsParser {
effectData = effectData.replaceAll("(?m)^.*#.*\r?\n?", "");
effectData = effectData.trim();
// Parse effect entry description
// Parse effect entry header
String firstLine;
ArrayList<String> effectDescription = new ArrayList<>();
ArrayList<String> effectHeader = new ArrayList<>();
// Some effects exist without sources/mods or conditions
// (ACID "MOB" 0)
@ -72,17 +72,17 @@ public class EffectsParser { @@ -72,17 +72,17 @@ public class EffectsParser {
Matcher matcher = STRSPLIT_REGEX.matcher(firstLine);
while (matcher.find())
effectDescription.add(matcher.group(1).trim());
effectHeader.add(matcher.group(1).trim());
effectEntry.id = effectDescription.get(0);
effectEntry.name = effectDescription.get(1);
effectEntry.id = effectHeader.get(0);
effectEntry.name = effectHeader.get(1);
effectEntry.name = effectEntry.name.replaceAll("\"", "");
// Some effect mods have no icon
// (SEEINVIS-SHADE "See Invis")
if (effectDescription.size() == 3)
effectEntry.icon = Integer.parseInt(effectDescription.get(2));
if (effectHeader.size() == 3)
effectEntry.icon = Integer.parseInt(effectHeader.get(2));
else
effectEntry.icon = 0;

Loading…
Cancel
Save