Record Class ForcedCooldownPacket
java.lang.Object
java.lang.Record
net.frozenblock.lib.item.impl.network.ForcedCooldownPacket
- All Implemented Interfaces:
net.fabricmc.fabric.api.networking.v1.FabricPacket
public record ForcedCooldownPacket(net.minecraft.world.item.Item item, int startTime, int endTime)
extends Record
implements net.fabricmc.fabric.api.networking.v1.FabricPacket
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.fabricmc.fabric.api.networking.v1.PacketType<ForcedCooldownPacket> -
Constructor Summary
ConstructorsConstructorDescriptionForcedCooldownPacket(net.minecraft.network.FriendlyByteBuf buf) ForcedCooldownPacket(net.minecraft.world.item.Item item, int startTime, int endTime) Creates an instance of aForcedCooldownPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintendTime()Returns the value of theendTimerecord 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.intReturns the value of thestartTimerecord 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<ForcedCooldownPacket> PACKET_TYPE
-
-
Constructor Details
-
ForcedCooldownPacket
public ForcedCooldownPacket(net.minecraft.network.FriendlyByteBuf buf) -
ForcedCooldownPacket
public ForcedCooldownPacket(net.minecraft.world.item.Item item, int startTime, int endTime) Creates an instance of aForcedCooldownPacketrecord class.- Parameters:
item- the value for theitemrecord componentstartTime- the value for thestartTimerecord componentendTime- the value for theendTimerecord 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
-
startTime
public int startTime()Returns the value of thestartTimerecord component.- Returns:
- the value of the
startTimerecord component
-
endTime
public int endTime()Returns the value of theendTimerecord component.- Returns:
- the value of the
endTimerecord component
-