Skip to content

Fix version normalization for Minecraft classic #1041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SpaceWalkerRS
Copy link
Contributor

Currently in McVersionLookup, it checks if the version string starts with c0. and removes the leading c character. This leads to invalid semver as a version like c0.0.11a ends up being converted to 0.0.11.a. I added two new regex patterns and changed the normalization so it gives the following results:

  • c0.0.11a -> 0.11.0
  • c0.0.23a_01 -> 0.23.1
  • c0.24_st_03 -> 0.24.3
  • c0.25_05_st -> 0.25.5
  • c0.29 -> 0.29.0
  • c0.30-c -> 0.30.0

I opted to strip all non-digit characters (a used in early classic versions, the st used in survival test versions, and the s and c used in late classic versions) because none of them are used to denote that one version is later than another.

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.

1 participant