Skip to content

Commit 35744bf

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

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

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

Lines changed: 16 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,21 @@ 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 since switched to using the dotless folder as default so we should do the same.
37+
// We mirror the Prism Launcher behaviour exactly:
38+
// https://github.com/PrismLauncher/PrismLauncher/blob/e0c569365f39ac6277c645ed26ce2ccff6a3a4ae/launcher/minecraft/MinecraftInstance.cpp#L349
39+
if(Files.exists(instanceFolder / ".minecraft") && Files.notExists(instanceFolder / "minecraft"))
40+
instanceFolder / ".minecraft"
41+
else
42+
instanceFolder / "minecraft"
43+
) {
2944

3045
override fun compareTo(other: Installation): Int {
3146
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)