Package net.minecraftforge.network
Record Class NetworkDirection<B extends FriendlyByteBuf>
java.lang.Object
java.lang.Record
net.minecraftforge.network.NetworkDirection<B>
public record NetworkDirection<B extends FriendlyByteBuf>(NetworkProtocol<B extends FriendlyByteBuf> protocol, PacketFlow direction)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NetworkDirection<FriendlyByteBuf> static final NetworkDirection<FriendlyByteBuf> private final PacketFlowThe field for thedirectionrecord component.static final NetworkDirection<FriendlyByteBuf> static final NetworkDirection<FriendlyByteBuf> static final NetworkDirection<RegistryFriendlyByteBuf> static final NetworkDirection<RegistryFriendlyByteBuf> private final NetworkProtocol<B> The field for theprotocolrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionNetworkDirection(NetworkProtocol<B> protocol, PacketFlow direction) Creates an instance of aNetworkDirectionrecord class. -
Method Summary
Modifier and TypeMethodDescription<T extends PacketListener,MSG>
Packet<T> buildPacket(Channel<MSG> channel, MSG packet) Returns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.protocol()Returns the value of theprotocolrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
protocol
The field for theprotocolrecord component. -
direction
The field for thedirectionrecord component. -
PLAY_TO_CLIENT
-
PLAY_TO_SERVER
-
LOGIN_TO_CLIENT
-
LOGIN_TO_SERVER
-
CONFIGURATION_TO_CLIENT
-
CONFIGURATION_TO_SERVER
-
-
Constructor Details
-
NetworkDirection
Creates an instance of aNetworkDirectionrecord class.- Parameters:
protocol- the value for theprotocolrecord componentdirection- the value for thedirectionrecord component
-
-
Method Details
-
buildPacket
-
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). -
protocol
Returns the value of theprotocolrecord component.- Returns:
- the value of the
protocolrecord component
-
direction
Returns the value of thedirectionrecord component.- Returns:
- the value of the
directionrecord component
-