Class ProtocolPacketEvent

java.lang.Object
com.github.retrooper.packetevents.event.PacketEvent
com.github.retrooper.packetevents.event.ProtocolPacketEvent
All Implemented Interfaces:
CallableEvent, CancellableEvent, PlayerEvent, UserEvent
Direct Known Subclasses:
PacketReceiveEvent, PacketSendEvent

public abstract class ProtocolPacketEvent extends PacketEvent implements PlayerEvent, CancellableEvent, UserEvent
  • Constructor Details

  • Method Details

    • markForReEncode

      public void markForReEncode(boolean needsReEncode)
    • needsReEncode

      public boolean needsReEncode()
    • isClone

      public boolean isClone()
    • getChannel

      public Object getChannel()
    • getAddress

      public SocketAddress getAddress()
    • getSocketAddress

      public InetSocketAddress getSocketAddress()
      WARNING: This doesn't support local addresses or unix sockets.
    • getUser

      public User getUser()
      Specified by:
      getUser in interface UserEvent
    • getPlayer

      public <T> T getPlayer()
      Description copied from interface: PlayerEvent
      Associated player.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      Player.
    • getConnectionState

      public ConnectionState getConnectionState()
    • getClientVersion

      @Deprecated public ClientVersion getClientVersion()
      Deprecated.
    • setClientVersion

      @Deprecated public void setClientVersion(@NotNull @NotNull ClientVersion clientVersion)
      Deprecated.
    • getServerVersion

      public ServerVersion getServerVersion()
    • setServerVersion

      public void setServerVersion(@NotNull @NotNull ServerVersion serverVersion)
    • getByteBuf

      public Object getByteBuf()
    • setByteBuf

      public void setByteBuf(Object byteBuf)
    • getPacketId

      public int getPacketId()
    • getPacketType

      public PacketTypeCommon getPacketType()
    • getPacketName

      @Deprecated public String getPacketName()
      Deprecated.
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: CancellableEvent
      This method returns if the event will be cancelled.
      Specified by:
      isCancelled in interface CancellableEvent
      Returns:
      Will the event be cancelled.
    • setCancelled

      public void setCancelled(boolean val)
      Description copied from interface: CancellableEvent
      Cancel or proceed with the event.
      Specified by:
      setCancelled in interface CancellableEvent
      Parameters:
      val - Is the event cancelled
    • getLastUsedWrapper

      @Nullable public @Nullable PacketWrapper<?> getLastUsedWrapper()
    • setLastUsedWrapper

      public void setLastUsedWrapper(@Nullable @Nullable PacketWrapper<?> lastUsedWrapper)
    • getPostTasks

      public List<Runnable> getPostTasks()
    • hasPostTasks

      public boolean hasPostTasks()
    • clone

      public ProtocolPacketEvent clone()
      Overrides:
      clone in class Object
    • cleanUp

      public void cleanUp()
    • getFullBufferClone

      public Object getFullBufferClone()