diff --git a/installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismInstallation.kt b/installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismInstallation.kt index edf3ae0..ec907ed 100644 --- a/installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismInstallation.kt +++ b/installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismInstallation.kt @@ -16,6 +16,7 @@ package gg.essential.installer.launcher.prism import gg.essential.installer.launcher.Installation +import java.nio.file.Files import java.nio.file.Path import kotlin.io.path.div @@ -25,7 +26,21 @@ class PrismInstallation( instanceFolder: Path, val config: InstanceConfig, pack: MMCPack, -) : Installation(id, launcher, config.name, pack.mcVersion, pack.modloaderInfo, instanceFolder / ".minecraft") { +) : Installation( + id, + launcher, + config.name, + pack.mcVersion, + pack.modloaderInfo, + // Prism has always supported both .minecraft and minecraft folders, which was previously missed by us... + // But they have since switched to using the dotless folder as default so we should do the same. + // We mirror the Prism Launcher behaviour exactly: + // https://github.com/PrismLauncher/PrismLauncher/blob/e0c569365f39ac6277c645ed26ce2ccff6a3a4ae/launcher/minecraft/MinecraftInstance.cpp#L349 + if(Files.exists(instanceFolder / ".minecraft") && Files.notExists(instanceFolder / "minecraft")) + instanceFolder / ".minecraft" + else + instanceFolder / "minecraft" +) { override fun compareTo(other: Installation): Int { if (other !is PrismInstallation) return 0 // We can't really compare, nor should we even anyway diff --git a/installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismLauncher.kt b/installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismLauncher.kt index 1904bf3..bd252d4 100644 --- a/installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismLauncher.kt +++ b/installer/src/main/kotlin/gg/essential/installer/launcher/prism/PrismLauncher.kt @@ -126,7 +126,7 @@ class PrismLauncher( } override fun getNewGameDataFolder(name: String): Path { - return appendInstallNameToPath(instancesFolder, name) / ".minecraft" + return appendInstallNameToPath(instancesFolder, name) / "minecraft" } override fun getNewInstallInfo(name: String, modVersion: ModVersion, mcVersion: MCVersion, modloader: Modloader, modloaderVersion: ModloaderVersion): PrismInstallInfo.New {