Class CustomPayloadEvent.Context

java.lang.Object
net.minecraftforge.event.network.CustomPayloadEvent.Context
Enclosing class:
CustomPayloadEvent

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

    • connection

      private final Connection connection
      The Connection for this message.
    • client

      private final boolean client
    • packetHandled

      private boolean packetHandled
  • Constructor Details

  • Method Details

    • isClientSide

      public boolean isClientSide()
    • isServerSide

      public boolean isServerSide()
    • getConnection

      public Connection getConnection()
    • 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 @Nullable ServerPlayer getSender()
      When available, gets the sender for packets that are sent from a client to the server.