Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading