Class MappingTable

java.lang.Object
me.croabeast.vnc.MappingTable

public final class MappingTable extends Object
Mutable table of exact classic/drop correspondences.

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 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 segment
      release - drop release segment inside the year
      classicVersions - 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 text
      dropVersion - drop version text
      Returns:
      this table for chaining
    • copy

      @NotNull public @NotNull MappingTable copy()
      Creates a shallow copy of this table.
      Returns:
      new table containing the same exact mappings