Repository navigation
Conversation
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 introduces a more robust and reliable way to display Minecraft server versions by prioritizing the use of protocol numbers (which are trustworthy and not user-controlled) when the version string is missing or custom. It also ensures that only valid, displayable versions are shown in the UI, and never raw or potentially misleading custom version strings. Additionally, it adds a scheduled GitHub Action to keep the protocol mapping up to date automatically.
Key changes include:
Version resolution logic
resolveServerVersionutility inutils.tsthat first tries to parse the declared version string, and if that fails (e.g., custom or missing version), falls back to resolving the version from the protocol number using a new mapping. This ensures that only valid, displayable versions are shown, and never arbitrary user-controlled strings. [1] [2]ServerCard,ServerDetailHeader,ServersTab) to useresolveServerVersioninstead of directly displaying the raw version string, ensuring consistent and safe version display across the app. [1] [2] [3] [4] [5] [6] [7] [8]Protocol mapping and update automation
minecraft-protocols.tsfile containing a vendored, auto-generated mapping from Java protocol numbers to displayable Minecraft versions, along with a utility to resolve protocol numbers to versions. This mapping is kept deterministic and avoids runtime network fetches.update-protocols.yml) that automatically regenerates this protocol mapping from the upstream PrismarineJS data every week and opens a PR if there are changes, ensuring the mapping stays current.update:protocolsto facilitate local updates.Testing and reliability
UI consistency and fidelity
These changes make the version display logic more robust, secure, and maintainable, while also automating protocol mapping updates to reduce manual maintenance.