Skip to content

fix: Address snapshot parsing in new versioning system#25

Merged
LexManos merged 1 commit into
MinecraftForge:masterfrom
Dario-Maselli:enhancement/add-26.3-snapshots
Jul 1, 2026
Merged

fix: Address snapshot parsing in new versioning system#25
LexManos merged 1 commit into
MinecraftForge:masterfrom
Dario-Maselli:enhancement/add-26.3-snapshots

Conversation

@Dario-Maselli

Copy link
Copy Markdown
Contributor

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:

  • Updated the snapshot version parsing in MinecraftVersion.java to use split("-snapshot-", 2), ensuring only the first occurrence is split and preventing issues with versions containing multiple -snapshot- substrings. Also, changed the default value for the release field from null to an empty string for consistency.

Test coverage enhancements:

  • Added new snapshot versions (26.3-snapshot-2, 26.3-snapshot-1) to the versions array in VersionList.java to ensure the new parsing logic is properly tested.

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.
Copilot AI review requested due to automatic review settings July 1, 2026 15:30

Copilot AI left a comment

Copy link
Copy Markdown

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 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 of null for the revision field.
  • Extend the test version manifest to include 26.3-snapshot-1 and 26.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.

Comment thread src/main/java/net/minecraftforge/srgutils/MinecraftVersion.java
@LexManos

LexManos commented Jul 1, 2026

Copy link
Copy Markdown
Member

Not sure why copilot poked his head in here.
But ya, wrote the snapshot one without testing as snapshots didn't exist at the time.
Missed the NPE, thanks.

@LexManos LexManos merged commit 3c679e5 into MinecraftForge:master Jul 1, 2026
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.

3 participants