Merged
Conversation
Member
Author
|
建议在客户端清单加载失败时,在版本列表中显示为“错误的版本”。 |
There was a problem hiding this comment.
Pull request overview
This pull request adds support for older Minecraft versions (1.12.2 and below) by implementing native library architecture mapping and updating the manifest parsing logic to handle legacy format differences. Additionally, it fixes a bug where installation progress could become negative when content length is unknown.
Changes:
- Adds NativesMapper utility to remap LWJGL and JNA libraries for different CPU architectures (arm64/x64)
- Updates ClientManifest to parse legacy
minecraftArgumentsfield and provide defaults for optional fields (javaVersion, logging) - Implements native library extraction for older Minecraft versions that require it
- Fixes progress calculation bug by checking for positive values instead of non-zero values
- Adds error instance tracking to display instances with unsupported manifest formats
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| PCL.Mac.Core/Utils/NativesMapper.swift | New utility to map native libraries (LWJGL, JNA) to architecture-specific versions for old Minecraft compatibility |
| PCL.Mac.Core/Utils/MavenCoordinateUtils.swift | New utility for parsing Maven coordinates and generating artifact paths |
| PCL.Mac.Core/Models/ClientManifest.swift | Added support for legacy minecraftArguments format, optional field defaults, and library replacement method |
| PCL.Mac.Core/Task/MinecraftInstallTask.swift | Added extractNatives step for old versions, uses mappedManifest for downloads while preserving original manifest |
| PCL.Mac/Task/MinecraftLaunchTask.swift | Integrates NativesMapper, clears natives directory before launch, passes manifest to completeResources |
| PCL.Mac.Core/Minecraft/MinecraftRepository.swift | Tracks error instances separately to display unsupported manifests in UI |
| PCL.Mac.Core/Minecraft/MinecraftInstance.swift | Moves automatic Java selection to init method |
| PCL.Mac.Core/Services/JavaSearcher.swift | Makes IMPLEMENTOR field optional with default value for compatibility |
| PCL.Mac.Core/Utils/Download/DownloadItem.swift | Adds Hashable conformance to enable deduplication |
| PCL.Mac.Core/Utils/Download/MultiFileDownloader.swift | Deduplicates download items using Set to prevent duplicate downloads |
| PCL.Mac.Core/Utils/Download/DownloadDelegate.swift | Fixes negative progress bug by checking totalBytesExpectedToWrite > 0 instead of != 0 |
| PCL.Mac.Core/Models/VersionManifest.swift | Simplifies ordinal calculation to return index directly |
| PCL.Mac/ViewModels/MinecraftDownloadPageViewModel.swift | Caches version manifest to disk for offline use |
| PCL.Mac/Views/Launch/InstanceList/InstanceListPage.swift | Displays error instances and sorts instances by version |
| PCL.Mac/Assets.xcassets/VersionIcons/RedstoneBlock.imageset/* | Adds RedstoneBlock icon for error instances |
| PCL.Mac.Tests/Minecraft/MinecraftLaunchTests.swift | Comments out explicit Java path to rely on automatic detection |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
本 PR 为 1.12.2 及以下的版本提供了支持。
closes #61 , fixes #70 .