Interface MinecraftVersion
- All Superinterfaces:
Comparable<MinecraftVersion>
A Minecraft version, such as
26.4, 26.4.1 or 26.4-snapshot-5.
Versions are ordered by number, then by stage: snapshots, pre-releases, release candidates, then the release.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumA development stage, in release order. -
Method Summary
Modifier and TypeMethodDescriptionid()Returns the version id, for instance26.4-snapshot-5.intReturns which snapshot, pre-release or release candidate this is,2in26.4.1-rc-2,0for a release.intmajor()Returns the first number of the version,26in26.4.1-rc-2.intminor()Returns the second number of the version,4in26.4.1-rc-2.name()Returns the display name, for instance26.4 Snapshot 5.static MinecraftVersionof(int major, int minor, int patch, MinecraftVersion.Stage stage, int iteration) Creates a version.static MinecraftVersionParses a version id.intpatch()Returns the third number of the version,1in26.4.1-rc-2,0when omitted as in26.4.stage()Returns the development stage,MinecraftVersion.Stage.RELEASE_CANDIDATEin26.4.1-rc-2.Methods inherited from interface Comparable
compareTo
-
Method Details
-
of
@Contract("_, _, _, _, _ -> new") static MinecraftVersion of(int major, int minor, int patch, MinecraftVersion.Stage stage, int iteration) Creates a version.- Parameters:
major- the first number of the versionminor- the second number of the versionpatch- the third number of the version,0if absentstage- the development stageiteration- which snapshot, pre-release or release candidate this is,0for a release- Returns:
- the version
- Throws:
IllegalArgumentException- if a number is negative, or the iteration does not match the stage- Since:
- 0.1.0
-
parse
Parses a version id.- Parameters:
id- the version id, for instance26.2-rc-10- Returns:
- the version
- Throws:
IllegalArgumentException- if the id is malformed- Since:
- 0.1.0
-
major
-
minor
-
patch
-
stage
Returns the development stage,MinecraftVersion.Stage.RELEASE_CANDIDATEin26.4.1-rc-2.- Returns:
- the development stage,
MinecraftVersion.Stage.RELEASE_CANDIDATEin26.4.1-rc-2 - Since:
- 0.1.0
-
iteration
-
id
-
name
-