Class ConnectionUtils
java.lang.Object
net.neoforged.neoforge.network.connection.ConnectionUtils
Utility class for storing and retrieving
Connection objects from ChannelHandlerContext objects.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectiongetConnection(io.netty.channel.ChannelHandlerContext connection) Gets theConnectionobject from theChannelHandlerContextobject.static voidremoveConnection(io.netty.channel.ChannelHandlerContext connection) Removes theConnectionobject from theChannelHandlerContextobject.static voidsetConnection(io.netty.channel.ChannelHandlerContext connection, Connection value) Sets theConnectionobject to theChannelHandlerContextobject.
-
Field Details
-
ATTRIBUTE_CONNECTION
-
-
Constructor Details
-
ConnectionUtils
private ConnectionUtils()
-
-
Method Details
-
getConnection
Gets theConnectionobject from theChannelHandlerContextobject.- Parameters:
connection- TheChannelHandlerContextobject.- Returns:
- The
Connectionobject.
-
setConnection
@Internal public static void setConnection(io.netty.channel.ChannelHandlerContext connection, Connection value) Sets theConnectionobject to theChannelHandlerContextobject.- Parameters:
connection- TheChannelHandlerContextobject.value- TheConnectionobject.
-
removeConnection
@Internal public static void removeConnection(io.netty.channel.ChannelHandlerContext connection) Removes theConnectionobject from theChannelHandlerContextobject.- Parameters:
connection- TheChannelHandlerContextobject.
-