Package net.minecraft.world.item
Record Class ItemCooldowns.CooldownInstance
java.lang.Object
java.lang.Record
net.minecraft.world.item.ItemCooldowns.CooldownInstance
- Enclosing class:
ItemCooldowns
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCooldownInstance
(int startTime, int endTime) Creates an instance of aCooldownInstance
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
endTime()
Returns the value of theendTime
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thestartTime
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
startTime
private final int startTimeThe field for thestartTime
record component. -
endTime
private final int endTimeThe field for theendTime
record component.
-
-
Constructor Details
-
CooldownInstance
CooldownInstance(int startTime, int endTime) Creates an instance of aCooldownInstance
record class.- Parameters:
startTime
- the value for thestartTime
record componentendTime
- the value for theendTime
record component
-
-
Method Details
-
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 '=='. -
startTime
public int startTime()Returns the value of thestartTime
record component.- Returns:
- the value of the
startTime
record component
-
endTime
public int endTime()Returns the value of theendTime
record component.- Returns:
- the value of the
endTime
record component
-