本文整理汇总了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);
}
}
示例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);
}
}
示例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;
}
}
示例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();
}