Record Class AbstractPacket.Definition<T extends AbstractPacket<T>>
java.lang.Object
java.lang.Record
de.luckymcdev.foundryengine.common.network.AbstractPacket.Definition<T>
- Enclosing interface:
AbstractPacket<T extends AbstractPacket<T>>
public static record AbstractPacket.Definition<T extends AbstractPacket<T>>(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends AbstractPacket<T>> type, PacketBounds bounds, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T extends AbstractPacket<T>> codec, @Nullable BiConsumer<T extends AbstractPacket<T>, net.neoforged.neoforge.network.handling.IPayloadContext> clientHandler, @Nullable BiConsumer<T extends AbstractPacket<T>, net.neoforged.neoforge.network.handling.IPayloadContext> serverHandler)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionDefinition(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, PacketBounds bounds, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> codec, @Nullable BiConsumer<T, net.neoforged.neoforge.network.handling.IPayloadContext> clientHandler, @Nullable BiConsumer<T, net.neoforged.neoforge.network.handling.IPayloadContext> serverHandler) Creates an instance of aDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbounds()Returns the value of theboundsrecord component.@Nullable BiConsumer<T, net.neoforged.neoforge.network.handling.IPayloadContext> Returns the value of theclientHandlerrecord component.net.minecraft.network.codec.StreamCodec<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.@Nullable BiConsumer<T, net.neoforged.neoforge.network.handling.IPayloadContext> Returns the value of theserverHandlerrecord 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
-
Definition
public Definition(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, PacketBounds bounds, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> codec, @Nullable BiConsumer<T, net.neoforged.neoforge.network.handling.IPayloadContext> clientHandler, @Nullable BiConsumer<T, net.neoforged.neoforge.network.handling.IPayloadContext> serverHandler) Creates an instance of aDefinitionrecord class.- Parameters:
type- the value for thetyperecord componentbounds- the value for theboundsrecord componentcodec- the value for thecodecrecord componentclientHandler- the value for theclientHandlerrecord componentserverHandler- the value for theserverHandlerrecord component
-
-
Method Details
-
toString
-
hashCode
-
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
-
bounds
Returns the value of theboundsrecord component.- Returns:
- the value of the
boundsrecord component
-
codec
public net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> codec()Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-
clientHandler
public @Nullable BiConsumer<T, net.neoforged.neoforge.network.handling.IPayloadContext> clientHandler()Returns the value of theclientHandlerrecord component.- Returns:
- the value of the
clientHandlerrecord component
-
serverHandler
public @Nullable BiConsumer<T, net.neoforged.neoforge.network.handling.IPayloadContext> serverHandler()Returns the value of theserverHandlerrecord component.- Returns:
- the value of the
serverHandlerrecord component
-