Class NetworkEvent.Context

java.lang.Object
net.minecraftforge.fml.network.NetworkEvent.Context
Enclosing class:
NetworkEvent

public static class NetworkEvent.Context extends Object
Context for NetworkEvent
  • Field Details

    • networkManager

      private final NetworkManager networkManager
      The NetworkManager for this message.
    • networkDirection

      private final NetworkDirection networkDirection
      The NetworkDirection this message has been received on.
    • packetDispatcher

      private final PacketDispatcher packetDispatcher
      The packet dispatcher for this event. Sends back to the origin.
    • packetHandled

      private boolean packetHandled
  • Constructor Details

  • Method Details

    • getDirection

      public NetworkDirection getDirection()
    • getPacketDispatcher

      public PacketDispatcher 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

      public CompletableFuture<Void> enqueueWork(Runnable runnable)
    • getSender

      @Nullable public ServerPlayerEntity getSender()
      When available, gets the sender for packets that are sent from a client to the server.
    • getNetworkManager

      public NetworkManager getNetworkManager()