Search in sources :

Example 1 with CuboidRegionSelector

use of com.sk89q.worldedit.regions.selector.CuboidRegionSelector in project FastAsyncWorldEdit by IntellectualSites.

the class AbstractPlayerActor method setSelection.

@Override
public void setSelection(Region region) {
    RegionSelector selector;
    if (region instanceof ConvexPolyhedralRegion) {
        selector = new ConvexPolyhedralRegionSelector((ConvexPolyhedralRegion) region);
    } else if (region instanceof CylinderRegion) {
        selector = new CylinderRegionSelector((CylinderRegion) region);
    } else if (region instanceof Polygonal2DRegion) {
        selector = new Polygonal2DRegionSelector((Polygonal2DRegion) region);
    } else {
        selector = new CuboidRegionSelector(null, region.getMinimumPoint(), region.getMaximumPoint());
    }
    selector.setWorld(region.getWorld());
    getSession().setRegionSelector(getWorld(), selector);
}
Also used : CuboidRegionSelector(com.sk89q.worldedit.regions.selector.CuboidRegionSelector) CylinderRegionSelector(com.sk89q.worldedit.regions.selector.CylinderRegionSelector) Polygonal2DRegionSelector(com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector) ConvexPolyhedralRegionSelector(com.sk89q.worldedit.regions.selector.ConvexPolyhedralRegionSelector) RegionSelector(com.sk89q.worldedit.regions.RegionSelector) ConvexPolyhedralRegionSelector(com.sk89q.worldedit.regions.selector.ConvexPolyhedralRegionSelector) Polygonal2DRegion(com.sk89q.worldedit.regions.Polygonal2DRegion) Polygonal2DRegionSelector(com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector) ConvexPolyhedralRegion(com.sk89q.worldedit.regions.ConvexPolyhedralRegion) CylinderRegion(com.sk89q.worldedit.regions.CylinderRegion) CylinderRegionSelector(com.sk89q.worldedit.regions.selector.CylinderRegionSelector) CuboidRegionSelector(com.sk89q.worldedit.regions.selector.CuboidRegionSelector)

Example 2 with CuboidRegionSelector

use of com.sk89q.worldedit.regions.selector.CuboidRegionSelector in project FastAsyncWorldEdit by IntellectualSites.

the class SelectionCommands method chunk.

@Command(name = "/chunk", desc = "Set the selection to your current chunk.", descFooter = "This command selects 256-block-tall areas,\nwhich can be specified by the y-coordinate.\nE.g. -c x,1,z will select from y=256 to y=511.")
@Logging(POSITION)
@CommandPermissions("worldedit.selection.chunk")
public void chunk(Actor actor, World world, LocalSession session, @Arg(desc = "The chunk to select", def = "") BlockVector3 coordinates, @Switch(name = 's', desc = "Expand your selection to encompass all chunks that are part of it") boolean expandSelection, @Switch(name = 'c', desc = "Use chunk coordinates instead of block coordinates") boolean useChunkCoordinates) throws WorldEditException {
    final BlockVector3 min;
    final BlockVector3 max;
    if (expandSelection) {
        Region region = session.getSelection(world);
        int minChunkY = world.getMinY() >> CHUNK_SHIFTS_Y;
        int maxChunkY = world.getMaxY() >> CHUNK_SHIFTS_Y;
        BlockVector3 minChunk = ChunkStore.toChunk3d(region.getMinimumPoint()).clampY(minChunkY, maxChunkY);
        BlockVector3 maxChunk = ChunkStore.toChunk3d(region.getMaximumPoint()).clampY(minChunkY, maxChunkY);
        min = minChunk.shl(CHUNK_SHIFTS, CHUNK_SHIFTS_Y, CHUNK_SHIFTS);
        max = maxChunk.shl(CHUNK_SHIFTS, CHUNK_SHIFTS_Y, CHUNK_SHIFTS).add(15, 255, 15);
        actor.print(Caption.of("worldedit.chunk.selected-multiple", TextComponent.of(minChunk.getBlockX()), TextComponent.of(minChunk.getBlockY()), TextComponent.of(minChunk.getBlockZ()), TextComponent.of(maxChunk.getBlockX()), TextComponent.of(maxChunk.getBlockY()), TextComponent.of(maxChunk.getBlockZ())));
    } else {
        BlockVector3 minChunk;
        if (coordinates != null) {
            // coords specified
            minChunk = useChunkCoordinates ? coordinates : ChunkStore.toChunk3d(coordinates);
        } else {
            // use player loc
            if (actor instanceof Locatable) {
                minChunk = ChunkStore.toChunk3d(((Locatable) actor).getBlockLocation().toVector().toBlockPoint());
            } else {
                throw new StopExecutionException(TextComponent.of("A player or coordinates are required."));
            }
        }
        min = minChunk.shl(CHUNK_SHIFTS, CHUNK_SHIFTS_Y, CHUNK_SHIFTS);
        max = min.add(15, 255, 15);
        actor.print(Caption.of("worldedit.chunk.selected", TextComponent.of(minChunk.getBlockX()), TextComponent.of(minChunk.getBlockY()), TextComponent.of(minChunk.getBlockZ())));
    }
    final CuboidRegionSelector selector;
    if (session.getRegionSelector(world) instanceof ExtendingCuboidRegionSelector) {
        selector = new ExtendingCuboidRegionSelector(world);
    } else {
        selector = new CuboidRegionSelector(world);
    }
    selector.selectPrimary(min, ActorSelectorLimits.forActor(actor));
    selector.selectSecondary(max, ActorSelectorLimits.forActor(actor));
    session.setRegionSelector(world, selector);
    session.dispatchCUISelection(actor);
}
Also used : StopExecutionException(org.enginehub.piston.exception.StopExecutionException) Region(com.sk89q.worldedit.regions.Region) ExtendingCuboidRegionSelector(com.sk89q.worldedit.regions.selector.ExtendingCuboidRegionSelector) CuboidRegionSelector(com.sk89q.worldedit.regions.selector.CuboidRegionSelector) BlockVector3(com.sk89q.worldedit.math.BlockVector3) ExtendingCuboidRegionSelector(com.sk89q.worldedit.regions.selector.ExtendingCuboidRegionSelector) Locatable(com.sk89q.worldedit.extension.platform.Locatable) Logging(com.sk89q.worldedit.command.util.Logging) Command(org.enginehub.piston.annotation.Command) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Example 3 with CuboidRegionSelector

use of com.sk89q.worldedit.regions.selector.CuboidRegionSelector in project FastAsyncWorldEdit by IntellectualSites.

the class SelectionCommands method select.

@Command(name = "/sel", aliases = { ";", "/desel", "/deselect" }, desc = "Choose a region selector")
// FAWE start
@CommandPermissions("worldedit.analysis.sel")
public // FAWE end
void select(Actor actor, World world, LocalSession session, @Arg(desc = "Selector to switch to", def = "") SelectorChoice selector, @Switch(name = 'd', desc = "Set default selector") boolean setDefaultSelector) throws WorldEditException {
    if (selector == null) {
        session.getRegionSelector(world).clear();
        session.dispatchCUISelection(actor);
        actor.print(Caption.of("worldedit.select.cleared"));
        return;
    }
    final RegionSelector oldSelector = session.getRegionSelector(world);
    final RegionSelector newSelector;
    switch(selector) {
        case CUBOID:
            newSelector = new CuboidRegionSelector(oldSelector);
            actor.print(Caption.of("worldedit.select.cuboid.message"));
            break;
        case EXTEND:
            newSelector = new ExtendingCuboidRegionSelector(oldSelector);
            actor.print(Caption.of("worldedit.select.extend.message"));
            break;
        case POLY:
            {
                newSelector = new Polygonal2DRegionSelector(oldSelector);
                actor.print(Caption.of("worldedit.select.poly.message"));
                Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolygonVertexLimit();
                limit.ifPresent(integer -> actor.print(Caption.of("worldedit.select.poly.limit-message", TextComponent.of(integer))));
                break;
            }
        case ELLIPSOID:
            newSelector = new EllipsoidRegionSelector(oldSelector);
            actor.print(Caption.of("worldedit.select.ellipsoid.message"));
            break;
        case SPHERE:
            newSelector = new SphereRegionSelector(oldSelector);
            actor.print(Caption.of("worldedit.select.sphere.message"));
            break;
        case CYL:
            newSelector = new CylinderRegionSelector(oldSelector);
            actor.print(Caption.of("worldedit.select.cyl.message"));
            break;
        case CONVEX:
        case HULL:
        case POLYHEDRON:
            {
                newSelector = new ConvexPolyhedralRegionSelector(oldSelector);
                actor.print(Caption.of("worldedit.select.convex.message"));
                Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolyhedronVertexLimit();
                limit.ifPresent(integer -> actor.print(Caption.of("worldedit.select.convex.limit-message", TextComponent.of(integer))));
                break;
            }
        // FAWE start
        case POLYHEDRAL:
            newSelector = new PolyhedralRegionSelector(world);
            actor.print(Caption.of("fawe.selection.sel.convex.polyhedral"));
            Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolyhedronVertexLimit();
            limit.ifPresent(integer -> actor.print(Caption.of("fawe.selection.sel.max", integer)));
            actor.print(Caption.of("fawe.selection.sel.list"));
            break;
        case FUZZY:
        case MAGIC:
            Mask maskOpt = new IdMask(world);
            newSelector = new FuzzyRegionSelector(actor, world, maskOpt);
            actor.print(Caption.of("fawe.selection.sel.fuzzy"));
            actor.print(Caption.of("fawe.selection.sel.list"));
            break;
        // FAWE end
        case LIST:
        default:
            CommandListBox box = new CommandListBox("Selection modes", null, null);
            box.setHidingHelp(true);
            TextComponentProducer contents = box.getContents();
            contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline();
            box.appendCommand("cuboid", Caption.of("worldedit.select.cuboid.description"), "//sel cuboid");
            box.appendCommand("extend", Caption.of("worldedit.select.extend.description"), "//sel extend");
            box.appendCommand("poly", Caption.of("worldedit.select.poly.description"), "//sel poly");
            box.appendCommand("ellipsoid", Caption.of("worldedit.select.ellipsoid.description"), "//sel ellipsoid");
            box.appendCommand("sphere", Caption.of("worldedit.select.sphere.description"), "//sel sphere");
            box.appendCommand("cyl", Caption.of("worldedit.select.cyl.description"), "//sel cyl");
            box.appendCommand("convex", Caption.of("worldedit.select.convex.description"), "//sel convex");
            // FAWE start
            box.appendCommand("polyhedral", Caption.of("fawe.selection.sel.polyhedral"), "//sel polyhedral");
            box.appendCommand("fuzzy[=<mask>]", Caption.of("fawe.selection.sel.fuzzy-instruction"), "//sel fuzzy[=<mask>]");
            box.setComponentsPerPage(box.getComponentsSize());
            // FAWE end
            actor.print(box.create(1));
            return;
    }
    if (setDefaultSelector) {
        RegionSelectorType found = null;
        for (RegionSelectorType type : RegionSelectorType.values()) {
            if (type.getSelectorClass() == newSelector.getClass()) {
                found = type;
                break;
            }
        }
        if (found != null) {
            session.setDefaultRegionSelector(found);
            actor.print(Caption.of("worldedit.select.default-set", TextComponent.of(found.name())));
        } else {
            throw new RuntimeException("Something unexpected happened. Please report this.");
        }
    }
    session.setRegionSelector(world, newSelector);
    session.dispatchCUISelection(actor);
}
Also used : EditSession(com.sk89q.worldedit.EditSession) ChunkStore(com.sk89q.worldedit.world.storage.ChunkStore) BlockVector3(com.sk89q.worldedit.math.BlockVector3) Player(com.sk89q.worldedit.entity.Player) World(com.sk89q.worldedit.world.World) Caption(com.fastasyncworldedit.core.configuration.Caption) BaseItemStack(com.sk89q.worldedit.blocks.BaseItemStack) Arg(org.enginehub.piston.annotation.param.Arg) MaskTraverser(com.fastasyncworldedit.core.util.MaskTraverser) ExtendingCuboidRegionSelector(com.sk89q.worldedit.regions.selector.ExtendingCuboidRegionSelector) Component(com.sk89q.worldedit.util.formatting.text.Component) RegionOperationException(com.sk89q.worldedit.regions.RegionOperationException) SelectionWand(com.sk89q.worldedit.command.tool.SelectionWand) CommandContainer(org.enginehub.piston.annotation.CommandContainer) TextColor(com.sk89q.worldedit.util.formatting.text.format.TextColor) NavigationWand(com.sk89q.worldedit.command.tool.NavigationWand) SelectorChoice(com.sk89q.worldedit.command.argument.SelectorChoice) Operations(com.sk89q.worldedit.function.operation.Operations) Location(com.sk89q.worldedit.util.Location) URI(java.net.URI) POSITION(com.sk89q.worldedit.command.util.Logging.LogMode.POSITION) MultiDirection(com.sk89q.worldedit.internal.annotation.MultiDirection) Polygonal2DRegionSelector(com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector) Clipboard(com.sk89q.worldedit.extent.clipboard.Clipboard) BlockType(com.sk89q.worldedit.world.block.BlockType) URIClipboardHolder(com.fastasyncworldedit.core.extent.clipboard.URIClipboardHolder) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions) Locatable(com.sk89q.worldedit.extension.platform.Locatable) ConvexPolyhedralRegionSelector(com.sk89q.worldedit.regions.selector.ConvexPolyhedralRegionSelector) SubtleFormat(com.sk89q.worldedit.util.formatting.component.SubtleFormat) CHUNK_SHIFTS_Y(com.sk89q.worldedit.world.storage.ChunkStore.CHUNK_SHIFTS_Y) InvalidComponentException(com.sk89q.worldedit.util.formatting.component.InvalidComponentException) ArgFlag(org.enginehub.piston.annotation.param.ArgFlag) TextComponentProducer(com.sk89q.worldedit.util.formatting.component.TextComponentProducer) CommandListBox(com.sk89q.worldedit.util.formatting.component.CommandListBox) List(java.util.List) Stream(java.util.stream.Stream) StopExecutionException(org.enginehub.piston.exception.StopExecutionException) CommandPermissionsConditionGenerator(com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator) PaginationBox(com.sk89q.worldedit.util.formatting.component.PaginationBox) ActorSelectorLimits(com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits) Optional(java.util.Optional) Countable(com.sk89q.worldedit.util.Countable) RegionSelector(com.sk89q.worldedit.regions.RegionSelector) BlockDistributionCounter(com.sk89q.worldedit.function.block.BlockDistributionCounter) CuboidRegionSelector(com.sk89q.worldedit.regions.selector.CuboidRegionSelector) ClipboardHolder(com.sk89q.worldedit.session.ClipboardHolder) Switch(org.enginehub.piston.annotation.param.Switch) Logging(com.sk89q.worldedit.command.util.Logging) HoverEvent(com.sk89q.worldedit.util.formatting.text.event.HoverEvent) CHUNK_SHIFTS(com.sk89q.worldedit.world.storage.ChunkStore.CHUNK_SHIFTS) EllipsoidRegionSelector(com.sk89q.worldedit.regions.selector.EllipsoidRegionSelector) Strings(com.google.common.base.Strings) WorldEditException(com.sk89q.worldedit.WorldEditException) RegionSelectorType(com.sk89q.worldedit.regions.selector.RegionSelectorType) PolyhedralRegionSelector(com.fastasyncworldedit.core.regions.selector.PolyhedralRegionSelector) ClickEvent(com.sk89q.worldedit.util.formatting.text.event.ClickEvent) CylinderRegionSelector(com.sk89q.worldedit.regions.selector.CylinderRegionSelector) WorldEdit(com.sk89q.worldedit.WorldEdit) Region(com.sk89q.worldedit.regions.Region) SphereRegionSelector(com.sk89q.worldedit.regions.selector.SphereRegionSelector) TextComponent(com.sk89q.worldedit.util.formatting.text.TextComponent) ItemTypes(com.sk89q.worldedit.world.item.ItemTypes) REGION(com.sk89q.worldedit.command.util.Logging.LogMode.REGION) RegionVisitor(com.sk89q.worldedit.function.visitor.RegionVisitor) File(java.io.File) Actor(com.sk89q.worldedit.extension.platform.Actor) Direction(com.sk89q.worldedit.internal.annotation.Direction) IdMask(com.fastasyncworldedit.core.function.mask.IdMask) FuzzyRegionSelector(com.fastasyncworldedit.core.regions.selector.FuzzyRegionSelector) Command(org.enginehub.piston.annotation.Command) LocalSession(com.sk89q.worldedit.LocalSession) Mask(com.sk89q.worldedit.function.mask.Mask) BlockState(com.sk89q.worldedit.world.block.BlockState) ItemType(com.sk89q.worldedit.world.item.ItemType) CommandListBox(com.sk89q.worldedit.util.formatting.component.CommandListBox) TextComponentProducer(com.sk89q.worldedit.util.formatting.component.TextComponentProducer) Optional(java.util.Optional) Polygonal2DRegionSelector(com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector) IdMask(com.fastasyncworldedit.core.function.mask.IdMask) Mask(com.sk89q.worldedit.function.mask.Mask) CylinderRegionSelector(com.sk89q.worldedit.regions.selector.CylinderRegionSelector) ExtendingCuboidRegionSelector(com.sk89q.worldedit.regions.selector.ExtendingCuboidRegionSelector) CuboidRegionSelector(com.sk89q.worldedit.regions.selector.CuboidRegionSelector) ExtendingCuboidRegionSelector(com.sk89q.worldedit.regions.selector.ExtendingCuboidRegionSelector) EllipsoidRegionSelector(com.sk89q.worldedit.regions.selector.EllipsoidRegionSelector) FuzzyRegionSelector(com.fastasyncworldedit.core.regions.selector.FuzzyRegionSelector) ExtendingCuboidRegionSelector(com.sk89q.worldedit.regions.selector.ExtendingCuboidRegionSelector) Polygonal2DRegionSelector(com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector) ConvexPolyhedralRegionSelector(com.sk89q.worldedit.regions.selector.ConvexPolyhedralRegionSelector) RegionSelector(com.sk89q.worldedit.regions.RegionSelector) CuboidRegionSelector(com.sk89q.worldedit.regions.selector.CuboidRegionSelector) EllipsoidRegionSelector(com.sk89q.worldedit.regions.selector.EllipsoidRegionSelector) PolyhedralRegionSelector(com.fastasyncworldedit.core.regions.selector.PolyhedralRegionSelector) CylinderRegionSelector(com.sk89q.worldedit.regions.selector.CylinderRegionSelector) SphereRegionSelector(com.sk89q.worldedit.regions.selector.SphereRegionSelector) FuzzyRegionSelector(com.fastasyncworldedit.core.regions.selector.FuzzyRegionSelector) ConvexPolyhedralRegionSelector(com.sk89q.worldedit.regions.selector.ConvexPolyhedralRegionSelector) IdMask(com.fastasyncworldedit.core.function.mask.IdMask) ConvexPolyhedralRegionSelector(com.sk89q.worldedit.regions.selector.ConvexPolyhedralRegionSelector) PolyhedralRegionSelector(com.fastasyncworldedit.core.regions.selector.PolyhedralRegionSelector) SphereRegionSelector(com.sk89q.worldedit.regions.selector.SphereRegionSelector) RegionSelectorType(com.sk89q.worldedit.regions.selector.RegionSelectorType) Command(org.enginehub.piston.annotation.Command) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Example 4 with CuboidRegionSelector

use of com.sk89q.worldedit.regions.selector.CuboidRegionSelector in project FastAsyncWorldEdit by IntellectualSites.

the class ClipboardCommands method paste.

// FAWE end
@Command(name = "/paste", aliases = { "/p", "/pa" }, desc = "Paste the clipboard's contents")
@CommandPermissions("worldedit.clipboard.paste")
@Logging(PLACEMENT)
public void paste(Actor actor, World world, LocalSession session, EditSession editSession, @Switch(name = 'a', desc = "Skip air blocks") boolean ignoreAirBlocks, @Switch(name = 'o', desc = "Paste at the original position") boolean atOrigin, @Switch(name = 's', desc = "Select the region after pasting") boolean selectPasted, @Switch(name = 'n', desc = "No paste, select only. (Implies -s)") boolean onlySelect, @Switch(name = 'e', desc = "Paste entities if available") boolean pasteEntities, @Switch(name = 'b', desc = "Paste biomes if available") boolean pasteBiomes, @ArgFlag(name = 'm', desc = "Only paste blocks matching this mask") @ClipboardMask Mask sourceMask) throws WorldEditException {
    ClipboardHolder holder = session.getClipboard();
    if (holder.getTransform().isIdentity() && editSession.getSourceMask() == null) {
        // FAWE start - use place
        place(actor, world, session, editSession, ignoreAirBlocks, atOrigin, selectPasted, pasteEntities, pasteBiomes);
        // FAWE end
        return;
    }
    Clipboard clipboard = holder.getClipboard();
    Region region = clipboard.getRegion();
    List<Component> messages = Lists.newArrayList();
    BlockVector3 to = atOrigin ? clipboard.getOrigin() : session.getPlacementPosition(actor);
    // FAWE start
    checkPaste(actor, editSession, to, holder, clipboard);
    if (!onlySelect) {
        Operation operation = holder.createPaste(editSession).to(to).ignoreAirBlocks(ignoreAirBlocks).copyBiomes(pasteBiomes).copyEntities(pasteEntities).maskSource(sourceMask).build();
        Operations.completeLegacy(operation);
        messages.addAll(Lists.newArrayList(operation.getStatusMessages()));
    }
    if (selectPasted || onlySelect) {
        BlockVector3 clipboardOffset = clipboard.getRegion().getMinimumPoint().subtract(clipboard.getOrigin());
        Vector3 realTo = to.toVector3().add(holder.getTransform().apply(clipboardOffset.toVector3()));
        Vector3 max = realTo.add(holder.getTransform().apply(region.getMaximumPoint().subtract(region.getMinimumPoint()).toVector3()));
        RegionSelector selector = new CuboidRegionSelector(world, realTo.toBlockPoint(), max.toBlockPoint());
        session.setRegionSelector(world, selector);
        selector.learnChanges();
        selector.explainRegionAdjust(actor, session);
    }
    if (onlySelect) {
        actor.print(Caption.of("worldedit.paste.selected"));
    } else {
        actor.print(Caption.of("worldedit.paste.pasted", TextComponent.of(to.toString())));
    }
    messages.forEach(actor::print);
}
Also used : RegionSelector(com.sk89q.worldedit.regions.RegionSelector) CuboidRegionSelector(com.sk89q.worldedit.regions.selector.CuboidRegionSelector) MultiClipboardHolder(com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder) URIClipboardHolder(com.fastasyncworldedit.core.extent.clipboard.URIClipboardHolder) ClipboardHolder(com.sk89q.worldedit.session.ClipboardHolder) NullRegion(com.sk89q.worldedit.regions.NullRegion) Region(com.sk89q.worldedit.regions.Region) BlockVector3(com.sk89q.worldedit.math.BlockVector3) Vector3(com.sk89q.worldedit.math.Vector3) DiskOptimizedClipboard(com.fastasyncworldedit.core.extent.clipboard.DiskOptimizedClipboard) Clipboard(com.sk89q.worldedit.extent.clipboard.Clipboard) BlockArrayClipboard(com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard) ReadOnlyClipboard(com.fastasyncworldedit.core.extent.clipboard.ReadOnlyClipboard) Operation(com.sk89q.worldedit.function.operation.Operation) CuboidRegionSelector(com.sk89q.worldedit.regions.selector.CuboidRegionSelector) Component(com.sk89q.worldedit.util.formatting.text.Component) TextComponent(com.sk89q.worldedit.util.formatting.text.TextComponent) BlockVector3(com.sk89q.worldedit.math.BlockVector3) Logging(com.sk89q.worldedit.command.util.Logging) Command(org.enginehub.piston.annotation.Command) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Example 5 with CuboidRegionSelector

use of com.sk89q.worldedit.regions.selector.CuboidRegionSelector in project FastAsyncWorldEdit by IntellectualSites.

the class CLIExtraCommands method selectWorld.

@Command(name = "selectworld", desc = "Select the entire world")
public void selectWorld(Actor actor, World world, LocalSession session) {
    session.setRegionSelector(world, new CuboidRegionSelector(world, world.getMinimumPoint(), world.getMaximumPoint()));
    actor.printInfo(TextComponent.of("Selected the entire world."));
}
Also used : CuboidRegionSelector(com.sk89q.worldedit.regions.selector.CuboidRegionSelector) Command(org.enginehub.piston.annotation.Command)

Aggregations

CuboidRegionSelector (com.sk89q.worldedit.regions.selector.CuboidRegionSelector)7 BlockVector3 (com.sk89q.worldedit.math.BlockVector3)5 RegionSelector (com.sk89q.worldedit.regions.RegionSelector)5 Command (org.enginehub.piston.annotation.Command)5 CommandPermissions (com.sk89q.worldedit.command.util.CommandPermissions)4 Logging (com.sk89q.worldedit.command.util.Logging)4 Region (com.sk89q.worldedit.regions.Region)4 URIClipboardHolder (com.fastasyncworldedit.core.extent.clipboard.URIClipboardHolder)3 Clipboard (com.sk89q.worldedit.extent.clipboard.Clipboard)3 ClipboardHolder (com.sk89q.worldedit.session.ClipboardHolder)3 DiskOptimizedClipboard (com.fastasyncworldedit.core.extent.clipboard.DiskOptimizedClipboard)2 MultiClipboardHolder (com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder)2 ReadOnlyClipboard (com.fastasyncworldedit.core.extent.clipboard.ReadOnlyClipboard)2 LocalSession (com.sk89q.worldedit.LocalSession)2 Locatable (com.sk89q.worldedit.extension.platform.Locatable)2 ConvexPolyhedralRegionSelector (com.sk89q.worldedit.regions.selector.ConvexPolyhedralRegionSelector)2 CylinderRegionSelector (com.sk89q.worldedit.regions.selector.CylinderRegionSelector)2 ExtendingCuboidRegionSelector (com.sk89q.worldedit.regions.selector.ExtendingCuboidRegionSelector)2 Polygonal2DRegionSelector (com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector)2 Component (com.sk89q.worldedit.util.formatting.text.Component)2