mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-10-17 08:24:32 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
73d21a475a | ||
|
7568770078 |
@@ -182,13 +182,13 @@ internal class DownloadTask private constructor(val metadata: IndexFile.File, de
|
|||||||
|
|
||||||
// Ensure wrong-side or optional false files are removed
|
// Ensure wrong-side or optional false files are removed
|
||||||
cachedFile?.let {
|
cachedFile?.let {
|
||||||
if (!it.optionValue || !correctSide()) {
|
if ((it.isOptional && !it.optionValue) || !correctSide()) {
|
||||||
if (it.cachedLocation == null) return
|
if (it.cachedLocation != null) {
|
||||||
|
try {
|
||||||
try {
|
Files.deleteIfExists(Paths.get(packFolder, it.cachedLocation))
|
||||||
Files.deleteIfExists(Paths.get(packFolder, it.cachedLocation))
|
} catch (e: IOException) {
|
||||||
} catch (e: IOException) {
|
Log.warn("Failed to delete file before downloading", e)
|
||||||
Log.warn("Failed to delete file before downloading", e)
|
}
|
||||||
}
|
}
|
||||||
it.cachedLocation = null
|
it.cachedLocation = null
|
||||||
}
|
}
|
||||||
|
@@ -128,7 +128,9 @@ class UpdateManager internal constructor(private val opts: Options, val ui: IUse
|
|||||||
if (manifest.packFileHash?.let { packFileSource.hashIsEqual(it) } == true && invalidatedUris.isEmpty()) {
|
if (manifest.packFileHash?.let { packFileSource.hashIsEqual(it) } == true && invalidatedUris.isEmpty()) {
|
||||||
// todo: --force?
|
// todo: --force?
|
||||||
ui.submitProgress(InstallProgress("Modpack is already up to date!", 1, 1))
|
ui.submitProgress(InstallProgress("Modpack is already up to date!", 1, 1))
|
||||||
ui.awaitOptionalButton(false)
|
if (manifest.cachedFiles.any { it.value.isOptional }) {
|
||||||
|
ui.awaitOptionalButton(false)
|
||||||
|
}
|
||||||
if (!ui.optionsButtonPressed) {
|
if (!ui.optionsButtonPressed) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -186,7 +188,9 @@ class UpdateManager internal constructor(private val opts: Options, val ui: IUse
|
|||||||
private fun processIndex(indexUri: SpaceSafeURI, indexHash: Hash, hashFormat: String, manifest: ManifestFile, invalidatedUris: List<SpaceSafeURI>) {
|
private fun processIndex(indexUri: SpaceSafeURI, indexHash: Hash, hashFormat: String, manifest: ManifestFile, invalidatedUris: List<SpaceSafeURI>) {
|
||||||
if (manifest.indexFileHash == indexHash && invalidatedUris.isEmpty()) {
|
if (manifest.indexFileHash == indexHash && invalidatedUris.isEmpty()) {
|
||||||
ui.submitProgress(InstallProgress("Modpack files are already up to date!", 1, 1))
|
ui.submitProgress(InstallProgress("Modpack files are already up to date!", 1, 1))
|
||||||
ui.awaitOptionalButton(false)
|
if (manifest.cachedFiles.any { it.value.isOptional }) {
|
||||||
|
ui.awaitOptionalButton(false)
|
||||||
|
}
|
||||||
if (!ui.optionsButtonPressed) {
|
if (!ui.optionsButtonPressed) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user