Class ClosedInjector
java.lang.Object
com.comphenix.protocol.injector.netty.ClosedInjector
- All Implemented Interfaces:
Injector
Represents a closed injector.
- Author:
- Kristian
-
Constructor Summary
ConstructorsConstructorDescriptionClosedInjector(org.bukkit.entity.Player player)Construct a new injector that is always closed. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the current injector.Retrieve the current protocol state.Retrieve the network marker associated with a given packet.org.bukkit.entity.PlayerRetrieve the current player or temporary player associated with the injector.intRetrieve the current protocol version of the player.booleaninject()Inject the current channel.booleanisClosed()Determine if this channel has been closed and cleaned up.booleanDetermine if the channel has already been injected.voidrecieveClientPacket(Object packet)Recieve a packet on the server.voidsaveMarker(Object packet, NetworkMarker marker)Associate a given network marker with a specific packet.voidsendServerPacket(Object packet, NetworkMarker marker, boolean filtered)Send a packet to a player's client.voidsetPlayer(org.bukkit.entity.Player player)Set the current player instance.voidsetUpdatedPlayer(org.bukkit.entity.Player player)Set the updated player instance.
-
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:InjectorInject the current channel.Note that only active channels can be injected.
-
close
public void close()Description copied from interface:InjectorClose the current injector. -
sendServerPacket
Description copied from interface:InjectorSend a packet to a player's client.- Specified by:
sendServerPacketin interfaceInjector- Parameters:
packet- - the packet to send.marker- - the network marker.filtered- - whether or not the packet is filtered.
-
recieveClientPacket
Description copied from interface:InjectorRecieve a packet on the server.- Specified by:
recieveClientPacketin interfaceInjector- Parameters:
packet- - the (NMS) packet to send.
-
getCurrentProtocol
Description copied from interface:InjectorRetrieve the current protocol state.- Specified by:
getCurrentProtocolin interfaceInjector- Returns:
- The current protocol.
-
getMarker
Description copied from interface:InjectorRetrieve the network marker associated with a given packet. -
saveMarker
Description copied from interface:InjectorAssociate a given network marker with a specific packet.- Specified by:
saveMarkerin interfaceInjector- Parameters:
packet- - the NMS packet.marker- - the associated marker.
-
setUpdatedPlayer
public void setUpdatedPlayer(org.bukkit.entity.Player player)Description copied from interface:InjectorSet the updated player instance.This will not replace the current instance, but it will allow PacketEvent to provide additional player information.
- Specified by:
setUpdatedPlayerin interfaceInjector- Parameters:
player- - the more up-to-date player.
-
getPlayer
public org.bukkit.entity.Player getPlayer()Description copied from interface:InjectorRetrieve the current player or temporary player associated with the injector. -
setPlayer
public void setPlayer(org.bukkit.entity.Player player)Description copied from interface:InjectorSet the current player instance. -
isInjected
public boolean isInjected()Description copied from interface:InjectorDetermine if the channel has already been injected.- Specified by:
isInjectedin interfaceInjector- Returns:
- TRUE if it has, FALSE otherwise.
-
isClosed
public boolean isClosed()Description copied from interface:InjectorDetermine if this channel has been closed and cleaned up. -
getProtocolVersion
public int getProtocolVersion()Description copied from interface:InjectorRetrieve the current protocol version of the player.- Specified by:
getProtocolVersionin interfaceInjector- Returns:
- Protocol version.
-