Package com.sk89q.worldedit.extent.clipboard

Examples of com.sk89q.worldedit.extent.clipboard.Clipboard


            "stood relative to the copied area when you copied it."
    )
    @CommandPermissions("worldedit.brush.clipboard")
    public void clipboardBrush(Player player, LocalSession session, EditSession editSession, @Switch('a') boolean ignoreAir, @Switch('p') boolean usingOrigin) throws WorldEditException {
        ClipboardHolder holder = session.getClipboard();
        Clipboard clipboard = holder.getClipboard();

        Vector size = clipboard.getDimensions();

        worldEdit.checkMaxBrushRadius(size.getBlockX());
        worldEdit.checkMaxBrushRadius(size.getBlockY());
        worldEdit.checkMaxBrushRadius(size.getBlockZ());
View Full Code Here


    public void paste(Player player, LocalSession session, EditSession editSession,
                      @Switch('a') boolean ignoreAirBlocks, @Switch('o') boolean atOrigin,
                      @Switch('s') boolean selectPasted) throws WorldEditException {

        ClipboardHolder holder = session.getClipboard();
        Clipboard clipboard = holder.getClipboard();
        Region region = clipboard.getRegion();

        Vector to = atOrigin ? clipboard.getOrigin() : session.getPlacementPosition(player);
        Operation operation = holder
                .createPaste(editSession, editSession.getWorld().getWorldData())
                .to(to)
                .ignoreAirBlocks(ignoreAirBlocks)
                .build();
View Full Code Here

    )
    @CommandPermissions("worldedit.clipboard.flip")
    public void flip(Player player, LocalSession session, EditSession editSession,
                     @Optional(Direction.AIM) @Direction Vector direction) throws WorldEditException {
        ClipboardHolder holder = session.getClipboard();
        Clipboard clipboard = holder.getClipboard();
        AffineTransform transform = new AffineTransform();
        transform = transform.scale(direction.positive().multiply(-2).add(1, 1, 1));
        holder.setTransform(holder.getTransform().combine(transform));
        player.print("The clipboard copy has been flipped.");
    }
View Full Code Here

    @CommandPermissions("worldedit.selection.size")
    public void size(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
       
        if (args.hasFlag('c')) {
            ClipboardHolder holder = session.getClipboard();
            Clipboard clipboard = holder.getClipboard();
            Region region = clipboard.getRegion();
            Vector size = region.getMaximumPoint().subtract(region.getMinimumPoint());
            Vector origin = clipboard.getOrigin();

            player.print("Cuboid dimensions (max - min): " + size);
            player.print("Offset: " + origin);
            player.print("Cuboid distance: " + size.distance(Vector.ONE));
            player.print("# of blocks: " + (int) (size.getX() * size.getY() * size.getZ()));
 
View Full Code Here

            LocalSession session = context.requireSession();

            if (session != null) {
                try {
                    ClipboardHolder holder = session.getClipboard();
                    Clipboard clipboard = holder.getClipboard();
                    return new ClipboardPattern(clipboard);
                } catch (EmptyClipboardException e) {
                    throw new InputParseException("To use #clipboard, please first copy something to your clipboard");
                }
            } else {
View Full Code Here

                FileInputStream fis = closer.register(new FileInputStream(f));
                BufferedInputStream bis = closer.register(new BufferedInputStream(fis));
                ClipboardReader reader = format.getReader(bis);

                WorldData worldData = player.getWorld().getWorldData();
                Clipboard clipboard = reader.read(player.getWorld().getWorldData());
                session.setClipboard(new ClipboardHolder(clipboard, worldData));

                log.info(player.getName() + " loaded " + filePath);
                player.print(filename + " loaded. Paste it with //paste");
            }
View Full Code Here

            player.printError("Unknown schematic format: " + formatName);
            return;
        }

        ClipboardHolder holder = session.getClipboard();
        Clipboard clipboard = holder.getClipboard();
        Transform transform = holder.getTransform();
        Clipboard target;

        // If we have a transform, bake it into the copy
        if (!transform.isIdentity()) {
            FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform, holder.getWorldData());
            target = new BlockArrayClipboard(result.getTransformedRegion());
            target.setOrigin(clipboard.getOrigin());
            Operations.completeLegacy(result.copyTo(target));
        } else {
            target = clipboard;
        }
View Full Code Here

        this.usingOrigin = usingOrigin;
    }

    @Override
    public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException {
        Clipboard clipboard = holder.getClipboard();
        Region region = clipboard.getRegion();
        Vector centerOffset = region.getCenter().subtract(clipboard.getOrigin());

        Operation operation = holder
                .createPaste(editSession, editSession.getWorld().getWorldData())
                .to(usingOrigin ? position : position.subtract(centerOffset))
                .ignoreAirBlocks(ignoreAirBlocks)
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.extent.clipboard.Clipboard

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.