Package net.minecraftforge.network
Enum Class NetworkDirection
- All Implemented Interfaces:
Serializable
,Comparable<NetworkDirection>
,Constable
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static interface
NetworkDirection.Factory<T extends Packet<?>>
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 NetworkDirection.Factory
private final LogicalSide
private final int
private static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<Class<? extends Packet>,
NetworkDirection> -
Constructor Summary
ModifierConstructorDescriptionprivate
NetworkDirection
(BiFunction<ICustomPacket<?>, Supplier<NetworkEvent.Context>, NetworkEvent> eventSupplier, LogicalSide logicalSide, Class<? extends Packet> clazz, int i, NetworkDirection.Factory factory) -
Method Summary
Modifier and TypeMethodDescription<T extends Packet<?>>
ICustomPacket<T>buildPacket
(org.apache.commons.lang3.tuple.Pair<FriendlyByteBuf, 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 -
factory
-
packetLookup
private static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<Class<? extends Packet>,NetworkDirection> packetLookup
-
-
Constructor Details
-
NetworkDirection
private NetworkDirection(BiFunction<ICustomPacket<?>, Supplier<NetworkEvent.Context>, NetworkEvent> eventSupplier, LogicalSide logicalSide, Class<? extends Packet> clazz, int i, NetworkDirection.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
-
directionFor
-
reply
-
getEvent
-
getOriginationSide
-
getReceptionSide
-
buildPacket
public <T extends Packet<?>> ICustomPacket<T> buildPacket(org.apache.commons.lang3.tuple.Pair<FriendlyByteBuf, Integer> packetData, ResourceLocation channelName)
-