From 8eee7ca23e64ce82df6ae05afea5659ca5d3feeb Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 23 Jul 2024 20:51:58 -0500 Subject: [PATCH] Effects.cfg parser --- src/engine/ConfigParsing/EffectsParser.java | 23 +++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index 8c946552..e9e60381 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -13,6 +13,7 @@ import engine.ConfigParsing.EffectsData.EffectData; import engine.ConfigParsing.EffectsData.Mod; import engine.gameManager.ConfigManager; import java.io.BufferedReader; +import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; @@ -41,15 +42,19 @@ public class EffectsParser { CreateBlocks(compiledData); } public static String[] readLines(String filename) throws IOException { - 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]); + File effectsCfg = new File(EffectsPath); + 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]); } public static void CreateBlocks(ArrayList> compiledData) {