Class NetworkEvent.Context

  • Enclosing class:
    NetworkEvent

    public static class NetworkEvent.Context
    extends java.lang.Object
    Context for NetworkEvent
    • Field Detail

      • packetDispatcher

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

        private boolean packetHandled
    • Method Detail

      • 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 java.util.concurrent.CompletableFuture<java.lang.Void> enqueueWork​(java.lang.Runnable runnable)
      • getSender

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