Repository navigation
fix(game-folders): 修正非 Windows 平台上官方启动器文件夹的路径 [Claude-Opus-5.5] - #40
Merged
LuLu-ling merged 1 commit intoNov 15, 2026
Merged
Conversation
原实现在所有平台都使用 ApplicationData/.minecraft,在 macOS 与 Linux 上 都不是官方启动器的实际位置,导致无法识别官方启动器文件夹。 新增 LauncherPaths.OfficialMinecraftDirectory,按平台返回: - Windows:%APPDATA%\.minecraft(与原行为一致) - macOS:~/Library/Application Support/minecraft - Linux:~/.minecraft 扫描文件夹(GameFolders)与恢复文件夹名称(PageSelectLeftViewModel) 统一改用该属性,保证两处判断一致。 Closes PCL-Community#26
LuLu-ling
approved these changes
Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明 / Summary
原实现在所有平台都使用
ApplicationData/.minecraft作为官方启动器文件夹。该路径在 macOS 与 Linux 上都不是官方启动器的实际位置,导致这两个平台无法识别官方启动器文件夹。新增
LauncherPaths.OfficialMinecraftDirectory,按平台返回:%APPDATA%\.minecraft(与原行为一致)~/Library/Application Support/minecraft~/.minecraft扫描文件夹(
GameFolders)与恢复文件夹名称(PageSelectLeftViewModel)统一改用该属性,保证两处判断一致。另外,Java 扫描(
DefaultPathsScanner)、Java 下载(Minecraft/Java/Download.cs)与 natives 回退路径(Launch/Natives.cs)中也有同样写死的ApplicationData/.minecraft。修改它们会影响 Java 的下载位置,超出本 Issue 范围,未包含在本 PR 中。关联 Issue / Related Issue
Closes #26
验证方式 / Verification
构建
dotnet publish PCL.Launcher/PCL.Launcher.csproj -c Debug -r osx-arm64 --no-self-contained -p:Platform=ARM64,编译通过运行测试(macOS 27.0.1,Apple Silicon)
~/Library/Application Support/minecraft/versions存在.minecraft/Users/<user>/Library/Application Support/minecraft/”未覆盖
AI 使用情况 / Generative Artificial Intelligence Usage
LauncherPaths.cs、GameFolders.cs、PageSelectLeftViewModel.cs提交前检查 / Checklist