Record Class DataVersion
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.DataVersion
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDataVersion(int version, String series) Creates an instance of aDataVersionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisCompatible(DataVersion pDataVersion) booleanseries()Returns the value of theseriesrecord component.final StringtoString()Returns a string representation of this record class.intversion()Returns the value of theversionrecord component.
-
Field Details
-
version
private final int versionThe field for theversionrecord component. -
series
The field for theseriesrecord component. -
MAIN_SERIES
- See Also:
-
-
Constructor Details
-
DataVersion
Creates an instance of aDataVersionrecord class.- Parameters:
version- the value for theversionrecord componentseries- the value for theseriesrecord component
-
-
Method Details
-
isSideSeries
public boolean isSideSeries() -
isCompatible
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
version
public int version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
series
Returns the value of theseriesrecord component.- Returns:
- the value of the
seriesrecord component
-