Package net.minecraft

Record Class SaveVersion

java.lang.Object
java.lang.Record
net.minecraft.SaveVersion
Record Components:
id -
series -

public record SaveVersion(int id, String series) extends Record
The version components of Minecraft that is used for identification in save games.
Mappings:
Namespace Name
named net/minecraft/SaveVersion
intermediary net/minecraft/class_6595
official fck
named id
intermediary comp_4038
official b
named series
intermediary comp_4039
official c
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The field for the id record component.
    static final String
    The default series of a version, main, if a series is not specified.
    private final String
    The field for the series record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SaveVersion(int id, String series)
    Creates an instance of a SaveVersion record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    equals(Object object)
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    id()
    Returns the integer data version of this save version.
    boolean
    Returns whether this save version can be loaded by the other version.
    boolean
     
    Returns the series of this version.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • id

      private final int id
      The field for the id record component.
    • series

      private final String series
      The field for the series record component.
    • MAIN_SERIES

      public static final String MAIN_SERIES
      The default series of a version, main, if a series is not specified.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MAIN_SERIES Lnet/minecraft/SaveVersion;MAIN_SERIES:Ljava/lang/String;
      intermediary field_34768 Lnet/minecraft/class_6595;field_34768:Ljava/lang/String;
      official a Lfck;a:Ljava/lang/String;
  • Constructor Details

    • SaveVersion

      public SaveVersion(int id, String series)
      Creates an instance of a SaveVersion record class.
      Parameters:
      id - the value for the id record component
      series - the value for the series record component
  • Method Details

    • isNotMainSeries

      public boolean isNotMainSeries()
      Mappings:
      Namespace Name Mixin selector
      named isNotMainSeries Lnet/minecraft/SaveVersion;isNotMainSeries()Z
      intermediary method_38490 Lnet/minecraft/class_6595;method_38490()Z
      official a Lfck;a()Z
    • isAvailableTo

      public boolean isAvailableTo(SaveVersion other)
      Returns whether this save version can be loaded by the other version.
      Returns:
      whether this save version can be loaded by the other version
      Mappings:
      Namespace Name Mixin selector
      named isAvailableTo Lnet/minecraft/SaveVersion;isAvailableTo(Lnet/minecraft/SaveVersion;)Z
      intermediary method_38493 Lnet/minecraft/class_6595;method_38493(Lnet/minecraft/class_6595;)Z
      official a Lfck;a(Lfck;)Z
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • id

      public int id()
      Returns the integer data version of this save version.
      Returns:
      the integer data version of this save version
      Mappings:
      Namespace Name Mixin selector
      named id Lnet/minecraft/SaveVersion;id()I
      intermediary comp_4038 Lnet/minecraft/class_6595;comp_4038()I
      official b Lfck;b()I
    • series

      public String series()
      Returns the series of this version.

      This is stored in the Series field within level.dat.

      Known values include:

      • main for versions that are not experimental snapshots
      • ccpreview for the 1.18 Caves and Cliffs experimental snapshots
      • deep_dark_preview for 1.19 Deep Dark experimental snapshots
      Returns:
      the series of this version
      Mappings:
      Namespace Name Mixin selector
      named series Lnet/minecraft/SaveVersion;series()Ljava/lang/String;
      intermediary comp_4039 Lnet/minecraft/class_6595;comp_4039()Ljava/lang/String;
      official c Lfck;c()Ljava/lang/String;