Interface PacketInjector

All Known Implementing Classes:
AbstractPacketInjector

public interface PacketInjector
Represents an incoming packet injector.
Author:
Kristian
  • Method Details

    • isCancelled

      boolean isCancelled(Object packet)
      Determine if a packet is cancelled or not.
      Parameters:
      packet - - the packet to check.
      Returns:
      TRUE if it is, FALSE otherwise.
    • setCancelled

      void setCancelled(Object packet, boolean cancelled)
      Set whether or not a packet is cancelled.
      Parameters:
      packet - - the packet to set.
      cancelled - - TRUE to cancel the packet, FALSE otherwise.
    • addPacketHandler

      boolean addPacketHandler(PacketType type, Set<ListenerOptions> options)
      Start intercepting packets with the given packet type.
      Parameters:
      type - - the type of the packets to start intercepting.
      options - - any listener options.
      Returns:
      TRUE if we didn't already intercept these packets, FALSE otherwise.
    • removePacketHandler

      boolean removePacketHandler(PacketType type)
      Stop intercepting packets with the given packet type.
      Parameters:
      type - - the type of the packets to stop intercepting.
      Returns:
      TRUE if we successfuly stopped intercepting a given packet ID, FALSE otherwise.
    • hasPacketHandler

      boolean hasPacketHandler(PacketType type)
      Determine if packets with the given packet type is being intercepted.
      Parameters:
      type - - the packet type to lookup.
      Returns:
      TRUE if we do, FALSE otherwise.
    • inputBuffersChanged

      void inputBuffersChanged(Set<PacketType> set)
      Invoked when input buffers have changed.
      Parameters:
      set - - the new set of packets that require the read buffer.
    • getPacketHandlers

      Set<PacketType> getPacketHandlers()
      Retrieve every intercepted packet type.
      Returns:
      Every intercepted packet type.
    • packetRecieved

      PacketEvent packetRecieved(PacketContainer packet, org.bukkit.entity.Player client, byte[] buffered)
      Let the packet listeners process the given packet.
      Parameters:
      packet - - a packet to process.
      client - - the client that sent the packet.
      buffered - - a buffer containing the data that had to be read in order to construct the packet.
      Returns:
      The resulting packet event.
    • cleanupAll

      void cleanupAll()
      Perform any necessary cleanup before unloading ProtocolLib.