Prevent HMCL 2.x updating

This commit is contained in:
huangyuhui
2018-08-23 21:45:47 +08:00
parent 200621996d
commit 5c3d735315

View File

@@ -48,7 +48,6 @@ final class LocalRepository {
private LocalRepository() {} private LocalRepository() {}
private static Path localStorage = Launcher.HMCL_DIRECTORY.toPath().resolve("hmcl.jar"); private static Path localStorage = Launcher.HMCL_DIRECTORY.toPath().resolve("hmcl.jar");
private static Path hmclVersionJson = Launcher.HMCL_DIRECTORY.toPath().resolve("hmclver.json");
/** /**
* Gets the current stored executable in local repository. * Gets the current stored executable in local repository.
@@ -70,14 +69,6 @@ final class LocalRepository {
} else { } else {
Files.copy(source, localStorage, StandardCopyOption.REPLACE_EXISTING); Files.copy(source, localStorage, StandardCopyOption.REPLACE_EXISTING);
} }
Optional<LocalVersion> stored = getStored();
if (stored.isPresent()) {
Map<String, String> json = new HashMap<>();
json.put("ver", stored.get().getVersion());
json.put("loc", stored.get().getLocation().toString());
FileUtils.writeText(hmclVersionJson.toFile(), Constants.GSON.toJson(json));
}
} }
/** /**