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


Java LocalSession.getPlacementPosition方法代码示例

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


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

示例1: copy

import com.sk89q.worldedit.LocalSession; //导入方法依赖的package包/类
@Command(
        aliases = {"copy"},
        desc = "Lazily copy chunks to your anvil clipboard"
)
@CommandPermissions("worldedit.anvil.copychunks")
public void copy(Player player, LocalSession session, EditSession editSession, @Selection Region selection) throws WorldEditException {
    if (!(selection instanceof CuboidRegion)) {
        BBC.NO_REGION.send(player);
        return;
    }
    CuboidRegion cuboid = (CuboidRegion) selection;
    String worldName = Fawe.imp().getWorldName(editSession.getWorld());
    FaweQueue tmp = SetQueue.IMP.getNewQueue(worldName, true, false);
    MCAQueue queue = new MCAQueue(tmp);
    Vector origin = session.getPlacementPosition(player);
    MCAClipboard clipboard = new MCAClipboard(queue, cuboid, origin);
    FawePlayer fp = FawePlayer.wrap(player);
    fp.setMeta(FawePlayer.METADATA_KEYS.ANVIL_CLIPBOARD, clipboard);
    BBC.COMMAND_COPY.send(player, selection.getArea());
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:21,代码来源:AnvilCommands.java

示例2: fill

import com.sk89q.worldedit.LocalSession; //导入方法依赖的package包/类
@Command(
        aliases = {"/fill"},
        usage = "<pattern> <radius> [depth]",
        desc = "Fill a hole",
        min = 2,
        max = 4
)
@CommandPermissions("worldedit.fill")
@Logging(PLACEMENT)
public void fill(Player player, LocalSession session, EditSession editSession, Pattern pattern, double radius, @Optional("1") double depth, @Optional("down") @Direction Vector direction) throws WorldEditException {
    worldEdit.checkMaxRadius(radius);
    Vector pos = session.getPlacementPosition(player);
    int affected;
    affected = editSession.fillDirection(pos, pattern, radius, (int) depth, direction);
    player.print(BBC.getPrefix() + affected + " block(s) have been created.");
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:17,代码来源:UtilityCommands.java

示例3: fillr

import com.sk89q.worldedit.LocalSession; //导入方法依赖的package包/类
@Command(
        aliases = {"/fillr"},
        usage = "<pattern> <radius> [depth]",
        desc = "Fill a hole recursively",
        min = 2,
        max = 3
)
@CommandPermissions("worldedit.fill.recursive")
@Logging(PLACEMENT)
public void fillr(Player player, LocalSession session, EditSession editSession, Pattern pattern, double radius, @Optional("-1") double depth) throws WorldEditException {
    worldEdit.checkMaxRadius(radius);
    Vector pos = session.getPlacementPosition(player);
    if (depth == -1) depth = Integer.MAX_VALUE;
    int affected = editSession.fillXZ(pos, pattern, radius, (int) depth, true);
    player.print(BBC.getPrefix() + affected + " block(s) have been created.");
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:17,代码来源:UtilityCommands.java

示例4: pyramid

import com.sk89q.worldedit.LocalSession; //导入方法依赖的package包/类
@Command(
        aliases = {"/pyramid"},
        usage = "<pattern> <size>",
        flags = "h",
        desc = "Generate a filled pyramid",
        min = 2,
        max = 2
)
@CommandPermissions("worldedit.generation.pyramid")
@Logging(PLACEMENT)
public void pyramid(FawePlayer fp, Player player, LocalSession session, EditSession editSession, Pattern pattern, @Range(min = 1) int size, @Switch('h') boolean hollow, CommandContext context) throws WorldEditException, ParameterException {
    fp.checkConfirmationRadius(getArguments(context), size);
    Vector pos = session.getPlacementPosition(player);
    worldEdit.checkMaxRadius(size);
    int affected = editSession.makePyramid(pos, pattern, size, !hollow);
    player.findFreePosition();
    BBC.VISITOR_BLOCK.send(fp, affected);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:19,代码来源:GenerationCommands.java


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