Class AbstractPacketInjector

java.lang.Object
com.comphenix.protocol.injector.netty.AbstractPacketInjector
All Implemented Interfaces:
PacketInjector

public abstract class AbstractPacketInjector extends Object implements PacketInjector
  • Constructor Details

    • AbstractPacketInjector

      public AbstractPacketInjector(PacketTypeSet reveivedFilters)
  • Method Details

    • isCancelled

      public boolean isCancelled(Object packet)
      Description copied from interface: PacketInjector
      Determine if a packet is cancelled or not.
      Specified by:
      isCancelled in interface PacketInjector
      Parameters:
      packet - - the packet to check.
      Returns:
      TRUE if it is, FALSE otherwise.
    • setCancelled

      public void setCancelled(Object packet, boolean cancelled)
      Description copied from interface: PacketInjector
      Set whether or not a packet is cancelled.
      Specified by:
      setCancelled in interface PacketInjector
      Parameters:
      packet - - the packet to set.
      cancelled - - TRUE to cancel the packet, FALSE otherwise.
    • addPacketHandler

      public boolean addPacketHandler(PacketType type, Set<ListenerOptions> options)
      Description copied from interface: PacketInjector
      Start intercepting packets with the given packet type.
      Specified by:
      addPacketHandler in interface PacketInjector
      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

      public boolean removePacketHandler(PacketType type)
      Description copied from interface: PacketInjector
      Stop intercepting packets with the given packet type.
      Specified by:
      removePacketHandler in interface PacketInjector
      Parameters:
      type - - the type of the packets to stop intercepting.
      Returns:
      TRUE if we successfuly stopped intercepting a given packet ID, FALSE otherwise.
    • hasPacketHandler

      public boolean hasPacketHandler(PacketType type)
      Description copied from interface: PacketInjector
      Determine if packets with the given packet type is being intercepted.
      Specified by:
      hasPacketHandler in interface PacketInjector
      Parameters:
      type - - the packet type to lookup.
      Returns:
      TRUE if we do, FALSE otherwise.
    • getPacketHandlers

      public Set<PacketType> getPacketHandlers()
      Description copied from interface: PacketInjector
      Retrieve every intercepted packet type.
      Specified by:
      getPacketHandlers in interface PacketInjector
      Returns:
      Every intercepted packet type.
    • cleanupAll

      public void cleanupAll()
      Description copied from interface: PacketInjector
      Perform any necessary cleanup before unloading ProtocolLib.
      Specified by:
      cleanupAll in interface PacketInjector