Record Class UseCooldown
java.lang.Object
java.lang.Record
net.minestom.server.item.component.UseCooldown
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BinaryTagSerializer
<UseCooldown> static final NetworkBuffer.Type
<UseCooldown> -
Constructor Summary
ConstructorDescriptionUseCooldown
(float seconds, @Nullable String cooldownGroup) Creates an instance of aUseCooldown
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable String
Returns the value of thecooldownGroup
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.float
seconds()
Returns the value of theseconds
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
NETWORK_TYPE
-
NBT_TYPE
-
-
Constructor Details
-
UseCooldown
Creates an instance of aUseCooldown
record class.- Parameters:
seconds
- the value for theseconds
record componentcooldownGroup
- the value for thecooldownGroup
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
seconds
public float seconds()Returns the value of theseconds
record component.- Returns:
- the value of the
seconds
record component
-
cooldownGroup
Returns the value of thecooldownGroup
record component.- Returns:
- the value of the
cooldownGroup
record component
-