Class NetworkManagerInjector

java.lang.Object
com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector
All Implemented Interfaces:
ChannelListener

public class NetworkManagerInjector extends Object implements ChannelListener
  • Constructor Details

    • NetworkManagerInjector

      public NetworkManagerInjector(org.bukkit.plugin.Plugin plugin, org.bukkit.Server server, ListenerInvoker listenerInvoker, ErrorReporter reporter)
  • Method Details

    • onPacketSending

      public PacketEvent onPacketSending(Injector injector, Object packet, NetworkMarker marker)
      Description copied from interface: ChannelListener
      Invoked when a packet is being sent to the client.

      This is invoked on the main thread.

      Specified by:
      onPacketSending in interface ChannelListener
      Parameters:
      injector - - the channel injector.
      packet - - the packet.
      marker - - the network marker.
      Returns:
      The packet even that was passed to the listeners, with a possible packet change, or NULL.
    • onPacketReceiving

      public PacketEvent onPacketReceiving(Injector injector, Object packet, NetworkMarker marker)
      Description copied from interface: ChannelListener
      Invoked when a packet is being received from a client.

      This is invoked on an asynchronous worker thread.

      Specified by:
      onPacketReceiving in interface ChannelListener
      Parameters:
      injector - - the channel injector.
      packet - - the packet.
      marker - - the associated network marker, if any.
      Returns:
      The packet even that was passed to the listeners, with a possible packet change, or NULL.
    • hasListener

      public boolean hasListener(Class<?> packetClass)
      Description copied from interface: ChannelListener
      Determine if there is a packet listener for the given packet.
      Specified by:
      hasListener in interface ChannelListener
      Parameters:
      packetClass - - the packet class to check.
      Returns:
      TRUE if there is such a listener, FALSE otherwise.
    • hasMainThreadListener

      public boolean hasMainThreadListener(Class<?> packetClass)
      Description copied from interface: ChannelListener
      Determine if there is a server packet listener that must be executed on the main thread.
      Specified by:
      hasMainThreadListener in interface ChannelListener
      Parameters:
      packetClass - - the packet class to check.
      Returns:
      TRUE if there is, FALSE otherwise.
    • hasMainThreadListener

      public boolean hasMainThreadListener(PacketType type)
      Specified by:
      hasMainThreadListener in interface ChannelListener
    • getReporter

      public ErrorReporter getReporter()
      Description copied from interface: ChannelListener
      Retrieve the current error reporter.
      Specified by:
      getReporter in interface ChannelListener
      Returns:
      The error reporter.
    • isDebug

      public boolean isDebug()
      Description copied from interface: ChannelListener
      Determine if debug mode is enabled.
      Specified by:
      isDebug in interface ChannelListener
      Returns:
      TRUE if it is, FALSE otherwise.
    • setDebug

      public void setDebug(boolean debug)
    • inject

      public void inject()
    • close

      public void close()
    • getPacketInjector

      public PacketInjector getPacketInjector()
    • getPlayerInjectionHandler

      public PlayerInjectionHandler getPlayerInjectionHandler()