From 57c8055c4cf554634a66589be37effc07585ab6e Mon Sep 17 00:00:00 2001 From: Caedis Date: Sun, 12 Jan 2025 05:36:16 +0000 Subject: [PATCH] =?UTF-8?q?Dont=20cache=20or=20upgrade=20mods=20when=20goi?= =?UTF-8?q?ng=20from=20maven=20to=20asset=20file=20name=20a=E2=80=A6=20(#5?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/GTNHNightlyUpdater/Updater.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/GTNHNightlyUpdater/Updater.java b/src/main/java/GTNHNightlyUpdater/Updater.java index 44c71f7..7bc8ad1 100644 --- a/src/main/java/GTNHNightlyUpdater/Updater.java +++ b/src/main/java/GTNHNightlyUpdater/Updater.java @@ -96,11 +96,15 @@ void updateModpackMods(Assets.Asset assets, Path modCacheDir, Set modExc continue; } - String newModFileName = modVersionToUse.filename(); - if (packMods.containsKey(newModFileName.toLowerCase())) { + if (packMods.containsKey(modVersionToUse.filename().toLowerCase())) { + continue; + } + if (packMods.containsKey(modVersionToUse.mavenFilename().toLowerCase())) { continue; } + String newModFileName = modVersionToUse.filename(); + String oldFileName = null; // check for old nightly version for (val version : mod.versions()) { @@ -245,6 +249,10 @@ void cacheMods(Assets.Asset asset, Path modCacheDir) throws IOException, Interru } } + if (Files.exists(modCacheDir.resolve(modVersionToUse.filename())) || Files.exists(modCacheDir.resolve(modVersionToUse.mavenFilename()))) { + continue; + } + Path targetPath = modCacheDir.resolve(modVersionToUse.filename()); String downloadURL;