Package net.minecraftforge.network
Enum Class NetworkDirection
- All Implemented Interfaces:
Serializable,Comparable<NetworkDirection>,Constable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceNetworkDirection.Factory<T extends Packet<?>>Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NetworkDirection.Factoryprivate final LogicalSideprivate final intprivate static final it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<Class<? extends Packet>,NetworkDirection> private static final NetworkDirection[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNetworkDirection(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 ClientboundCustomQueryPacketloginClientbound(FriendlyByteBuf data, Integer index, ResourceLocation channelName) private static ServerboundCustomQueryAnswerPacketloginServerbound(FriendlyByteBuf data, Integer index, ResourceLocation channelName) private static ClientboundCustomPayloadPacketplayClientbound(FriendlyByteBuf data, Integer index, ResourceLocation channelName) private static ServerboundCustomPayloadPacketplayServerbound(FriendlyByteBuf data, Integer index, ResourceLocation channelName) reply()static NetworkDirectionReturns 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)
-