diff --git a/firestar/src/main/java/Clifford.java b/firestar/src/main/java/Clifford.java index d9962db..da20d63 100644 --- a/firestar/src/main/java/Clifford.java +++ b/firestar/src/main/java/Clifford.java @@ -203,6 +203,9 @@ public class Clifford implements ActionListener { if (new File(directory.getAbsolutePath() + "/pack.png").exists()) { zip.addFile(new File(directory.getAbsolutePath() + "/pack.png")); } + if (new File(directory.getAbsolutePath() + "/fscript").exists()) { + zip.addFile(new File(directory.getAbsolutePath() + "/fscript")); + } JSONObject container = new JSONObject(); container.put("version", Integer.parseInt(fVersion.getText())); diff --git a/firestar/src/main/java/Gonzo.java b/firestar/src/main/java/Gonzo.java index 7fdef60..d41c87b 100644 --- a/firestar/src/main/java/Gonzo.java +++ b/firestar/src/main/java/Gonzo.java @@ -154,33 +154,9 @@ public class Gonzo { consoleDisplay.append("Firestar is extracting " + m.friendlyName + " by " + m.author + "\n"); new ZipFile(System.getProperty("user.home") + "/.firestar/mods/" + m.path).extractAll(System.getProperty("user.home") + "/.firestar/temp/"); - try (Stream walkStream = Files.walk(Paths.get(System.getProperty("user.home") + "/.firestar/temp/"))) { - walkStream.filter(p -> p.toFile().isFile()).forEach(f -> { - if (f.toString().endsWith(".patch")) { - System.out.println("Patching " + f.toString() + "..."); - consoleDisplay.append("Patching " + f.toString() + "...\n"); - String mainFile = f.toString().substring(0, f.toString().length() - 6); - - try { - List original = Files.readAllLines(new File(mainFile).toPath()); - List patched = Files.readAllLines(f); - - Patch patch = UnifiedDiffUtils.parseUnifiedDiff(patched); - List result = DiffUtils.patch(original, patch); - - try (FileWriter fileWriter = new FileWriter(mainFile)) { - for (String str : result) { - fileWriter.write(str + "\r\n"); - } - } - new File(f.toString()).delete(); - } catch (Exception ex) { - Logger.getLogger(Gonzo.class.getName()).log(Level.SEVERE, null, ex); - System.out.println(ex.getMessage()); - consoleDisplay.append("CRITICAL FAILURE: " + ex.getMessage()); - } - } - }); + File fscript = new File(Main.inpath + "temp/fscript"); + if (fscript.exists()) { + new Rizzo(fscript, Main.inpath + "temp/"); // Lets rizz this mod up } if (new File(System.getProperty("user.home") + "/.firestar/temp/delete.txt").isFile()) {