Package net.thewinnt.cutscenes.platform
Record Class PacketType<T extends AbstractPacket>
java.lang.Object
java.lang.Record
net.thewinnt.cutscenes.platform.PacketType<T>
public record PacketType<T extends AbstractPacket>(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends AbstractPacket> type, AbstractPacket.PacketReader<T extends AbstractPacket> reader, Consumer<T extends AbstractPacket> handler)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPacketType(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, AbstractPacket.PacketReader<T> reader, Consumer<T> handler) Creates an instance of aPacketTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf, T> codec()final booleanIndicates whether some other object is "equal to" this one.handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.reader()Returns the value of thereaderrecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type()Returns the value of thetyperecord component.
-
Constructor Details
-
PacketType
public PacketType(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, AbstractPacket.PacketReader<T> reader, Consumer<T> handler) Creates an instance of aPacketTyperecord class.- Parameters:
type- the value for thetyperecord componentreader- the value for thereaderrecord componenthandler- the value for thehandlerrecord component
-
-
Method Details
-
codec
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
reader
Returns the value of thereaderrecord component.- Returns:
- the value of the
readerrecord component
-
handler
Returns the value of thehandlerrecord component.- Returns:
- the value of the
handlerrecord component
-