Record Class ClientboundCooldownPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundCooldownPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundCooldownPacket(Identifier cooldownGroup, int duration)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IdentifierThe field for thecooldownGrouprecord component.private final intThe field for thedurationrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundCooldownPacket> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundCooldownPacket(Identifier cooldownGroup, int duration) Creates an instance of aClientboundCooldownPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecooldownGrouprecord component.intduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientGamePacketListener listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
cooldownGroup
The field for thecooldownGrouprecord component. -
duration
private final int durationThe field for thedurationrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundCooldownPacket
Creates an instance of aClientboundCooldownPacketrecord class.- Parameters:
cooldownGroup- the value for thecooldownGrouprecord componentduration- the value for thedurationrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ClientGamePacketListener>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
cooldownGroup
Returns the value of thecooldownGrouprecord component.- Returns:
- the value of the
cooldownGrouprecord component
-
duration
public int duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-