Interface VersionScheme
The project ships with three entry points:
MOJANG, which keeps the historically grounded mappings and stays conservative when no official classic alias exists.CROA_CUSTOM, which keeps the same historical mappings but treats1.21.11as a custom1.22milestone, continues custom hotfixes on the25.4.xline, and shifts the projected future classic aliases forward by one minor line.mapped(MappingTable), which lets callers create their own exact scheme from user-defined mappings.
Both built-in schemes are exact for the release lines that are explicitly registered in
MappingTable. Those mappings are based on the real Java release groupings, so hotfix
numbers stay contiguous even when Mojang skipped a classic patch number such as
1.4.3 or 1.7.3.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VersionSchemeCustom scheme that keeps the same exact historical mappings asMOJANG, but makes one project-specific reinterpretation.static final VersionSchemeCanonical scheme that models Mojang's published numbering direction as closely as possible. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull VersionSchememapped(@NotNull MappingTable mappings) Creates a scheme backed only by the supplied explicit mapping table.default @NotNull StringParses the supplied text and delegates totoClassic(MinecraftVersion).@NotNull StringtoClassic(@NotNull MinecraftVersion version) Converts the supplied parsed version into classic numbering.default @NotNull StringParses the supplied text and delegates totoDrop(MinecraftVersion).@NotNull StringtoDrop(@NotNull MinecraftVersion version) Converts the supplied parsed version into drop numbering.
-
Field Details
-
MOJANG
Canonical scheme that models Mojang's published numbering direction as closely as possible.For historical Java releases, this scheme uses an explicit mapping table grouped by the actual feature update or game drop each version belongs to. That means examples such as
1.20.3 -> 23.2and1.21.4 -> 24.4are treated as separate drops instead of being folded into the same release line.For post-2025 releases, Mojang no longer publishes a classic
1.x.yalias. To avoid inventing more structure than the official numbering guarantees, this scheme only projects the first drop of a future year back into classic form. Additional future drops without an explicit table entry are rejected rather than guessed. -
CROA_CUSTOM
Custom scheme that keeps the same exact historical mappings asMOJANG, but makes one project-specific reinterpretation.Under this scheme, the release line represented officially by
1.21.11/25.4is treated as a custom1.22. Hotfixes on that custom line continue naturally as1.22.1 -> 25.4.1,1.22.2 -> 25.4.2, and so on. Because the base1.22identifier is already consumed by that alias, projected future aliases move forward by one classic minor line:26.1 -> 1.23,26.1.1 -> 1.23.1,27.1 -> 1.24, and so on.Outside that reinterpretation, this scheme follows
MOJANGas closely as possible.
-
-
Method Details
-
mapped
Creates a scheme backed only by the supplied explicit mapping table.The returned scheme normalizes values that are already in the requested family and uses the table only for cross-family conversions. If a conversion is not present in the table, the scheme throws an
IllegalArgumentExceptioninstead of guessing a fallback.- Parameters:
mappings- mapping table to use for exact drop/classic conversions- Returns:
- scheme backed by the supplied explicit mappings
-
toClassic
Converts the supplied parsed version into classic numbering.If the input is already classic, implementations return a normalized classic string. Otherwise, they translate the version according to the scheme's own mapping rules.
- Parameters:
version- parsed version to convert- Returns:
- classic representation of the supplied version
- Throws:
IllegalArgumentException- when the scheme cannot produce a reliable classic mapping
-
toClassic
Parses the supplied text and delegates totoClassic(MinecraftVersion).This is the convenient entry point when the caller does not need to keep a
MinecraftVersioninstance around.- Parameters:
version- textual version to convert- Returns:
- classic representation of the supplied version
- Throws:
IllegalArgumentException- when the text cannot be parsed or the scheme cannot map it
-
toDrop
Converts the supplied parsed version into drop numbering.If the input is already a drop version, implementations return a normalized drop string. Otherwise, they translate the version according to the scheme's own mapping rules.
- Parameters:
version- parsed version to convert- Returns:
- drop representation of the supplied version
- Throws:
IllegalArgumentException- when the scheme cannot produce a reliable drop mapping
-
toDrop
Parses the supplied text and delegates totoDrop(MinecraftVersion).This overload is useful when callers want the convenience of string input while still benefiting from the same validation and mapping rules as the object-based API.
- Parameters:
version- textual version to convert- Returns:
- drop representation of the supplied version
- Throws:
IllegalArgumentException- when the text cannot be parsed or the scheme cannot map it
-