Package kr.toxicity.model.api.version
Record Class MinecraftVersion
java.lang.Object
java.lang.Record
kr.toxicity.model.api.version.MinecraftVersion
- Record Components:
first- titlesecond- main updatethird- minor update
- All Implemented Interfaces:
Comparable<MinecraftVersion>
public record MinecraftVersion(int first, int second, int third)
extends Record
implements Comparable<MinecraftVersion>
Minecraft version.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MinecraftVersion1.20.5static final MinecraftVersion1.20.6static final MinecraftVersion1.21static final MinecraftVersion1.21.1static final MinecraftVersion1.21.2static final MinecraftVersion1.21.3static final MinecraftVersion1.21.4static final MinecraftVersion1.21.5static final MinecraftVersion1.21.6static final MinecraftVersion1.21.7static final MinecraftVersion1.21.8 -
Constructor Summary
ConstructorsConstructorDescriptionMinecraftVersion(int first, int second, int third) Creates an instance of aMinecraftVersionrecord class.MinecraftVersion(@NotNull String version) Parses version from stringMinecraftVersion(@NotNull String[] version) Parses version from a string array -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull MinecraftVersion o) final booleanIndicates whether some other object is "equal to" this one.intfirst()Returns the value of thefirstrecord component.final inthashCode()Returns a hash code value for this object.booleanisGreaterOrEquals(@NotNull MinecraftVersion other) Checks this version is greater or equals than another.intsecond()Returns the value of thesecondrecord component.intthird()Returns the value of thethirdrecord component.@NotNull StringtoString()Returns a string representation of this record class.booleanChecks this version should be use item model namespace.booleanChecks this version should be use modern resource.
-
Field Details
-
V1_21_8
1.21.8 -
V1_21_7
1.21.7 -
V1_21_6
1.21.6 -
V1_21_5
1.21.5 -
V1_21_4
1.21.4 -
V1_21_3
1.21.3 -
V1_21_2
1.21.2 -
V1_21_1
1.21.1 -
V1_21
1.21 -
V1_20_6
1.20.6 -
V1_20_5
1.20.5
-
-
Constructor Details
-
MinecraftVersion
Parses version from string- Parameters:
version- version like "1.21.8"
-
MinecraftVersion
Parses version from a string array- Parameters:
version- version array like ["1", "21", "8"]
-
MinecraftVersion
public MinecraftVersion(int first, int second, int third) Creates an instance of aMinecraftVersionrecord class.
-
-
Method Details
-
isGreaterOrEquals
Checks this version is greater or equals than another.- Parameters:
other- other- Returns:
- greater or not
-
useModernResource
public boolean useModernResource()Checks this version should be use modern resource.- Returns:
- use modern resource
-
useItemModelName
public boolean useItemModelName()Checks this version should be use item model namespace.- Returns:
- use item model namespace.
-
compareTo
- Specified by:
compareToin interfaceComparable<MinecraftVersion>
-
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. All components in this record class are compared with '=='. -
first
public int first()Returns the value of thefirstrecord component.- Returns:
- the value of the
firstrecord component
-
second
public int second()Returns the value of thesecondrecord component.- Returns:
- the value of the
secondrecord component
-
third
public int third()Returns the value of thethirdrecord component.- Returns:
- the value of the
thirdrecord component
-