Package net.neoforged.neoforge.network
Enum Class LoginNetworkDirection
- All Implemented Interfaces:
Serializable
,Comparable<LoginNetworkDirection>
,Constable
,INetworkDirection<LoginNetworkDirection>
public enum LoginNetworkDirection
extends Enum<LoginNetworkDirection>
implements INetworkDirection<LoginNetworkDirection>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interface
LoginNetworkDirection.Factory<T extends Packet<?>>
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface net.neoforged.neoforge.network.INetworkDirection
INetworkDirection.PacketData
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BiFunction<ICustomQueryPayloadWithBuffer,
NetworkEvent.Context, NetworkEvent> private final LoginNetworkDirection.Factory<?>
private final net.neoforged.fml.LogicalSide
private final int
private static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<Class<? extends Packet<?>>,
LoginNetworkDirection> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
LoginNetworkDirection
(BiFunction<ICustomQueryPayloadWithBuffer, NetworkEvent.Context, NetworkEvent> eventSupplier, net.neoforged.fml.LogicalSide logicalSide, Class<? extends Packet<?>> clazz, int i, LoginNetworkDirection.Factory<?> factory) -
Method Summary
Modifier and TypeMethodDescriptionPacket<?>
buildPacket
(INetworkDirection.PacketData packetData, ResourceLocation channelName) static <T extends Packet<?>>
LoginNetworkDirectiondirectionForPayload
(Class<T> customPacket) getEvent
(ICustomQueryPayloadWithBuffer buffer, NetworkEvent.Context context) net.neoforged.fml.LogicalSide
net.neoforged.fml.LogicalSide
reply()
static LoginNetworkDirection
Returns the enum constant of this class with the specified name.static LoginNetworkDirection[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LOGIN_TO_SERVER
-
LOGIN_TO_CLIENT
-
-
Field Details
-
eventSupplier
private final BiFunction<ICustomQueryPayloadWithBuffer,NetworkEvent.Context, eventSupplierNetworkEvent> -
logicalSide
private final net.neoforged.fml.LogicalSide logicalSide -
packetClass
-
otherWay
private final int otherWay -
factory
-
PACKET_LOOKUP
private static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<Class<? extends Packet<?>>,LoginNetworkDirection> PACKET_LOOKUP
-
-
Constructor Details
-
LoginNetworkDirection
private LoginNetworkDirection(BiFunction<ICustomQueryPayloadWithBuffer, NetworkEvent.Context, NetworkEvent> eventSupplier, net.neoforged.fml.LogicalSide logicalSide, Class<? extends Packet<?>> clazz, int i, LoginNetworkDirection.Factory<?> factory)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getPacketClass
-
directionForPayload
public static <T extends Packet<?>> LoginNetworkDirection directionForPayload(Class<T> customPacket) -
reply
- Specified by:
reply
in interfaceINetworkDirection<LoginNetworkDirection>
-
getEvent
-
getOriginationSide
public net.neoforged.fml.LogicalSide getOriginationSide()- Specified by:
getOriginationSide
in interfaceINetworkDirection<LoginNetworkDirection>
-
getReceptionSide
public net.neoforged.fml.LogicalSide getReceptionSide()- Specified by:
getReceptionSide
in interfaceINetworkDirection<LoginNetworkDirection>
-
buildPacket
- Specified by:
buildPacket
in interfaceINetworkDirection<LoginNetworkDirection>
-