Interface PacketCallbacks


public interface PacketCallbacks
A set of callbacks for sending a packet.
Mappings:
Namespace Name
official sv
intermediary net/minecraft/class_7648
named net/minecraft/network/PacketCallbacks
  • Method Summary

    Modifier and Type
    Method
    Description
    always(Runnable runnable)
    Returns a callback that always runs runnable.
    default @Nullable Packet<?>
    Returns the packet to send on failure, or null if there is none.
    of(Supplier<Packet<?>> failurePacket)
    Returns a callback that sends failurePacket when failed.
    default void
    Called when packet is sent successfully.
  • Method Details

    • always

      static PacketCallbacks always(Runnable runnable)
      Returns a callback that always runs runnable.
      Returns:
      a callback that always runs runnable
      Mappings:
      Namespace Name Mixin selector
      official a Lsv;a(Ljava/lang/Runnable;)Lsv;
      intermediary method_45084 Lnet/minecraft/class_7648;method_45084(Ljava/lang/Runnable;)Lnet/minecraft/class_7648;
      named always Lnet/minecraft/network/PacketCallbacks;always(Ljava/lang/Runnable;)Lnet/minecraft/network/PacketCallbacks;
    • of

      static PacketCallbacks of(Supplier<Packet<?>> failurePacket)
      Returns a callback that sends failurePacket when failed.
      Returns:
      a callback that sends failurePacket when failed
      Mappings:
      Namespace Name Mixin selector
      official a Lsv;a(Ljava/util/function/Supplier;)Lsv;
      intermediary method_45085 Lnet/minecraft/class_7648;method_45085(Ljava/util/function/Supplier;)Lnet/minecraft/class_7648;
      named of Lnet/minecraft/network/PacketCallbacks;of(Ljava/util/function/Supplier;)Lnet/minecraft/network/PacketCallbacks;
    • onSuccess

      default void onSuccess()
      Called when packet is sent successfully.
      Mappings:
      Namespace Name Mixin selector
      official a Lsv;a()V
      intermediary method_45083 Lnet/minecraft/class_7648;method_45083()V
      named onSuccess Lnet/minecraft/network/PacketCallbacks;onSuccess()V
    • getFailurePacket

      @Nullable default @Nullable Packet<?> getFailurePacket()
      Returns the packet to send on failure, or null if there is none.
      Returns:
      the packet to send on failure, or null if there is none
      Mappings:
      Namespace Name Mixin selector
      official b Lsv;b()Lvd;
      intermediary method_45086 Lnet/minecraft/class_7648;method_45086()Lnet/minecraft/class_2596;
      named getFailurePacket Lnet/minecraft/network/PacketCallbacks;getFailurePacket()Lnet/minecraft/network/packet/Packet;