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 NetworkDirection.Factory
private final LogicalSide
private final int
private static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<Class<? extends Packet>,
NetworkDirection> private static final NetworkDirection[]
-
Constructor Summary
ModifierConstructorDescriptionprivate
NetworkDirection
(LogicalSide logicalSide, Class<? extends Packet> clazz, int i, NetworkDirection.Factory factory) -
Method Summary
Modifier and TypeMethodDescription<T extends Packet<?>>
ICustomPacket<T>buildPacket
(FriendlyByteBuf data, ResourceLocation channelName) static <T extends ICustomPacket<?>>
NetworkDirectiondirectionFor
(Class<T> customPacket) private static ClientboundCustomQueryPacket
loginClientbound
(FriendlyByteBuf data, Integer index, ResourceLocation channelName) private static ServerboundCustomQueryAnswerPacket
loginServerbound
(FriendlyByteBuf data, Integer index, ResourceLocation channelName) private static ClientboundCustomPayloadPacket
playClientbound
(FriendlyByteBuf data, Integer index, ResourceLocation channelName) private static ServerboundCustomPayloadPacket
playServerbound
(FriendlyByteBuf data, Integer index, ResourceLocation channelName) 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
-
logicalSide
-
packetClass
-
otherWay
private final int otherWay -
factory
-
packetLookup
private static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<Class<? extends Packet>,NetworkDirection> packetLookup -
values
-
-
Constructor Details
-
NetworkDirection
private NetworkDirection(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
-
getOriginationSide
-
getReceptionSide
-
buildPacket
public <T extends Packet<?>> ICustomPacket<T> buildPacket(FriendlyByteBuf data, ResourceLocation channelName) -
playServerbound
private static ServerboundCustomPayloadPacket playServerbound(FriendlyByteBuf data, Integer index, ResourceLocation channelName) -
playClientbound
private static ClientboundCustomPayloadPacket playClientbound(FriendlyByteBuf data, Integer index, ResourceLocation channelName) -
loginServerbound
private static ServerboundCustomQueryAnswerPacket loginServerbound(FriendlyByteBuf data, Integer index, ResourceLocation channelName) -
loginClientbound
private static ClientboundCustomQueryPacket loginClientbound(FriendlyByteBuf data, Integer index, ResourceLocation channelName)
-