From 3166179e623e476bbbd13c39a59d7ccb86770c5c Mon Sep 17 00:00:00 2001 From: inderpxar Date: Mon, 25 Dec 2023 15:33:41 -0500 Subject: [PATCH] Override existing file upon goomod export --- src/main/java/com/WooGLEFX/File/LevelExporter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/WooGLEFX/File/LevelExporter.java b/src/main/java/com/WooGLEFX/File/LevelExporter.java index b22bf61..d14ebf5 100644 --- a/src/main/java/com/WooGLEFX/File/LevelExporter.java +++ b/src/main/java/com/WooGLEFX/File/LevelExporter.java @@ -648,7 +648,12 @@ public static void exportGoomod(File file, WorldLevel level, ArrayList<_Ball> ba try { new ZipUtility().zip(new ArrayList<>(List.of(new File(start + "\\res\\levels\\" + level.getLevelName() + "\\goomod").listFiles())), start + "\\res\\levels\\" + level.getLevelName() + "\\goomod.zip"); - new File(start + "\\res\\levels\\" + level.getLevelName() + "\\goomod.zip").renameTo(file); + File srcGoomod = new File(start + "\\res\\levels\\" + level.getLevelName() + "\\goomod.zip"); + Files.move( + srcGoomod.toPath(), + file.toPath(), + StandardCopyOption.REPLACE_EXISTING + ); } catch (Exception e) { Alarms.errorMessage(e); }