Interface Injector

All Known Implementing Classes:
NettyChannelInjector

public interface Injector
Represents an injected client connection.
  • Method Details

    • getAddress

      SocketAddress getAddress()
    • getProtocolVersion

      int getProtocolVersion()
      Retrieve the current protocol version of the player.
      Returns:
      Protocol version.
    • inject

      void inject()
      Inject the current channel.

      Note that only active channels can be injected.

    • close

      void close()
      Close the current injector.
    • sendClientboundPacket

      void sendClientboundPacket(Object packet, NetworkMarker marker, boolean filtered)
      Send a packet to a player's client.
      Parameters:
      packet - - the packet to send.
      marker - - the network marker.
      filtered - - whether or not the packet is filtered.
    • readServerboundPacket

      void readServerboundPacket(Object packet)
    • sendWirePacket

      void sendWirePacket(WirePacket packet)
    • disconnect

      void disconnect(String message)
    • getCurrentProtocol

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

      org.bukkit.entity.Player getPlayer()
      Retrieve the current player or temporary player associated with the injector.
      Returns:
      The current player.
    • setPlayer

      void setPlayer(org.bukkit.entity.Player player)
      Set the current player instance.
      Parameters:
      player - - the current player.
    • isConnected

      boolean isConnected()
    • isInjected

      boolean isInjected()
      Determine if the channel has already been injected.
      Returns:
      TRUE if it has, FALSE otherwise.
    • isClosed

      boolean isClosed()
      Determine if this channel has been closed and cleaned up.
      Returns:
      TRUE if it has, FALSE otherwise.