Package net.minecraftforge.fml.network
Enum Class NetworkDirection
- All Implemented Interfaces:
Serializable
,Comparable<NetworkDirection>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BiFunction<ICustomPacket<?>,
Supplier<NetworkEvent.Context>, NetworkEvent> private final LogicalSide
private final int
private static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<Class<? extends IPacket>,
NetworkDirection> -
Constructor Summary
ModifierConstructorDescriptionprivate
NetworkDirection
(BiFunction<ICustomPacket<?>, Supplier<NetworkEvent.Context>, NetworkEvent> eventSupplier, LogicalSide logicalSide, Class<? extends IPacket> clazz, int i) -
Method Summary
Modifier and TypeMethodDescription<T extends IPacket<?>>
ICustomPacket<T>buildPacket
(org.apache.commons.lang3.tuple.Pair<PacketBuffer, Integer> packetData, ResourceLocation channelName) static <T extends ICustomPacket<?>>
NetworkDirectiondirectionFor
(Class<T> customPacket) getEvent
(ICustomPacket<?> buffer, Supplier<NetworkEvent.Context> manager) reply()
static NetworkDirection
Returns the enum constant of this class with the specified name.static NetworkDirection[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PLAY_TO_SERVER
-
PLAY_TO_CLIENT
-
LOGIN_TO_SERVER
-
LOGIN_TO_CLIENT
-
-
Field Details
-
eventSupplier
private final BiFunction<ICustomPacket<?>,Supplier<NetworkEvent.Context>, eventSupplierNetworkEvent> -
logicalSide
-
packetClass
-
otherWay
private final int otherWay -
packetLookup
private static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<Class<? extends IPacket>,NetworkDirection> packetLookup
-
-
Constructor Details
-
NetworkDirection
private NetworkDirection(BiFunction<ICustomPacket<?>, Supplier<NetworkEvent.Context>, NetworkEvent> eventSupplier, LogicalSide logicalSide, Class<? extends IPacket> clazz, int i)
-
-
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
-
directionFor
-
reply
-
getEvent
-
getOriginationSide
-
getReceptionSide
-
buildPacket
public <T extends IPacket<?>> ICustomPacket<T> buildPacket(org.apache.commons.lang3.tuple.Pair<PacketBuffer, Integer> packetData, ResourceLocation channelName)
-