Package net.createmod.catnip.net.base
Record Class CatnipPacketRegistry.PacketType<T extends BasePacketPayload>
java.lang.Object
java.lang.Record
net.createmod.catnip.net.base.CatnipPacketRegistry.PacketType<T>
- Enclosing class:
CatnipPacketRegistry
public static record CatnipPacketRegistry.PacketType<T extends BasePacketPayload>(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends BasePacketPayload> type, Class<T extends BasePacketPayload> clazz, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T extends BasePacketPayload> codec)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPacketType(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, Class<T> clazz, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> codec) Creates an instance of aPacketTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionclazz()Returns the value of theclazzrecord component.net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> codec()Returns the value of thecodecrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.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, Class<T> clazz, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> codec) Creates an instance of aPacketTyperecord class.- Parameters:
type- the value for thetyperecord componentclazz- the value for theclazzrecord componentcodec- the value for thecodecrecord component
-
-
Method Details
-
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
-
clazz
Returns the value of theclazzrecord component.- Returns:
- the value of the
clazzrecord component
-
codec
public net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec()Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-