Skip to content
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

Update to use minecraft-data for toMajor() #13

Closed
deathcap opened this issue Jan 24, 2016 · 1 comment
Closed

Update to use minecraft-data for toMajor() #13

deathcap opened this issue Jan 24, 2016 · 1 comment

Comments

@deathcap
Copy link
Member

lib/loader.js currently gets the major version from the release version by splitting the string:

function toMajor(mcVersion)
{
  var parts=mcVersion.split(".");
  if(parts.size<=1)
    return null;
  mcVersion=parts.slice(0,2).join(".");
  return mcVersion;
}

This works for full releases, but snapshot versions can be said to resemble certain "major" versions, which won't be parsed here. Instead this mapping can be looked up using minecraft-data, after:

PrismarineJS/minecraft-data#92 Add protocol version data

protocolVersions.json array, "majorVersion" key

(may also want to keep toMajor() as a fallback)

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

No branches or pull requests

2 participants