Class MappingTable
The table is intentionally explicit instead of arithmetic. That keeps conversions exact
for release lines where Mojang skipped patch numbers or reused the same classic minor line
for several independent drops. Callers can populate their own table and pass it to
VersionScheme.mapped(MappingTable) when they want a custom exact scheme.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull MappingTablecopy()Creates a shallow copy of this table.@NotNull MappingTableregisterLine(int year, int release, @NotNull String... classicVersions) Registers a release line where one drop version maps to a sequence of classic versions.@NotNull MappingTableregisterMapping(@NotNull String classicVersion, @NotNull String dropVersion) Registers one exact classic/drop correspondence.
-
Constructor Details
-
MappingTable
public MappingTable()Creates an empty mapping table.
-
-
Method Details
-
registerLine
@NotNull public @NotNull MappingTable registerLine(int year, int release, @NotNull @NotNull String... classicVersions) Registers a release line where one drop version maps to a sequence of classic versions.The first classic version in the array becomes
year.release. Each following entry becomes a hotfix within the same drop line using contiguous hotfix numbering (year.release.1,year.release.2, and so on).- Parameters:
year- drop year segmentrelease- drop release segment inside the yearclassicVersions- classic versions belonging to that release line- Returns:
- this table for chaining
-
registerMapping
@NotNull public @NotNull MappingTable registerMapping(@NotNull @NotNull String classicVersion, @NotNull @NotNull String dropVersion) Registers one exact classic/drop correspondence.If the drop version was already associated with another classic version, the new classic version becomes the canonical reverse lookup returned by the built-in conversion schemes. Existing classic-to-drop aliases remain valid.
- Parameters:
classicVersion- classic version textdropVersion- drop version text- Returns:
- this table for chaining
-
copy
Creates a shallow copy of this table.- Returns:
- new table containing the same exact mappings
-