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 ResourceLocationThe field for thecooldownGrouprecord component.private final intThe field for thedurationrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundCooldownPacket> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundCooldownPacket(ResourceLocation 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 pHandler) 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.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
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 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
-