Package net.minecraftforge.fml.network
Enum NetworkDirection
- java.lang.Object
-
- java.lang.Enum<NetworkDirection>
-
- net.minecraftforge.fml.network.NetworkDirection
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<NetworkDirection>
public enum NetworkDirection extends java.lang.Enum<NetworkDirection>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LOGIN_TO_CLIENT
LOGIN_TO_SERVER
PLAY_TO_CLIENT
PLAY_TO_SERVER
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.BiFunction<ICustomPacket<?>,java.util.function.Supplier<NetworkEvent.Context>,NetworkEvent>
eventSupplier
private LogicalSide
logicalSide
private int
otherWay
private java.lang.Class<? extends IPacket>
packetClass
private static it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<java.lang.Class<? extends IPacket>,NetworkDirection>
packetLookup
-
Constructor Summary
Constructors Modifier Constructor Description private
NetworkDirection(java.util.function.BiFunction<ICustomPacket<?>,java.util.function.Supplier<NetworkEvent.Context>,NetworkEvent> eventSupplier, LogicalSide logicalSide, java.lang.Class<? extends IPacket> clazz, int i)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends IPacket<?>>
ICustomPacket<T>buildPacket(org.apache.commons.lang3.tuple.Pair<PacketBuffer,java.lang.Integer> packetData, ResourceLocation channelName)
static <T extends ICustomPacket<?>>
NetworkDirectiondirectionFor(java.lang.Class<T> customPacket)
NetworkEvent
getEvent(ICustomPacket<?> buffer, java.util.function.Supplier<NetworkEvent.Context> manager)
LogicalSide
getOriginationSide()
private java.lang.Class<? extends IPacket>
getPacketClass()
LogicalSide
getReceptionSide()
NetworkDirection
reply()
static NetworkDirection
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static NetworkDirection[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PLAY_TO_SERVER
public static final NetworkDirection PLAY_TO_SERVER
-
PLAY_TO_CLIENT
public static final NetworkDirection PLAY_TO_CLIENT
-
LOGIN_TO_SERVER
public static final NetworkDirection LOGIN_TO_SERVER
-
LOGIN_TO_CLIENT
public static final NetworkDirection LOGIN_TO_CLIENT
-
-
Field Detail
-
eventSupplier
private final java.util.function.BiFunction<ICustomPacket<?>,java.util.function.Supplier<NetworkEvent.Context>,NetworkEvent> eventSupplier
-
logicalSide
private final LogicalSide logicalSide
-
packetClass
private final java.lang.Class<? extends IPacket> packetClass
-
otherWay
private final int otherWay
-
packetLookup
private static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<java.lang.Class<? extends IPacket>,NetworkDirection> packetLookup
-
-
Constructor Detail
-
NetworkDirection
private NetworkDirection(java.util.function.BiFunction<ICustomPacket<?>,java.util.function.Supplier<NetworkEvent.Context>,NetworkEvent> eventSupplier, LogicalSide logicalSide, java.lang.Class<? extends IPacket> clazz, int i)
-
-
Method Detail
-
values
public static NetworkDirection[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NetworkDirection c : NetworkDirection.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NetworkDirection valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getPacketClass
private java.lang.Class<? extends IPacket> getPacketClass()
-
directionFor
public static <T extends ICustomPacket<?>> NetworkDirection directionFor(java.lang.Class<T> customPacket)
-
reply
public NetworkDirection reply()
-
getEvent
public NetworkEvent getEvent(ICustomPacket<?> buffer, java.util.function.Supplier<NetworkEvent.Context> manager)
-
getOriginationSide
public LogicalSide getOriginationSide()
-
getReceptionSide
public LogicalSide getReceptionSide()
-
buildPacket
public <T extends IPacket<?>> ICustomPacket<T> buildPacket(org.apache.commons.lang3.tuple.Pair<PacketBuffer,java.lang.Integer> packetData, ResourceLocation channelName)
-
-