Skip to content

Commit

Permalink
1.1.16
Browse files Browse the repository at this point in the history
Make sure configs aren't completely wiped out
  • Loading branch information
Wyvest committed Jun 19, 2024
1 parent 3edfbe8 commit 94e09ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod_id=skyclientcosmetics
mod_name=SkyClientCosmetics
mod_version=1.1.15
mod_version=1.1.16
mod_archives_name=SkyClientCosmetics

# Gradle Configuration -- DO NOT TOUCH THESE VALUES.
Expand Down
14 changes: 12 additions & 2 deletions src/main/kotlin/co/skyclient/scc/gui/greeting/ImportSlide.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,18 @@ class ImportSlide : GreetingSlide<OptimizationSlide>(OptimizationSlide::class.ja
val file = File(parentConfig, location)
if (file.exists()) {
progressText.setText("Copying \"$location\"...")
file.copyRecursively(File(Launch.minecraftHome, location), overwrite = true, onError = { _, _ -> OnErrorAction.SKIP })
Thread.sleep(500)
var errored = false
File(Launch.minecraftHome, location).copyRecursively(File(Launch.minecraftHome, location + "-backup"), overwrite = true, onError = { _, _ ->
errored = true
return@copyRecursively OnErrorAction.SKIP
})
if (errored) {
progressText.setText("${ChatColor.RED}\"$location\" failed to copy a backup, skipping...")
Thread.sleep(1000)
} else {
file.copyRecursively(File(Launch.minecraftHome, location), overwrite = true, onError = { _, _ -> OnErrorAction.SKIP })
Thread.sleep(500)
}
} else {
progressText.setText("${ChatColor.RED}\"$location\" not found, skipping...")
Thread.sleep(1000)
Expand Down

0 comments on commit 94e09ac

Please sign in to comment.