public abstract class AbstractPlayerHandler extends Object implements PlayerInjectionHandler
PlayerInjectionHandler.ConflictStrategy| Modifier and Type | Field and Description |
|---|---|
protected PacketTypeSet |
sendingFilters |
| Constructor and Description |
|---|
AbstractPlayerHandler(PacketTypeSet sendingFilters) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPacketHandler(PacketType type,
Set<ListenerOptions> options)
Add an underlying packet handler of the given type.
|
boolean |
canRecievePackets()
Whether or not this player injection handler can also receive packets.
|
void |
checkListener(PacketListener listener)
Determine if a listener is valid or not.
|
void |
checkListener(Set<PacketListener> listeners)
Determine if the given listeners are valid.
|
void |
close()
Close any lingering proxy injections.
|
org.bukkit.entity.Player |
getPlayerByConnection(DataInputStream inputStream)
Retrieve a player by its DataInput connection.
|
PlayerInjectHooks |
getPlayerHook()
Retrieves how the server packets are read.
|
PlayerInjectHooks |
getPlayerHook(GamePhase phase)
Retrieves how the server packets are read.
|
Set<PacketType> |
getSendingFilters()
Retrieve the current list of registered sending listeners.
|
void |
removePacketHandler(PacketType type)
Remove an underlying packet handler of this type.
|
void |
setPlayerHook(GamePhase phase,
PlayerInjectHooks playerHook)
Sets how the server packets are read.
|
void |
setPlayerHook(PlayerInjectHooks playerHook)
Sets how the server packets are read.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChannel, getProtocolVersion, handleDisconnect, handlePacketRecieved, hasMainThreadListener, injectPlayer, recieveClientPacket, sendServerPacket, uninjectPlayer, uninjectPlayer, updatePlayerprotected PacketTypeSet sendingFilters
public AbstractPlayerHandler(PacketTypeSet sendingFilters)
public void setPlayerHook(GamePhase phase, PlayerInjectHooks playerHook)
PlayerInjectionHandlersetPlayerHook in interface PlayerInjectionHandlerphase - - the current game phase.playerHook - - the new injection method for reading server packets.public void setPlayerHook(PlayerInjectHooks playerHook)
PlayerInjectionHandlersetPlayerHook in interface PlayerInjectionHandlerplayerHook - - the new injection method for reading server packets.public void addPacketHandler(PacketType type, Set<ListenerOptions> options)
PlayerInjectionHandleraddPacketHandler in interface PlayerInjectionHandlertype - - packet type to register.options - - any specified listener options.public void removePacketHandler(PacketType type)
PlayerInjectionHandlerremovePacketHandler in interface PlayerInjectionHandlertype - - packet type to unregister.public Set<PacketType> getSendingFilters()
PlayerInjectionHandlergetSendingFilters in interface PlayerInjectionHandlerpublic void close()
PlayerInjectionHandlerclose in interface PlayerInjectionHandlerpublic PlayerInjectHooks getPlayerHook(GamePhase phase)
PlayerInjectionHandlergetPlayerHook in interface PlayerInjectionHandlerphase - - the current game phase.public boolean canRecievePackets()
PlayerInjectionHandlercanRecievePackets in interface PlayerInjectionHandlerpublic PlayerInjectHooks getPlayerHook()
PlayerInjectionHandlergetPlayerHook in interface PlayerInjectionHandlerpublic org.bukkit.entity.Player getPlayerByConnection(DataInputStream inputStream) throws InterruptedException
PlayerInjectionHandlergetPlayerByConnection in interface PlayerInjectionHandlerinputStream - - the associated DataInput connection.InterruptedException - If the thread was interrupted during the wait.public void checkListener(PacketListener listener)
PlayerInjectionHandlerIf not, a warning will be printed to the console.
checkListener in interface PlayerInjectionHandlerlistener - - listener to check.public void checkListener(Set<PacketListener> listeners)
PlayerInjectionHandlercheckListener in interface PlayerInjectionHandlerlisteners - - listeners to check.Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.