com.sk89q.worldedit.LocalSession Java Examples

The following examples show how to use com.sk89q.worldedit.LocalSession. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BrushListener.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteract(final PlayerInteractEvent event) {
    Player bukkitPlayer = event.getPlayer();
    if (bukkitPlayer.isSneaking()) {
        if (event.getAction() == Action.PHYSICAL) {
            return;
        }
        FawePlayer<Object> fp = FawePlayer.wrap(bukkitPlayer);
        com.sk89q.worldedit.entity.Player player = fp.getPlayer();
        LocalSession session = fp.getSession();
        Tool tool = session.getTool(player);
        if (tool instanceof ResettableTool) {
            if (((ResettableTool) tool).reset()) {
                event.setCancelled(true);
            }
        }
    }
}
 
Example #2
Source File: PolyhedralRegionSelector.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void describeCUI(LocalSession session, Actor player) {
    checkNotNull(player);
    checkNotNull(session);

    Collection<Vector> vertices = region.getVertices();
    Collection<Triangle> triangles = region.getTriangles();

    Map<Vector, Integer> vertexIds = new HashMap<Vector, Integer>(vertices.size());
    int lastVertexId = -1;
    for (Vector vertex : vertices) {
        vertexIds.put(vertex, ++lastVertexId);
        session.dispatchCUIEvent(player, new SelectionPointEvent(lastVertexId, vertex, getArea()));
    }

    for (Triangle triangle : triangles) {
        final int[] v = new int[3];
        for (int i = 0; i < 3; ++i) {
            v[i] = vertexIds.get(triangle.getVertex(i));
        }
        session.dispatchCUIEvent(player, new SelectionPolygonEvent(v));
    }
}
 
Example #3
Source File: CuboidRegionSelector.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void explainPrimarySelection(Actor player, LocalSession session, Vector pos) {
    checkNotNull(player);
    checkNotNull(session);
    checkNotNull(pos);

    Message msg;
    if (position1 != null && position2 != null) {
        msg = BBC.SELECTOR_POS.m(1, position1, region.getArea());
    } else {
        msg = BBC.SELECTOR_POS.m(1, position1, "");
    }
    String prefix = WorldEdit.getInstance().getConfiguration().noDoubleSlash ? "" : "/";
    String cmd = prefix + Commands.getAlias(SelectionCommands.class, "/pos1") + " " + pos.getBlockX() + "," + pos.getBlockY() + "," + pos.getBlockZ();
    msg.suggestTip(cmd).send(player);

    session.dispatchCUIEvent(player, new SelectionPointEvent(0, pos, getArea()));
}
 
Example #4
Source File: ChunkCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"chunkinfo"},
        usage = "",
        desc = "Get information about the chunk that you are inside",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.chunkinfo")
public void chunkInfo(Player player, LocalSession session, CommandContext args) throws WorldEditException {
    Vector pos = player.getBlockIn();
    int chunkX = (int) Math.floor(pos.getBlockX() / 16.0);
    int chunkZ = (int) Math.floor(pos.getBlockZ() / 16.0);

    String folder1 = Integer.toString(MathUtils.divisorMod(chunkX, 64), 36);
    String folder2 = Integer.toString(MathUtils.divisorMod(chunkZ, 64), 36);
    String filename = "c." + Integer.toString(chunkX, 36)
            + "." + Integer.toString(chunkZ, 36) + ".dat";

    player.print(BBC.getPrefix() + "Chunk: " + chunkX + ", " + chunkZ);
    player.print(BBC.getPrefix() + "Old format: " + folder1 + "/" + folder2 + "/" + filename);
    player.print(BBC.getPrefix() + "McRegion: region/" + McRegionChunkStore.getFilename(
            new Vector2D(chunkX, chunkZ)));
}
 
Example #5
Source File: SuperPickaxeCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"area"},
        usage = "<radius>",
        desc = "Enable the area super pickaxe pickaxe mode",
        min = 1,
        max = 1
)
@CommandPermissions("worldedit.superpickaxe.area")
public void area(Player player, LocalSession session, CommandContext args) throws WorldEditException {

    LocalConfiguration config = we.getConfiguration();
    int range = args.getInteger(0);

    if (range > config.maxSuperPickaxeSize) {
        BBC.TOOL_RANGE_ERROR.send(player, config.maxSuperPickaxeSize);
        return;
    }

    session.setSuperPickaxe(new AreaPickaxe(range));
    session.enableSuperPickAxe();
    BBC.SUPERPICKAXE_AREA_ENABLED.send(player);
}
 
Example #6
Source File: OptionsCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"/gmask", "gmask", "globalmask", "/globalmask"},
        usage = "[mask]",
        help = "The global destination mask applies to all edits you do and masks based on the destination blocks (i.e. the blocks in the world).",
        desc = "Set the global mask",
        min = 0,
        max = -1
)
@CommandPermissions({"worldedit.global-mask", "worldedit.mask.global"})
public void gmask(Player player, LocalSession session, EditSession editSession, @Optional CommandContext context) throws WorldEditException {
    if (context == null || context.argsLength() == 0) {
        session.setMask((Mask) null);
        BBC.MASK_DISABLED.send(player);
    } else {
        ParserContext parserContext = new ParserContext();
        parserContext.setActor(player);
        parserContext.setWorld(player.getWorld());
        parserContext.setSession(session);
        parserContext.setExtent(editSession);
        Mask mask = worldEdit.getMaskFactory().parseFromInput(context.getJoinedStrings(0), parserContext);
        session.setMask(mask);
        BBC.MASK.send(player);
    }
}
 
Example #7
Source File: CuboidRegionSelector.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void explainSecondarySelection(Actor player, LocalSession session, Vector pos) {
    checkNotNull(player);
    checkNotNull(session);
    checkNotNull(pos);

    Message msg;
    if (position1 != null && position2 != null) {
        msg = BBC.SELECTOR_POS.m(2, position2, region.getArea());
    } else {
        msg = BBC.SELECTOR_POS.m(2, position2, "");
    }
    String prefix = WorldEdit.getInstance().getConfiguration().noDoubleSlash ? "" : "/";
    String cmd = prefix + Commands.getAlias(SelectionCommands.class, "/pos2") + " " + pos.getBlockX() + "," + pos.getBlockY() + "," + pos.getBlockZ();
    msg.suggestTip(cmd).send(player);

    session.dispatchCUIEvent(player, new SelectionPointEvent(1, pos, getArea()));
}
 
Example #8
Source File: BrushOptionsCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"targetoffset", "to"},
        usage = "[mask]",
        desc = "Set the targeting mask",
        min = 1,
        max = -1
)
public void targetOffset(Player player, EditSession editSession, LocalSession session, int offset) throws WorldEditException {
    BrushTool tool = session.getBrushTool(player, false);
    if (tool == null) {
        BBC.BRUSH_NONE.send(player);
        return;
    }
    tool.setTargetOffset(offset);
    BBC.BRUSH_TARGET_OFFSET_SET.send(player, offset);
}
 
Example #9
Source File: BrushOptionsCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"size"},
        usage = "[pattern]",
        desc = "Set the brush size",
        min = 1,
        max = 1
)
@CommandPermissions("worldedit.brush.options.size")
public void size(Player player, LocalSession session, Expression radius, @Switch('h') boolean offHand) throws WorldEditException {
    BrushCommands.checkMaxBrushRadius(radius);
    BrushTool tool = session.getBrushTool(player, false);
    if (tool == null) {
        player.print(BBC.getPrefix() + BBC.BRUSH_NONE.f());
        return;
    }
    BrushSettings settings = offHand ? tool.getOffHand() : tool.getContext();
    settings.setSize(radius);
    tool.update();
    BBC.BRUSH_SIZE.send(player);
}
 
Example #10
Source File: BrushListener.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteract(final PlayerInteractEvent event) {
    Player nukkitPlayer = event.getPlayer();
    if (nukkitPlayer.isSneaking()) {
        if (event.getAction() == PlayerInteractEvent.Action.PHYSICAL) {
            return;
        }
        FawePlayer<Object> fp = FawePlayer.wrap(nukkitPlayer);
        com.sk89q.worldedit.entity.Player player = fp.getPlayer();
        LocalSession session = fp.getSession();
        Tool tool = session.getTool(player);
        if (tool instanceof ResettableTool) {
            if (((ResettableTool) tool).reset()) {
                event.setCancelled(true);
            }
        }
    }
}
 
Example #11
Source File: BrushListener.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerMove(PlayerMoveEvent event) {
    Location from = event.getFrom();
    Location to = event.getTo();
    if ((from.getYaw() != to.getYaw() &&  from.getPitch() != to.getPitch()) || from.getFloorX() != to.getFloorX() || from.getFloorZ() != to.getFloorZ() || from.getFloorY() != to.getFloorY()) {
        Player nukkitPlayer = event.getPlayer();
        FawePlayer<Object> fp = FawePlayer.wrap(nukkitPlayer);
        com.sk89q.worldedit.entity.Player player = fp.getPlayer();
        LocalSession session = fp.getSession();
        Tool tool = session.getTool(player);
        if (tool != null) {
            if (tool instanceof MovableTool) {
                ((MovableTool) tool).move(player);
            }
        }
    }
}
 
Example #12
Source File: CFICommand.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"cfi", "createfromimage"},
        usage = "",
        min = 0,
        max = -1,
        anyFlags = true,
        desc = "Start CreateFromImage"
)
@CommandPermissions("worldedit.anvil.cfi")
public void cfi(FawePlayer fp, CommandContext context) throws CommandException, IOException {
    CFICommands.CFISettings settings = child.getSettings(fp);
    settings.popMessages(fp);
    dispatch(fp, settings, context);
    HeightMapMCAGenerator gen = settings.getGenerator();
    if (gen != null && gen.isModified()) {
        gen.update();
        CFIChangeSet set = new CFIChangeSet(gen, fp.getUUID());
        LocalSession session = fp.getSession();
        session.remember(fp.getPlayer(), gen, set, fp.getLimit());
    }
}
 
Example #13
Source File: SelectionCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"/hpos2"},
        usage = "",
        desc = "Set position 2 to targeted block",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.selection.hpos")
public void hpos2(Player player, LocalSession session, CommandContext args) throws WorldEditException {
    Vector pos = player.getBlockTrace(300);

    if (pos != null) {
        if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos, ActorSelectorLimits.forActor(player))) {
            BBC.SELECTOR_ALREADY_SET.send(player);
            return;
        }

        session.getRegionSelector(player.getWorld())
                .explainSecondarySelection(player, session, pos);
    } else {
        player.printError("No block in sight!");
    }
}
 
Example #14
Source File: BrushListener.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerMove(PlayerMoveEvent event) {
    Location from = event.getFrom();
    Location to = event.getTo();
    if ((from.getYaw() != to.getYaw() &&  from.getPitch() != to.getPitch()) || from.getBlockX() != to.getBlockX() || from.getBlockZ() != to.getBlockZ() || from.getBlockY() != to.getBlockY()) {
        Player bukkitPlayer = event.getPlayer();
        FawePlayer<Object> fp = FawePlayer.wrap(bukkitPlayer);
        com.sk89q.worldedit.entity.Player player = fp.getPlayer();
        LocalSession session = fp.getSession();
        Tool tool = session.getTool(player);
        if (tool != null) {
            if (tool instanceof MovableTool) {
                ((MovableTool) tool).move(player);
            }
        }
    }
}
 
Example #15
Source File: BrushOptionsCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"scroll"},
        usage = "[none|clipboard|mask|pattern|range|size|visual|target|targetoffset]",
        desc = "Toggle between different target modes",
        min = 1,
        max = -1
)
public void scroll(Player player, EditSession editSession, LocalSession session, @Optional @Switch('h') boolean offHand, CommandContext args) throws WorldEditException {
    BrushTool bt = session.getBrushTool(player, false);
    if (bt == null) {
        BBC.BRUSH_NONE.send(player);
        return;
    }
    BrushSettings settings = offHand ? bt.getOffHand() : bt.getContext();
    ScrollAction action = ScrollAction.fromArguments(bt, player, session, args.getJoinedStrings(0), true);
    settings.setScrollAction(action);
    if (args.getString(0).equalsIgnoreCase("none")) {
        BBC.BRUSH_SCROLL_ACTION_UNSET.send(player);
    } else if (action != null) {
        String full = args.getJoinedStrings(0);
        settings.addSetting(BrushSettings.SettingType.SCROLL_ACTION, full);
        BBC.BRUSH_SCROLL_ACTION_SET.send(player, full);
    }
    bt.update();
}
 
Example #16
Source File: TransformCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"#rotate"},
        desc = "All changes will be rotate around the initial position",
        usage = "<rotateX> <rotateY> <rotateZ> [transform]",
        min = 3,
        max = 4
)
public ResettableExtent rotate(Player player, LocalSession session, double x, double y, double z, @Optional("#null") ResettableExtent other) {
    ExtentTraverser traverser = new ExtentTraverser(other).find(TransformExtent.class);
    BlockTransformExtent affine = (TransformExtent) (traverser != null ? traverser.get() : null);
    if (affine == null) {
        other = affine = new TransformExtent(other, player.getWorld().getWorldData().getBlockRegistry());
    }
    AffineTransform transform = (AffineTransform) affine.getTransform();
    transform = transform.rotateX(x);
    transform = transform.rotateY(y);
    transform = transform.rotateZ(z);
    affine.setTransform(transform);
    return (ResettableExtent) other;
}
 
Example #17
Source File: ConvexPolyhedralRegionSelector.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void describeCUI(LocalSession session, Actor player) {
    checkNotNull(player);
    checkNotNull(session);

    Collection<Vector> vertices = region.getVertices();
    Collection<Triangle> triangles = region.getTriangles();

    Map<Vector, Integer> vertexIds = new HashMap<Vector, Integer>(vertices.size());
    int lastVertexId = -1;
    for (Vector vertex : vertices) {
        vertexIds.put(vertex, ++lastVertexId);
        session.dispatchCUIEvent(player, new SelectionPointEvent(lastVertexId, vertex, getArea()));
    }

    for (Triangle triangle : triangles) {
        final int[] v = new int[3];
        for (int i = 0; i < 3; ++i) {
            v[i] = vertexIds.get(triangle.getVertex(i));
        }
        session.dispatchCUIEvent(player, new SelectionPolygonEvent(v));
    }
}
 
Example #18
Source File: ToolCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"lrbuild", "/lrbuild"},
        usage = "<leftclick block> <rightclick block>",
        desc = "Long-range building tool",
        min = 2,
        max = 2
)
@CommandPermissions("worldedit.tool.lrbuild")
public void longrangebuildtool(Player player, LocalSession session, CommandContext args) throws WorldEditException {

    BaseBlock secondary = we.getBlock(player, args.getString(0));
    BaseBlock primary = we.getBlock(player, args.getString(1));
    session.setTool(new LongRangeBuildTool(primary, secondary), player);
    BBC.TOOL_LRBUILD_BOUND.send(player, ItemType.toHeldName(player.getItemInHand()));
    BBC.TOOL_LRBUILD_INFO.send(player, ItemType.toName(secondary.getType()), ItemType.toName(primary.getType()));
}
 
Example #19
Source File: SelectionCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"/hpos1"},
        usage = "",
        desc = "Set position 1 to targeted block",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.selection.hpos")
public void hpos1(Player player, LocalSession session, CommandContext args) throws WorldEditException {
    Vector pos = player.getBlockTrace(300);

    if (pos != null) {
        if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos, ActorSelectorLimits.forActor(player))) {
            BBC.SELECTOR_ALREADY_SET.send(player);
            return;
        }

        session.getRegionSelector(player.getWorld())
                .explainPrimarySelection(player, session, pos);
    } else {
        player.printError("No block in sight!");
    }
}
 
Example #20
Source File: NavigationCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"ceil"},
        usage = "[clearance]",
        desc = "Go to the celing",
        flags = "fg",
        min = 0,
        max = 1
)
@CommandPermissions("worldedit.navigation.ceiling")
@Logging(POSITION)
public void ceiling(Player player, LocalSession session, CommandContext args) throws WorldEditException {

    final int clearance = args.argsLength() > 0 ?
            Math.max(0, args.getInteger(0)) : 0;

    final boolean alwaysGlass = getAlwaysGlass(args);
    if (player.ascendToCeiling(clearance, alwaysGlass)) {
        BBC.WHOOSH.send(player);
    } else {
        BBC.ASCEND_FAIL.send(player);
    }
}
 
Example #21
Source File: SchematicCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"remap"},
        help = "Remap a clipboard between MCPE/PC values\n",
        desc = "Remap a clipboard between MCPE/PC values\n"
)
@Deprecated
@CommandPermissions({"worldedit.schematic.remap"})
public void remap(final Player player, final LocalSession session) throws WorldEditException {
    ClipboardRemapper remapper;
    if (Fawe.imp().getPlatform().equalsIgnoreCase("nukkit")) {
        remapper = new ClipboardRemapper(ClipboardRemapper.RemapPlatform.PC, ClipboardRemapper.RemapPlatform.PE);
    } else {
        remapper = new ClipboardRemapper(ClipboardRemapper.RemapPlatform.PE, ClipboardRemapper.RemapPlatform.PC);
    }

    for (Clipboard clip : session.getClipboard().getClipboards()) {
        remapper.apply(clip);
    }
    player.print(BBC.getPrefix() + "Remapped schematic");
}
 
Example #22
Source File: BrushOptionsCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"primary"},
        usage = "[brush-arguments]",
        desc = "Set the right click brush",
        help = "Set the right click brush",
        min = 1
)
public void primary(Player player, LocalSession session, CommandContext args) throws WorldEditException {
    BaseBlock item = player.getBlockInHand();
    BrushTool tool = session.getBrushTool(player, false);
    session.setTool(item, null, player);
    String cmd = "brush " + args.getJoinedStrings(0);
    CommandEvent event = new CommandEvent(player, cmd);
    CommandManager.getInstance().handleCommandOnCurrentThread(event);
    BrushTool newTool = session.getBrushTool(item, player, false);
    if (newTool != null && tool != null) {
        newTool.setSecondary(tool.getSecondary());
    }
}
 
Example #23
Source File: FloodFillTool.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) {
    World world = (World) clicked.getExtent();

    int initialType = world.getBlockType(clicked.toVector());

    if (initialType == BlockID.AIR) {
        return true;
    }

    if (initialType == BlockID.BEDROCK && !player.canDestroyBedrock()) {
        return true;
    }

    EditSession editSession = session.createEditSession(player);

    try {
        recurse(server, editSession, world, clicked.toVector().toBlockVector(),
                clicked.toVector(), range, initialType, new HashSet<BlockVector>());
    } catch (WorldEditException e) {
        throw new RuntimeException(e);
    }
    editSession.flushQueue();
    session.remember(editSession);
    return true;
}
 
Example #24
Source File: TransformCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Command(
        aliases = {"#linear", "#l"},
        desc = "Sequentially pick from a list of transform",
        usage = "<transform>",
        min = 1,
        max = 2
)
public ResettableExtent linear(Actor actor, LocalSession session, @Optional("#null") ResettableExtent other) {
    if (other instanceof RandomTransform) {
        Set<ResettableExtent> extents = ((RandomTransform) other).getExtents();
        return new LinearTransform(extents.toArray(new ResettableExtent[extents.size()]));
    }
    return other;
}
 
Example #25
Source File: TransformCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Command(
        aliases = {"#spread", "#randomoffset"},
        desc = "Random offset transform",
        usage = "<dx> <dy> <dz> [transform]",
        min = 3,
        max = 4
)
public ResettableExtent randomoffset(Actor actor, LocalSession session, double x, double y, double z, @Optional("#null") ResettableExtent other) {
    return new RandomOffsetTransform(other, (int) x, (int) y, (int) z);
}
 
Example #26
Source File: Polygonal2DRegionSelector.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void explainSecondarySelection(Actor player, LocalSession session, Vector pos) {
    BBC.SELECTOR_POS.send(player, region.size(), pos, region.getArea());

    session.dispatchCUIEvent(player, new SelectionPoint2DEvent(region.size() - 1, pos, getArea()));
    session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinimumY(), region.getMaximumY()));
}
 
Example #27
Source File: ConvexPolyhedralRegionSelector.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void explainPrimarySelection(Actor player, LocalSession session, Vector pos) {
    checkNotNull(player);
    checkNotNull(session);
    checkNotNull(pos);

    session.describeCUI(player);

    BBC.SELECTOR_POS.send(player, 1, pos, region.getArea());
}
 
Example #28
Source File: Polygonal2DRegionSelector.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void describeCUI(LocalSession session, Actor player) {
    final List<BlockVector2D> points = region.getPoints();
    for (int id = 0; id < points.size(); id++) {
        session.dispatchCUIEvent(player, new SelectionPoint2DEvent(id, points.get(id), getArea()));
    }

    session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinimumY(), region.getMaximumY()));
}
 
Example #29
Source File: TransformCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Command(
        aliases = {"#offset"},
        desc = "Offset transform",
        usage = "<dx> <dy> <dz> [transform]",
        min = 3,
        max = 4
)
public ResettableExtent offset(Actor actor, LocalSession session, double x, double y, double z, @Optional("#null") ResettableExtent other) {
    return new OffsetExtent(other, (int) x, (int) y, (int) z);
}
 
Example #30
Source File: ToolCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Command(
        aliases = {"cycler"},
        usage = "",
        desc = "Block data cycler tool",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.tool.data-cycler")
public void cycler(Player player, LocalSession session, CommandContext args) throws WorldEditException {

    session.setTool(new BlockDataCyler(), player);
    BBC.TOOL_CYCLER.send(player, ItemType.toHeldName(player.getItemInHand()));
}