* fix #1705: Do not re-enable mod after update * update * Do not select disabled mods by default
This commit is contained in:
@@ -170,6 +170,10 @@ public final class LocalModFile implements Comparable<LocalModFile> {
|
||||
}
|
||||
}
|
||||
|
||||
public void disable() throws IOException {
|
||||
file = modManager.disableMod(file);
|
||||
}
|
||||
|
||||
public ModUpdate checkUpdates(String gameVersion, RemoteModRepository repository) throws IOException {
|
||||
Optional<RemoteMod.Version> currentVersion = repository.getRemoteVersionByLocalFile(this, file);
|
||||
if (!currentVersion.isPresent()) return null;
|
||||
|
||||
@@ -234,7 +234,11 @@ public final class ModManager {
|
||||
|
||||
public Path disableMod(Path file) throws IOException {
|
||||
if (isOld(file)) return file; // no need to disable an old mod.
|
||||
Path disabled = file.resolveSibling(StringUtils.addSuffix(FileUtils.getName(file), DISABLED_EXTENSION));
|
||||
|
||||
String fileName = FileUtils.getName(file);
|
||||
if (fileName.endsWith(DISABLED_EXTENSION)) return file;
|
||||
|
||||
Path disabled = file.resolveSibling(fileName + DISABLED_EXTENSION);
|
||||
if (Files.exists(file))
|
||||
Files.move(file, disabled, StandardCopyOption.REPLACE_EXISTING);
|
||||
return disabled;
|
||||
|
||||
Reference in New Issue
Block a user