Search in sources :

Example 1 with BukkitPlayer

use of com.sk89q.worldguard.bukkit.BukkitPlayer in project WorldGuard by EngineHub.

the class BukkitSessionManager method resetAllStates.

/**
 * Re-initialize handlers and clear "last position," "last state," etc.
 * information for all players.
 */
@Override
public void resetAllStates() {
    Collection<? extends Player> players = Bukkit.getServer().getOnlinePlayers();
    for (Player player : players) {
        BukkitPlayer bukkitPlayer = new BukkitPlayer(WorldGuardPlugin.inst(), player);
        Session session = getIfPresent(bukkitPlayer);
        if (session != null) {
            session.resetState(bukkitPlayer);
        }
    }
}
Also used : LocalPlayer(com.sk89q.worldguard.LocalPlayer) Player(org.bukkit.entity.Player) BukkitPlayer(com.sk89q.worldguard.bukkit.BukkitPlayer) BukkitPlayer(com.sk89q.worldguard.bukkit.BukkitPlayer) Session(com.sk89q.worldguard.session.Session)

Aggregations

LocalPlayer (com.sk89q.worldguard.LocalPlayer)1 BukkitPlayer (com.sk89q.worldguard.bukkit.BukkitPlayer)1 Session (com.sk89q.worldguard.session.Session)1 Player (org.bukkit.entity.Player)1