Record Class ClientboundCooldownPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundCooldownPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundCooldownPacket(Item item, int duration)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
The field for theduration
record component.private final Item
The field for theitem
record component.static final StreamCodec
<RegistryFriendlyByteBuf, ClientboundCooldownPacket> -
Constructor Summary
ConstructorDescriptionClientboundCooldownPacket
(Item item, int duration) Creates an instance of aClientboundCooldownPacket
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
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.item()
Returns the value of theitem
record component.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
-
item
The field for theitem
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:
item
- the value for theitem
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 '=='. -
item
Returns the value of theitem
record component.- Returns:
- the value of the
item
record component
-
duration
public int duration()Returns the value of theduration
record component.- Returns:
- the value of the
duration
record component
-