public class Session extends Object
| Constructor and Description |
|---|
Session(SessionManager manager)
Create a new session.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends Handler> |
getHandler(Class<T> type)
Get a handler by class, if has been registered.
|
SessionManager |
getManager()
Get the session manager.
|
WorldGuardPlugin |
getPlugin()
Get the plugin.
|
boolean |
isInvincible(org.bukkit.entity.Player player)
Test whether the session has invincibility enabled.
|
org.bukkit.Location |
testMoveTo(org.bukkit.entity.Player player,
org.bukkit.Location to,
MoveType moveType)
Test movement to the given location.
|
org.bukkit.Location |
testMoveTo(org.bukkit.entity.Player player,
org.bukkit.Location to,
MoveType moveType,
boolean forced)
Test movement to the given location.
|
public Session(SessionManager manager)
manager - The session managerpublic WorldGuardPlugin getPlugin()
public SessionManager getManager()
@Nullable public <T extends Handler> T getHandler(Class<T> type)
T - The type of handlertype - The type of handlerpublic boolean isInvincible(org.bukkit.entity.Player player)
@Nullable public org.bukkit.Location testMoveTo(org.bukkit.entity.Player player, org.bukkit.Location to, MoveType moveType)
player - The playerto - The new locationmoveType - The type of moveFor an explanation@Nullable public org.bukkit.Location testMoveTo(org.bukkit.entity.Player player, org.bukkit.Location to, MoveType moveType, boolean forced)
If a non-null Location is returned, the player should be
at that location instead of where the player has tried to move to.
If the moveType is cancellable
(MoveType.isCancellable(), then the last valid location will
be set to the given one.
player - The playerto - The new locationmoveType - The type of moveforced - Whether to force a checkCopyright © 2015. All Rights Reserved.