Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
Ignore preferLocalCache option when fetching mod list
Browse files Browse the repository at this point in the history
  • Loading branch information
3TUSK committed Aug 10, 2021
1 parent be6151c commit 8372c52
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
id 'signing'
}

version = '0.1.5'
version = '0.1.6'
group = 'org.teacon'
archivesBaseName = 'RemoteSync-FML'

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/teacon/sync/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* <p>
* Note that this config option will not take effect when fetching the mod list. The
* mod list is expected to be always the latest.
* </p>
*/
public boolean preferLocalCache = true;
}
3 changes: 2 additions & 1 deletion src/main/java/org/teacon/sync/SyncedModLocator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8372c52

Please sign in to comment.