-
Notifications
You must be signed in to change notification settings - Fork 10
Mods and SemVer an odyssey
When writing ModManager I stumbled across inconsistencies in the ways to define versions in the minecraft community.
Which provides challenges as version should be in the best case comparable.
Versions are there to tell something has been further developed.
A version can be just a number or letter something more complex like 1.0.0-alpha+1.17-build.8a8eea4
.
Every version should have a logical pattern which follows some rules.
This is where SemVer comes into play, it defines rules how version numbers
are assigned and incremented.
Most of the people will choose something like 1.0.0
(Major.Minor.Patch) as version as it seems logical and is also
part of SemVer. But maybe you asking yourself "What about the additional information some mods wan't to provide",
this is also something which SemVer defines as "Build metadata".
It can be added by using a plus sign and then appending your information like the Minecraft version.
An example version would look like this: 1.0.0+1.17
Maybe you asking yourself what about alpha and beta versions.
This is also defined by SemVer. It will be just appended with a minus sign.
An example would look like this: 1.0.0-alpha
A combined version with both "features"would look like this: 1.0.0-alpha+1.17
Following SemVer is very important for distributing mods as it helps to compare versions.
Humans can differentiate between a version v2.0.5
and only 2.0.5
an algorithm following rules can't do that.
The Fabric Loader uses SemVer to check if compatible mod versions are loaded and the new loader version 0.12.0 tries to
resolve dependency issues.
Also do I have an own interest in mods following SemVer as I'm using Fabric's SemVer implementation to compare versions to
get the latest version of a mod.
As a user? You can ask the authors of your favorite mods nicely to use SemVer if they haven't.
As a developer you can do several things:
- Follow SemVer described here
- Use the same version in the
fabric.mod.json
and theversionNumber
field of Modrinth
Extras:
For better compatibility with ModManager I suggest setting the project id via fabric.mod.json
the documentation for that can be found here