Record Class ClientboundCooldownPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundCooldownPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundCooldownPacket(ResourceLocation cooldownGroup, int duration)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResourceLocation
The field for thecooldownGroup
record component.private final int
The field for theduration
record component.static final StreamCodec
<RegistryFriendlyByteBuf, ClientboundCooldownPacket> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundCooldownPacket
(ResourceLocation cooldownGroup, int duration) Creates an instance of aClientboundCooldownPacket
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecooldownGroup
record component.int
duration()
Returns the value of theduration
record component.final boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientGamePacketListener p_132007_) final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.type()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
cooldownGroup
The field for thecooldownGroup
record component. -
duration
private final int durationThe field for theduration
record component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundCooldownPacket
Creates an instance of aClientboundCooldownPacket
record class.- Parameters:
cooldownGroup
- the value for thecooldownGroup
record componentduration
- the value for theduration
record component
-
-
Method Details
-
type
- Specified by:
type
in interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ClientGamePacketListener>
-
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 '=='. -
cooldownGroup
Returns the value of thecooldownGroup
record component.- Returns:
- the value of the
cooldownGroup
record component
-
duration
public int duration()Returns the value of theduration
record component.- Returns:
- the value of the
duration
record component
-