当前位置: 首页>>代码示例>>Java>>正文


Java Operations.complete方法代码示例

本文整理汇总了Java中com.sk89q.worldedit.function.operation.Operations.complete方法的典型用法代码示例。如果您正苦于以下问题:Java Operations.complete方法的具体用法?Java Operations.complete怎么用?Java Operations.complete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sk89q.worldedit.function.operation.Operations的用法示例。


在下文中一共展示了Operations.complete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: regenerate

import com.sk89q.worldedit.function.operation.Operations; //导入方法依赖的package包/类
@Override
public void regenerate(Floor floor, EditSession session, RegenerationCause cause) {
	Clipboard clipboard = floor.getClipboard();
	
	Region region = clipboard.getRegion();
	World world = region.getWorld();
	WorldData data = world.getWorldData();
	
	ClipboardHolder holder = new ClipboardHolder(clipboard, data);
	
	Operation pasteOperation = holder.createPaste(session, data)
			.to(region.getMinimumPoint())
			.ignoreAirBlocks(true)
			.build();
	
	try {
		Operations.complete(pasteOperation);
	} catch (WorldEditException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:xaniox,项目名称:HeavySpleef,代码行数:22,代码来源:DefaultFloorRegenerator.java

示例2: generate

import com.sk89q.worldedit.function.operation.Operations; //导入方法依赖的package包/类
@Override
@Deprecated
public void generate(EditSession session) {
	Region region = floorClipboard.getRegion();
	World world = region.getWorld();
	WorldData data = world.getWorldData();
	
	ClipboardHolder holder = new ClipboardHolder(floorClipboard, data);
	
	Operation pasteOperation = holder.createPaste(session, data)
			.to(region.getMinimumPoint())
			.ignoreAirBlocks(true)
			.build();
	
	try {
		Operations.complete(pasteOperation);
	} catch (WorldEditException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:xaniox,项目名称:HeavySpleef,代码行数:21,代码来源:SimpleClipboardFloor.java

示例3: execute

import com.sk89q.worldedit.function.operation.Operations; //导入方法依赖的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

示例4: saveTerrain

import com.sk89q.worldedit.function.operation.Operations; //导入方法依赖的package包/类
public void saveTerrain(File saveFile, World world, Region selection, Vector origin) throws DataException, IOException, WorldEditException {
	File schemDir = HTConfigHandler.getFile("Schematics");
	if(!schemDir.exists()) schemDir.mkdirs();

	EditSession editSession = we.getEditSessionFactory().getEditSession(world, -1);
	BlockArrayClipboard clipboard = new BlockArrayClipboard(selection);
	clipboard.setOrigin(origin);

	ForwardExtentCopy copy = new ForwardExtentCopy(editSession, selection, clipboard, origin);
	Operations.complete(copy);
	FileOutputStream fos = new FileOutputStream(saveFile);
	ClipboardWriter writer = ClipboardFormat.SCHEMATIC.getWriter(fos);
	writer.write(clipboard, world.getWorldData());
	writer.close();
}
 
开发者ID:gvlfm78,项目名称:BukkitHotels,代码行数:16,代码来源:HTTerrainManager.java


注:本文中的com.sk89q.worldedit.function.operation.Operations.complete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。