Search in sources :

Example 6 with SessionManager

use of com.sk89q.worldedit.session.SessionManager in project JeffLib by JEFF-Media-GbR.

the class WorldEditHandler method getSelectedRegion.

private static Region getSelectedRegion(final org.bukkit.entity.Player player) throws IncompleteRegionException {
    final Player actor = BukkitAdapter.adapt(player);
    final SessionManager manager = WorldEdit.getInstance().getSessionManager();
    final LocalSession session = manager.get(actor);
    final World selectionWorld = session.getSelectionWorld();
    return session.getSelection(selectionWorld);
}
Also used : Player(com.sk89q.worldedit.entity.Player) SessionManager(com.sk89q.worldedit.session.SessionManager) LocalSession(com.sk89q.worldedit.LocalSession) World(com.sk89q.worldedit.world.World)

Aggregations

SessionManager (com.sk89q.worldedit.session.SessionManager)6 LocalSession (com.sk89q.worldedit.LocalSession)4 BukkitPlayer (com.sk89q.worldedit.bukkit.BukkitPlayer)4 Region (com.sk89q.worldedit.regions.Region)4 IncompleteRegionException (com.sk89q.worldedit.IncompleteRegionException)3 BukkitWorld (com.sk89q.worldedit.bukkit.BukkitWorld)2 World (com.sk89q.worldedit.world.World)2 Location (org.bukkit.Location)2 Player (com.sk89q.worldedit.entity.Player)1 BlockVector3 (com.sk89q.worldedit.math.BlockVector3)1 CuboidRegion (com.sk89q.worldedit.regions.CuboidRegion)1 Polygonal2DRegion (com.sk89q.worldedit.regions.Polygonal2DRegion)1 World (org.bukkit.World)1 Player (org.bukkit.entity.Player)1 Vector (org.bukkit.util.Vector)1 BteConoSur.mainWorld (pizzaaxx.bteconosur.BteConoSur.mainWorld)1 ReachLocationObjective (rocks.gravili.notquests.paper.structs.objectives.ReachLocationObjective)1 ReachLocationObjective (rocks.gravili.notquests.spigot.structs.objectives.ReachLocationObjective)1 EnginePlayer (thpmc.engine.api.player.EnginePlayer)1 ParallelUniverse (thpmc.engine.api.world.parallel.ParallelUniverse)1