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.21.10static final MinecraftVersion1.21.11static final MinecraftVersion1.21.4static final MinecraftVersion1.21.5static final MinecraftVersion1.21.6static final MinecraftVersion1.21.7static final MinecraftVersion1.21.8static final MinecraftVersion1.21.9static final MinecraftVersion26.1static final MinecraftVersion26.1.1static final MinecraftVersion26.1.2 -
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.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.
-
Field Details
-
V26_1_2
26.1.2 -
V26_1_1
26.1.1 -
V26_1
26.1 -
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
-
-
Constructor Details
-
MinecraftVersion
-
-
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
-
compareTo
- Specified by:
compareToin interfaceComparable<MinecraftVersion>
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
major
-
minor
-
patch
-