當前位置: 首頁>>代碼示例>>Java>>正文


Java WorldEditPlugin.getSession方法代碼示例

本文整理匯總了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;
}
 
開發者ID:Yoshi41023,項目名稱:TatsuCraftMod,代碼行數:17,代碼來源:TFM_WorldEditBridge.java

示例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;
	}

}
 
開發者ID:Sharpjaws,項目名稱:SharpSK,代碼行數:33,代碼來源:EffSaveSelectionToClipboard.java

示例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);
}
 
開發者ID:SBPrime,項目名稱:MCPainter,代碼行數:13,代碼來源:DrawingTask.java

示例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));
}
 
開發者ID:Loscillo,項目名稱:DACv2-temp,代碼行數:12,代碼來源:SelectCommands.java


注:本文中的com.sk89q.worldedit.bukkit.WorldEditPlugin.getSession方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。