Class ClosedInjector

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

public class ClosedInjector extends Object implements Injector
Represents a closed injector.
Author:
Kristian
  • Constructor Details

    • ClosedInjector

      public ClosedInjector(org.bukkit.entity.Player player)
      Construct a new injector that is always closed.
      Parameters:
      player - - the associated player.
  • Method Details

    • inject

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

      Note that only active channels can be injected.

      Specified by:
      inject in interface Injector
      Returns:
      TRUE if we injected the channel, false if we could not inject or it was already injected.
    • close

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

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

      public void recieveClientPacket(Object packet)
      Description copied from interface: Injector
      Recieve a packet on the server.
      Specified by:
      recieveClientPacket in interface Injector
      Parameters:
      packet - - the (NMS) packet to send.
    • getCurrentProtocol

      public PacketType.Protocol getCurrentProtocol()
      Description copied from interface: Injector
      Retrieve the current protocol state.
      Specified by:
      getCurrentProtocol in interface Injector
      Returns:
      The current protocol.
    • getMarker

      public NetworkMarker getMarker(Object packet)
      Description copied from interface: Injector
      Retrieve the network marker associated with a given packet.
      Specified by:
      getMarker in interface Injector
      Parameters:
      packet - - the packet.
      Returns:
      The network marker.
    • saveMarker

      public void saveMarker(Object packet, NetworkMarker marker)
      Description copied from interface: Injector
      Associate a given network marker with a specific packet.
      Specified by:
      saveMarker in interface Injector
      Parameters:
      packet - - the NMS packet.
      marker - - the associated marker.
    • setUpdatedPlayer

      public void setUpdatedPlayer(org.bukkit.entity.Player player)
      Description copied from interface: Injector
      Set the updated player instance.

      This will not replace the current instance, but it will allow PacketEvent to provide additional player information.

      Specified by:
      setUpdatedPlayer in interface Injector
      Parameters:
      player - - the more up-to-date player.
    • 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.
    • 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.
    • 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.