From 8372c52318b3cb407b0c221788ac5fb4d6c8dbdf Mon Sep 17 00:00:00 2001 From: 3TUSK Date: Tue, 10 Aug 2021 12:56:34 -0700 Subject: [PATCH] Ignore preferLocalCache option when fetching mod list --- build.gradle | 2 +- src/main/java/org/teacon/sync/Config.java | 4 ++++ src/main/java/org/teacon/sync/SyncedModLocator.java | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index a957673..5c48947 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ plugins { id 'signing' } -version = '0.1.5' +version = '0.1.6' group = 'org.teacon' archivesBaseName = 'RemoteSync-FML' diff --git a/src/main/java/org/teacon/sync/Config.java b/src/main/java/org/teacon/sync/Config.java index c2e9453..9070309 100644 --- a/src/main/java/org/teacon/sync/Config.java +++ b/src/main/java/org/teacon/sync/Config.java @@ -67,6 +67,10 @@ public final class Config { /** * If true, RemoteSync will always try using local cache, even if the file with the * same name on the remote server has been updated. + *

+ * Note that this config option will not take effect when fetching the mod list. The + * mod list is expected to be always the latest. + *

*/ public boolean preferLocalCache = true; } diff --git a/src/main/java/org/teacon/sync/SyncedModLocator.java b/src/main/java/org/teacon/sync/SyncedModLocator.java index fb2349a..0ee3116 100644 --- a/src/main/java/org/teacon/sync/SyncedModLocator.java +++ b/src/main/java/org/teacon/sync/SyncedModLocator.java @@ -89,7 +89,8 @@ public SyncedModLocator() throws Exception { this.modDirBase = Files.createDirectories(gameDir.resolve(cfg.modDir)); this.fetchPathsTask = CompletableFuture.supplyAsync(() -> { try { - return Utils.fetch(cfg.modList, gameDir.resolve(cfg.localModList), cfg.timeout, cfg.preferLocalCache); + // Intentionally do not use config value to ensure that the mod list is always up-to-date + return Utils.fetch(cfg.modList, gameDir.resolve(cfg.localModList), cfg.timeout, false); } catch (IOException e) { LOGGER.warn("Failed to download mod list", e); throw new RuntimeException(e);