From 093ee9f59a79bf2d71747d592c183f5d8b6bbf90 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 23 Jul 2024 21:02:41 -0500 Subject: [PATCH] Effects.cfg parser --- src/engine/ConfigParsing/EffectsParser.java | 24 +++++++++------------ 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index 162a5a50..e056eb7f 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.List; public class EffectsParser { - public static String EffectsPath = ConfigManager.DEFAULT_DATA_DIR + "Effects.cfg"; + public static String EffectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg"; public static void init() throws IOException { ArrayList> compiledData = new ArrayList<>(); String[] lines = readLines(EffectsPath); @@ -42,19 +42,15 @@ public class EffectsParser { CreateBlocks(compiledData); } public static String[] readLines(String filename) throws IOException { - File effectsCfg = new File("/home/mbdev/mb_dev/mb.data/Effects.cfg"); - return effectsCfg.list(); - - - //FileReader fileReader = new FileReader(filename); - //BufferedReader bufferedReader = new BufferedReader(fileReader); - //List lines = new ArrayList<>(); - // String line; - //while ((line = bufferedReader.readLine()) != null) { - // lines.add(line); - //} - //bufferedReader.close(); - //return lines.toArray(new String[0]); + FileReader fileReader = new FileReader(filename); + BufferedReader bufferedReader = new BufferedReader(fileReader); + List lines = new ArrayList<>(); + String line; + while ((line = bufferedReader.readLine()) != null) { + lines.add(line); + } + bufferedReader.close(); + return lines.toArray(new String[0]); } public static void CreateBlocks(ArrayList> compiledData) {