Class NettyChannelInjector

java.lang.Object
com.comphenix.protocol.injector.netty.channel.NettyChannelInjector
All Implemented Interfaces:
Injector

public class NettyChannelInjector extends Object implements Injector
  • Field Details

  • Constructor Details

  • Method Details

    • getAddress

      public SocketAddress getAddress()
      Specified by:
      getAddress in interface Injector
    • getProtocolVersion

      public int getProtocolVersion()
      Description copied from interface: Injector
      Retrieve the current protocol version of the player.
      Specified by:
      getProtocolVersion in interface Injector
      Returns:
      Protocol version.
    • inject

      public void inject()
      Description copied from interface: Injector
      Inject the current channel.

      Note that only active channels can be injected.

      Specified by:
      inject in interface Injector
    • close

      public void close()
      Description copied from interface: Injector
      Close the current injector.
      Specified by:
      close in interface Injector
    • sendClientboundPacket

      public void sendClientboundPacket(Object packet, NetworkMarker marker, boolean filtered)
      Description copied from interface: Injector
      Send a packet to a player's client.
      Specified by:
      sendClientboundPacket in interface Injector
      Parameters:
      packet - - the packet to send.
      marker - - the network marker.
      filtered - - whether or not the packet is filtered.
    • readServerboundPacket

      public void readServerboundPacket(Object packet)
      Specified by:
      readServerboundPacket in interface Injector
    • sendWirePacket

      public void sendWirePacket(WirePacket packet)
      Specified by:
      sendWirePacket in interface Injector
    • disconnect

      public void disconnect(String message)
      Specified by:
      disconnect in interface Injector
    • getCurrentProtocol

      public PacketType.Protocol getCurrentProtocol(PacketType.Sender sender)
      Description copied from interface: Injector
      Retrieve the current protocol state. Note that since 1.20.2 the client and server direction can be in different protocol states.
      Specified by:
      getCurrentProtocol in interface Injector
      Parameters:
      sender - the side for which the state should be resolved.
      Returns:
      The current protocol.
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Description copied from interface: Injector
      Retrieve the current player or temporary player associated with the injector.
      Specified by:
      getPlayer in interface Injector
      Returns:
      The current player.
    • setPlayer

      public void setPlayer(org.bukkit.entity.Player player)
      Description copied from interface: Injector
      Set the current player instance.
      Specified by:
      setPlayer in interface Injector
      Parameters:
      player - - the current player.
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface Injector
    • isInjected

      public boolean isInjected()
      Description copied from interface: Injector
      Determine if the channel has already been injected.
      Specified by:
      isInjected in interface Injector
      Returns:
      TRUE if it has, FALSE otherwise.
    • isClosed

      public boolean isClosed()
      Description copied from interface: Injector
      Determine if this channel has been closed and cleaned up.
      Specified by:
      isClosed in interface Injector
      Returns:
      TRUE if it has, FALSE otherwise.