public interface SessionManager
| Modifier and Type | Method and Description |
|---|---|
Session |
createSession(LocalPlayer player)
Create a session for a player.
|
Session |
get(LocalPlayer player)
Get a player's session.
|
Session |
getIfPresent(LocalPlayer player)
Get a player's session, if one exists.
|
boolean |
hasBypass(LocalPlayer player,
com.sk89q.worldedit.world.World world)
Check whether a player has the region bypass permission.
|
boolean |
registerHandler(Handler.Factory<? extends Handler> factory,
Handler.Factory<? extends Handler> after)
Register a handler with the BukkitSessionManager.
|
void |
resetAllStates()
Re-initialize handlers and clear "last position," "last state," etc.
|
void |
resetState(LocalPlayer player)
Re-initialize handlers and clear "last position," "last state," etc.
|
boolean |
unregisterHandler(Handler.Factory<? extends Handler> factory)
Unregister a handler.
|
boolean hasBypass(LocalPlayer player, com.sk89q.worldedit.world.World world)
The return value may be cached for a few seconds.
player - The playerworld - The worldvoid resetAllStates()
void resetState(LocalPlayer player)
player - The playerboolean registerHandler(Handler.Factory<? extends Handler> factory, @Nullable Handler.Factory<? extends Handler> after)
factory - a factory which takes a session and returns an instance of your handlerafter - the handler factory to insert the first handler after, to ensure a specific order when creating new sessionstrue (as specified by Collection.add(E))
false if after is not registered, or factory is nullboolean unregisterHandler(Handler.Factory<? extends Handler> factory)
factory - the handler factory to unregisterSession createSession(LocalPlayer player)
player - The player@Nullable Session getIfPresent(LocalPlayer player)
player - The playerSession get(LocalPlayer player)
This method can only be called from the main thread. While the session manager itself is thread-safe, some of the handlers may require initialization that requires the server main thread.
player - The player to get a session forplayer's session