Class ChannelAttributes
java.lang.Object
net.neoforged.neoforge.network.registration.ChannelAttributes
Utilities for manipulation of Netty
Channel attributes-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.netty.util.AttributeKey<Set<ResourceLocation>> Known ad-hoc channels fromMinecraftRegisterPayload.static final io.netty.util.AttributeKey<Map<ConnectionProtocol, Set<ResourceLocation>>> Known common channels fromCommonRegisterPayload.static final io.netty.util.AttributeKey<ConnectionType> TheConnectionTypeof the current connectionstatic final io.netty.util.AttributeKey<NetworkPayloadSetup> Negotiated modded payload setup fromModdedNetworkQueryPayloadand/orModdedNetworkPayload. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ConnectionTypegetConnectionType(Connection connection) static Set<ResourceLocation> getOrCreateAdHocChannels(Connection connection) Returns a mutable set of the currently known ad-hoc channels.static Set<ResourceLocation> getOrCreateCommonChannels(Connection connection, ConnectionProtocol protocol) Returns a mutable set of the currently known common channels for the given protocol.static @Nullable NetworkPayloadSetupgetPayloadSetup(Connection connection) static voidsetConnectionType(Connection connection, ConnectionType type) static voidsetPayloadSetup(Connection connection, NetworkPayloadSetup setup)
-
Field Details
-
PAYLOAD_SETUP
Negotiated modded payload setup fromModdedNetworkQueryPayloadand/orModdedNetworkPayload. -
ADHOC_CHANNELS
Known ad-hoc channels fromMinecraftRegisterPayload. -
COMMON_CHANNELS
public static final io.netty.util.AttributeKey<Map<ConnectionProtocol,Set<ResourceLocation>>> COMMON_CHANNELSKnown common channels fromCommonRegisterPayload. -
CONNECTION_TYPE
TheConnectionTypeof the current connection
-
-
Constructor Details
-
ChannelAttributes
public ChannelAttributes()
-
-
Method Details
-
getPayloadSetup
-
setPayloadSetup
-
getConnectionType
-
setConnectionType
-
getOrCreateAdHocChannels
Returns a mutable set of the currently known ad-hoc channels. -
getOrCreateCommonChannels
public static Set<ResourceLocation> getOrCreateCommonChannels(Connection connection, ConnectionProtocol protocol) Returns a mutable set of the currently known common channels for the given protocol.
-