public final class PlayerConnectionCache extends Object implements org.bukkit.event.Listener
| Constructor and Description |
|---|
PlayerConnectionCache()
Creates a new
PlayerConnectionCache and registers itself
as an event listener. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getConnection(org.bukkit.entity.Player player)
Gets the PlayerConnection of the specified
Player from
the cache. |
void |
handlePlayerQuit(org.bukkit.event.player.PlayerQuitEvent event)
Removes a leaving player from the
cache. |
void |
registerListener()
Registers the current
PlayerConnectionCache instance as an
event Listener. |
public PlayerConnectionCache()
PlayerConnectionCache and registers itself
as an event listener. The plugin is retrieved from the PluginClassLoader.public void registerListener()
PlayerConnectionCache instance as an
event Listener.public Object getConnection(org.bukkit.entity.Player player)
Player from
the cache. If the cache doesn't contain the PlayerConnection
yet it uses reflective calls to retrieve the connection
and adds it to the cache (If the player is online).player - the target PlayerPlayerpublic void handlePlayerQuit(org.bukkit.event.player.PlayerQuitEvent event)
cache.event - The PlayerQuitEvent that should be handledCopyright © 2021. All rights reserved.