Package net.minecraftforge.fml.network
Class NetworkEvent.Context
java.lang.Object
net.minecraftforge.fml.network.NetworkEvent.Context
- Enclosing class:
- NetworkEvent
Context for
NetworkEvent
-
Field Summary
Modifier and TypeFieldDescriptionprivate final NetworkDirection
TheNetworkDirection
this message has been received on.private final NetworkManager
TheNetworkManager
for this message.private final PacketDispatcher
The packet dispatcher for this event.private boolean
-
Constructor Summary
ConstructorDescriptionContext
(NetworkManager netHandler, NetworkDirection networkDirection, int index) Context
(NetworkManager 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
TheNetworkManager
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(NetworkManager netHandler, NetworkDirection networkDirection, int index) -
Context
Context(NetworkManager 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
-