Skip to content

feat: 添加新版本世界指定资源包位置支持#5552

Merged
Glavo merged 8 commits intoHMCL-dev:mainfrom
Mine-diamond:new-resources-location
Feb 20, 2026
Merged

feat: 添加新版本世界指定资源包位置支持#5552
Glavo merged 8 commits intoHMCL-dev:mainfrom
Mine-diamond:new-resources-location

Conversation

@Mine-diamond
Copy link
Contributor

添加新版本(26.1-snapshot-6)世界指定资源包新位置支持

@Glavo Glavo requested a review from Copilot February 17, 2026 15:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"));
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还行,两处挨一块的应该不需要单独写

@Glavo Glavo merged commit 68c291e into HMCL-dev:main Feb 20, 2026
2 checks passed
@Mine-diamond Mine-diamond deleted the new-resources-location branch February 20, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments