Class NetworkEvent.Context
java.lang.Object
net.minecraftforge.fmllegacy.network.NetworkEvent.Context
- Enclosing class:
- NetworkEvent
Context for
NetworkEvent
-
Field Summary
Modifier and TypeFieldDescriptionprivate NetworkDirection
TheNetworkDirection
this message has been received on.private Connection
TheConnection
for this message.private PacketDispatcher
The packet dispatcher for this event.private boolean
-
Constructor Summary
ConstructorDescriptionContext(Connection netHandler, NetworkDirection networkDirection, int index)
Context(Connection networkManager, NetworkDirection networkDirection, PacketDispatcher dispatcher)
-
Method Summary
Modifier and TypeMethodDescription<T> io.netty.util.Attribute<T>
attr(io.netty.util.AttributeKey<T> key)
enqueueWork(Runnable runnable)
boolean
When available, gets the sender for packets that are sent from a client to the server.void
setPacketHandled(boolean packetHandled)
-
Field Details
-
networkManager
TheConnection
for this message. -
networkDirection
TheNetworkDirection
this message has been received on. -
packetDispatcher
The packet dispatcher for this event. Sends back to the origin. -
packetHandled
private boolean packetHandled
-
-
Constructor Details
-
Context
Context(Connection netHandler, NetworkDirection networkDirection, int index) -
Context
Context(Connection networkManager, NetworkDirection networkDirection, PacketDispatcher dispatcher)
-
-
Method Details
-
getDirection
-
getPacketDispatcher
-
attr
public <T> io.netty.util.Attribute<T> attr(io.netty.util.AttributeKey<T> key) -
setPacketHandled
public void setPacketHandled(boolean packetHandled) -
getPacketHandled
public boolean getPacketHandled() -
enqueueWork
-
getSender
When available, gets the sender for packets that are sent from a client to the server. -
getNetworkManager
-