Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for the new world-specific resource pack location introduced in Minecraft version 26.1-snapshot-6. The changes implement version-aware resource pack installation that places resources in different directories based on the game version.
Changes:
- Added game version parameter to datapack installation methods to enable version-aware resource pack placement
- Implemented logic to determine resource pack location based on game version (new
resourcepacks/subdirectory for 26.1-snapshot-6+, legacy root location for older versions) - Updated UI layer to pass game version information during datapack installation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| HMCLCore/src/main/java/org/jackhuang/hmcl/mod/Datapack.java | Added game version parameter and conditional logic to place resource packs in version-appropriate directories |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DatapackListPage.java | Updated to store world reference and pass game version to datapack installation method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| && gameVersionNumber.compareTo(GameVersionNumber.asGameVersion("26.1-snapshot-6")) >= 0; | ||
|
|
||
| if (useNewResourcePath) { | ||
| Files.createDirectories(targetDatapackDirectory.getParent().resolve("resourcepacks")); |
There was a problem hiding this comment.
The directory name 'resourcepacks' is hardcoded in multiple places (lines 115-116, 118). Consider extracting this as a named constant to improve maintainability and reduce the risk of typos.
There was a problem hiding this comment.
还行,两处挨一块的应该不需要单独写
添加新版本(26.1-snapshot-6)世界指定资源包新位置支持