本文整理匯總了Java中com.sk89q.worldedit.bukkit.WorldEditPlugin.getSession方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldEditPlugin.getSession方法的具體用法?Java WorldEditPlugin.getSession怎麽用?Java WorldEditPlugin.getSession使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sk89q.worldedit.bukkit.WorldEditPlugin
的用法示例。
在下文中一共展示了WorldEditPlugin.getSession方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPlayerSession
import com.sk89q.worldedit.bukkit.WorldEditPlugin; //導入方法依賴的package包/類
public LocalSession getPlayerSession(Player player)
{
try
{
WorldEditPlugin wep = this.getWorldEditPlugin();
if (wep != null)
{
return wep.getSession(player);
}
}
catch (Exception ex)
{
TFM_Log.severe(ex);
}
return null;
}
示例2: execute
import com.sk89q.worldedit.bukkit.WorldEditPlugin; //導入方法依賴的package包/類
@Override
protected void execute(Event e) {
WorldEditPlugin wep = (WorldEditPlugin) Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
LocalSession session = wep.getSession(pl.getSingle(e));
Location point1loc = point1.getSingle(e);
Location point2loc = point2.getSingle(e);
Vector min = new Vector(point1loc.getBlockX(), point1loc.getBlockY(), point1loc.getZ());
Vector max = new Vector(point2loc.getBlockX(), point2loc.getBlockY(), point2loc.getZ());
CuboidRegion cr = new CuboidRegion(min, max);
BlockArrayClipboard bc = new BlockArrayClipboard(cr);
EditSession es = wep.createEditSession(pl.getSingle(e));
try {
if (origin == null) {
bc.setOrigin(session.getPlacementPosition(wep.wrapPlayer(pl.getSingle(e))));
} else {
Location originloc = origin.getSingle(e);
Vector originvec = new Vector(originloc.getBlockX(), originloc.getBlockY(), originloc.getBlockZ());
bc.setOrigin(originvec);
}
session.setClipboard(new ClipboardHolder(bc, es.getWorld().getWorldData()));
ForwardExtentCopy copy = new ForwardExtentCopy(es, cr, bc, cr.getMinimumPoint());
Operations.complete(copy);
} catch (WorldEditException e1) {
main core = (main) Bukkit.getPluginManager().getPlugin("SharpSK");
core.getLogger().warning("Failed to save selection. Something went wrong");
return;
}
}
示例3: DrawingTask
import com.sk89q.worldedit.bukkit.WorldEditPlugin; //導入方法依賴的package包/類
public DrawingTask(WorldEditPlugin worldEditPlugin, Player player) {
WorldEdit worldEdit = worldEditPlugin.getWorldEdit();
final AsyncEditSessionFactory factory = (AsyncEditSessionFactory)worldEdit.getEditSessionFactory();
m_player = player;
m_localPlayer = worldEditPlugin.wrapPlayer(player);
m_lSession = worldEditPlugin.getSession(player);
m_editSession = factory.getThreadSafeEditSession(m_localPlayer.getWorld(),
m_lSession.getBlockChangeLimit() , m_lSession.getBlockBag(m_localPlayer), m_localPlayer);
}
示例4: setSelection
import com.sk89q.worldedit.bukkit.WorldEditPlugin; //導入方法依賴的package包/類
private void setSelection(Player sender, Arena arena,
WESelector selectorType, Region region) {
WorldEditPlugin worldEdit = getWorldEdit();
LocalWorld world = BukkitUtil.getLocalWorld(arena.getWorld());
Shape shape = region.getShape();
RegionSelector sel = selectorType.create(dac, world, shape);
LocalSession session = worldEdit.getSession(sender);
session.setRegionSelector(world, sel);
session.dispatchCUISelection(worldEdit.wrapPlayer(sender));
}