Search in sources :

Example 1 with ClipboardBrush

use of com.sk89q.worldedit.command.tool.brush.ClipboardBrush in project FastAsyncWorldEdit by IntellectualSites.

the class BrushCommands method clipboardBrush.

@Command(name = "clipboard", desc = "@Deprecated use instead: `/br copypaste`)", descFooter = "Choose the clipboard brush.\n" + "Without the -o flag, the paste will appear centered at the target location. " + "With the flag, then the paste will appear relative to where you had " + "stood relative to the copied area when you copied it.")
@Deprecated
@CommandPermissions("worldedit.brush.clipboard")
public void clipboardBrush(Player player, LocalSession session, @Switch(name = 'a', desc = "Don't paste air from the clipboard") boolean ignoreAir, @Switch(name = 'o', desc = "Paste starting at the target location, instead of centering on it") boolean usingOrigin, @Switch(name = 'e', desc = "Paste entities if available") boolean pasteEntities, @Switch(name = 'b', desc = "Paste biomes if available") boolean pasteBiomes, @ArgFlag(name = 'm', desc = "Skip blocks matching this mask in the clipboard") @ClipboardMask Mask sourceMask, InjectedValueAccess context) throws WorldEditException {
    ClipboardHolder holder = session.getClipboard();
    Clipboard clipboard = holder.getClipboard();
    ClipboardHolder newHolder = new ClipboardHolder(clipboard);
    newHolder.setTransform(holder.getTransform());
    BlockVector3 size = clipboard.getDimensions();
    worldEdit.checkMaxBrushRadius(size.getBlockX() / 2D - 1);
    worldEdit.checkMaxBrushRadius(size.getBlockY() / 2D - 1);
    worldEdit.checkMaxBrushRadius(size.getBlockZ() / 2D - 1);
    set(context, new ClipboardBrush(newHolder, ignoreAir, usingOrigin, pasteEntities, pasteBiomes, sourceMask), "worldedit.brush.clipboard");
}
Also used : MultiClipboardHolder(com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder) ClipboardHolder(com.sk89q.worldedit.session.ClipboardHolder) Clipboard(com.sk89q.worldedit.extent.clipboard.Clipboard) BlockVector3(com.sk89q.worldedit.math.BlockVector3) ClipboardBrush(com.sk89q.worldedit.command.tool.brush.ClipboardBrush) ScatterCommand(com.fastasyncworldedit.core.command.tool.brush.ScatterCommand) Command(org.enginehub.piston.annotation.Command) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Aggregations

ScatterCommand (com.fastasyncworldedit.core.command.tool.brush.ScatterCommand)1 MultiClipboardHolder (com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder)1 ClipboardBrush (com.sk89q.worldedit.command.tool.brush.ClipboardBrush)1 CommandPermissions (com.sk89q.worldedit.command.util.CommandPermissions)1 Clipboard (com.sk89q.worldedit.extent.clipboard.Clipboard)1 BlockVector3 (com.sk89q.worldedit.math.BlockVector3)1 ClipboardHolder (com.sk89q.worldedit.session.ClipboardHolder)1 Command (org.enginehub.piston.annotation.Command)1