Interface Injector
- All Known Implementing Classes:
NettyChannelInjector
public interface Injector
Represents an injected client connection.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the current injector.voiddisconnect(String message) getCurrentProtocol(PacketType.Sender sender) Retrieve the current protocol state.org.bukkit.entity.PlayerRetrieve the current player or temporary player associated with the injector.intRetrieve the current protocol version of the player.voidinject()Inject the current channel.booleanisClosed()Determine if this channel has been closed and cleaned up.booleanbooleanDetermine if the channel has already been injected.voidreadServerboundPacket(Object packet) voidsendClientboundPacket(Object packet, NetworkMarker marker, boolean filtered) Send a packet to a player's client.voidsendWirePacket(WirePacket packet) voidsetPlayer(org.bukkit.entity.Player player) Set the current player instance.
-
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
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
-
sendWirePacket
-
disconnect
-
getCurrentProtocol
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.
-