Package kr.toxicity.model.api.version
Record Class MinecraftVersion
java.lang.Object
java.lang.Record
kr.toxicity.model.api.version.MinecraftVersion
- Record Components:
major- titleminor- main updatepatch- minor update
- All Implemented Interfaces:
Comparable<MinecraftVersion>
public record MinecraftVersion(int major, int minor, int patch)
extends Record
implements Comparable<MinecraftVersion>
Minecraft version.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MinecraftVersion1.21static final MinecraftVersion1.21.1static final MinecraftVersion1.21.10static final MinecraftVersion1.21.11static final MinecraftVersion1.21.2static final MinecraftVersion1.21.4static final MinecraftVersion1.21.5static final MinecraftVersion1.21.6static final MinecraftVersion1.21.7static final MinecraftVersion1.21.8static final MinecraftVersion1.21.9 -
Constructor Summary
ConstructorsConstructorDescriptionMinecraftVersion(int major, int minor, int patch) Creates an instance of aMinecraftVersionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull MinecraftVersion o) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisGreaterOrEquals(@NotNull MinecraftVersion other) Checks this version is greater or equals than another.intmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.static @NotNull MinecraftVersionof(int major, int minor, int patch) Creates versionstatic @NotNull MinecraftVersionParses version from stringintpatch()Returns the value of thepatchrecord 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_11
1.21.11 -
V1_21_10
1.21.10 -
V1_21_9
1.21.9 -
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_2
1.21.2 -
V1_21_1
1.21.1 -
V1_21
1.21
-
-
Constructor Details
-
Method Details
-
parse
Parses version from string- Parameters:
version- version like "1.21.11"- Returns:
- parsed version
-
of
Creates version- Parameters:
major- majorminor- minorpatch- patch- Returns:
- Minecraft version
-
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 '=='. -
major
public int major()Returns the value of themajorrecord component.- Returns:
- the value of the
majorrecord component
-
minor
public int minor()Returns the value of theminorrecord component.- Returns:
- the value of the
minorrecord component
-
patch
public int patch()Returns the value of thepatchrecord component.- Returns:
- the value of the
patchrecord component
-