fix: Address snapshot parsing in new versioning system#25
Merged
LexManos merged 1 commit intoJul 1, 2026
Merged
Conversation
Use limit of 2 in split to avoid issues with snapshot version strings containing multiple dashes. Also replace null with empty string for the classifier parameter to avoid potential NPEs. Adds snapshot test cases to VersionList.
There was a problem hiding this comment.
Pull request overview
This PR updates MinecraftVersion parsing to better support Minecraft’s new numeric versioning scheme for snapshot builds, and extends the regression test version list to include newer snapshot versions.
Changes:
- Adjust snapshot parsing for the new versioning scheme by splitting on
-snapshot-with a limit and using an empty string instead ofnullfor the revision field. - Extend the test version manifest to include
26.3-snapshot-1and26.3-snapshot-2.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/java/net/minecraftforge/srgutils/MinecraftVersion.java | Updates parsing logic for new-system snapshot versions. |
| src/test/java/net/minecraftforge/srgutils/test/VersionList.java | Adds newer snapshot versions to the parsing/sorting regression list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Not sure why copilot poked his head in here. |
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.
This pull request updates the handling and testing of Minecraft's new version numbering system, specifically for snapshot versions. The main changes include improving the parsing logic for snapshot versions and expanding the test coverage to include new snapshot version formats.
Improvements to version parsing:
MinecraftVersion.javato usesplit("-snapshot-", 2), ensuring only the first occurrence is split and preventing issues with versions containing multiple-snapshot-substrings. Also, changed the default value for thereleasefield fromnullto an empty string for consistency.Test coverage enhancements:
26.3-snapshot-2,26.3-snapshot-1) to theversionsarray inVersionList.javato ensure the new parsing logic is properly tested.