Browse Source

Comment update

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

Loading…
Cancel
Save