public static class NetworkEvent.Context
extends java.lang.Object
NetworkEvent
Modifier and Type | Field and Description |
---|---|
private NetworkDirection |
networkDirection
The
NetworkDirection this message has been received on. |
private NetworkManager |
networkManager
The
NetworkManager for this message. |
private PacketDispatcher |
packetDispatcher
The packet dispatcher for this event.
|
private boolean |
packetHandled |
Constructor and Description |
---|
Context(NetworkManager netHandler,
NetworkDirection networkDirection,
int index) |
Context(NetworkManager networkManager,
NetworkDirection networkDirection,
PacketDispatcher dispatcher) |
Modifier and Type | Method and Description |
---|---|
<T> io.netty.util.Attribute<T> |
attr(io.netty.util.AttributeKey<T> key) |
java.util.concurrent.CompletableFuture<java.lang.Void> |
enqueueWork(java.lang.Runnable runnable) |
NetworkDirection |
getDirection() |
NetworkManager |
getNetworkManager() |
PacketDispatcher |
getPacketDispatcher() |
boolean |
getPacketHandled() |
ServerPlayerEntity |
getSender()
When available, gets the sender for packets that are sent from a client to the server.
|
void |
setPacketHandled(boolean packetHandled) |
private final NetworkManager networkManager
NetworkManager
for this message.private final NetworkDirection networkDirection
NetworkDirection
this message has been received on.private final PacketDispatcher packetDispatcher
private boolean packetHandled
Context(NetworkManager netHandler, NetworkDirection networkDirection, int index)
Context(NetworkManager networkManager, NetworkDirection networkDirection, PacketDispatcher dispatcher)
public NetworkDirection getDirection()
public PacketDispatcher getPacketDispatcher()
public <T> io.netty.util.Attribute<T> attr(io.netty.util.AttributeKey<T> key)
public void setPacketHandled(boolean packetHandled)
public boolean getPacketHandled()
public java.util.concurrent.CompletableFuture<java.lang.Void> enqueueWork(java.lang.Runnable runnable)
@Nullable public ServerPlayerEntity getSender()
public NetworkManager getNetworkManager()