Record Class CooldownChangePacket
java.lang.Object
java.lang.Record
net.frozenblock.lib.item.impl.network.CooldownChangePacket
- All Implemented Interfaces:
net.fabricmc.fabric.api.networking.v1.FabricPacket
public record CooldownChangePacket(net.minecraft.world.item.Item item, int additional)
extends Record
implements net.fabricmc.fabric.api.networking.v1.FabricPacket
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.fabricmc.fabric.api.networking.v1.PacketType<CooldownChangePacket> -
Constructor Summary
ConstructorsConstructorDescriptionCooldownChangePacket(net.minecraft.network.FriendlyByteBuf buf) CooldownChangePacket(net.minecraft.world.item.Item item, int additional) Creates an instance of aCooldownChangePacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theadditionalrecord component.final booleanIndicates whether some other object is "equal to" this one.net.fabricmc.fabric.api.networking.v1.PacketType<?> getType()final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.Itemitem()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(net.minecraft.network.FriendlyByteBuf buf)
-
Field Details
-
PACKET_TYPE
public static final net.fabricmc.fabric.api.networking.v1.PacketType<CooldownChangePacket> PACKET_TYPE
-
-
Constructor Details
-
CooldownChangePacket
public CooldownChangePacket(net.minecraft.network.FriendlyByteBuf buf) -
CooldownChangePacket
public CooldownChangePacket(net.minecraft.world.item.Item item, int additional) Creates an instance of aCooldownChangePacketrecord class.- Parameters:
item- the value for theitemrecord componentadditional- the value for theadditionalrecord component
-
-
Method Details
-
write
public void write(net.minecraft.network.FriendlyByteBuf buf) - Specified by:
writein interfacenet.fabricmc.fabric.api.networking.v1.FabricPacket
-
getType
public net.fabricmc.fabric.api.networking.v1.PacketType<?> getType()- Specified by:
getTypein interfacenet.fabricmc.fabric.api.networking.v1.FabricPacket
-
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
public net.minecraft.world.item.Item item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
additional
public int additional()Returns the value of theadditionalrecord component.- Returns:
- the value of the
additionalrecord component
-