Skip to content

Commit 8a72f79

Browse files
committed
Change Prism Launcher default install folder to be dotless, following prism's change.
1 parent 9f73d9b commit 8a72f79

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismInstallation.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package gg.essential.installer.launcher.prism
1717

1818
import gg.essential.installer.launcher.Installation
19+
import java.nio.file.Files
1920
import java.nio.file.Path
2021
import kotlin.io.path.div
2122

@@ -25,7 +26,17 @@ class PrismInstallation(
2526
instanceFolder: Path,
2627
val config: InstanceConfig,
2728
pack: MMCPack,
28-
) : Installation(id, launcher, config.name, pack.mcVersion, pack.modloaderInfo, instanceFolder / ".minecraft") {
29+
) : Installation(
30+
id,
31+
launcher,
32+
config.name,
33+
pack.mcVersion,
34+
pack.modloaderInfo,
35+
// Prism has always supported both .minecraft and minecraft folders, which was previously missed by us...
36+
// But they have now switched to using the dotless folder as default so we should do the same.
37+
// We use the dot folder if it exists, otherwise we use the dotless one.
38+
(instanceFolder / ".minecraft").takeIf { Files.exists(it) } ?: (instanceFolder / "minecraft")
39+
) {
2940

3041
override fun compareTo(other: Installation): Int {
3142
if (other !is PrismInstallation) return 0 // We can't really compare, nor should we even anyway

installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismLauncher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class PrismLauncher(
126126
}
127127

128128
override fun getNewGameDataFolder(name: String): Path {
129-
return appendInstallNameToPath(instancesFolder, name) / ".minecraft"
129+
return appendInstallNameToPath(instancesFolder, name) / "minecraft"
130130
}
131131

132132
override fun getNewInstallInfo(name: String, modVersion: ModVersion, mcVersion: MCVersion, modloader: Modloader, modloaderVersion: ModloaderVersion): PrismInstallInfo.New {

0 commit comments

Comments
 (0)