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> TheConnectionType
of the current connectionstatic final io.netty.util.AttributeKey
<NetworkPayloadSetup> Negotiated modded payload setup fromModdedNetworkQueryPayload
and/orModdedNetworkPayload
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ConnectionType
getConnectionType
(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 NetworkPayloadSetup
getPayloadSetup
(Connection connection) static void
setConnectionType
(Connection connection, ConnectionType type) static void
setPayloadSetup
(Connection connection, NetworkPayloadSetup setup)
-
Field Details
-
PAYLOAD_SETUP
Negotiated modded payload setup fromModdedNetworkQueryPayload
and/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
TheConnectionType
of 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.
-