Search in sources :

Example 16 with Preload

use of com.sk89q.worldedit.command.util.annotation.Preload in project FastAsyncWorldEdit by IntellectualSites.

the class RegionCommands method hollow.

@Command(name = "/hollow", desc = "Hollows out the object contained in this selection", descFooter = "Hollows out the object contained in this selection.\n" + "Optionally fills the hollowed out part with the given block.\n" + "Thickness is measured in manhattan distance.")
@CommandPermissions("worldedit.region.hollow")
@Logging(REGION)
@Preload(Preload.PreloadCheck.PRELOAD)
@Confirm(Confirm.Processor.REGION)
public int hollow(Actor actor, EditSession editSession, @Selection Region region, @Arg(desc = "Thickness of the shell to leave", def = "0") int thickness, @Arg(desc = "The pattern of blocks to replace the hollowed area with", def = "air") Pattern pattern, @ArgFlag(name = 'm', desc = "Mask to hollow with") Mask mask) throws WorldEditException {
    checkCommandArgument(thickness >= 0, "Thickness must be >= 0");
    // FAWE start > the mask will have been initialised with a WorldWrapper extent (very bad/slow)
    Mask finalMask;
    if (mask != null) {
        new MaskTraverser(mask).setNewExtent(editSession);
        finalMask = mask;
    } else {
        finalMask = new SolidBlockMask(editSession);
    }
    // FAWE end
    int affected = editSession.hollowOutRegion(region, thickness, pattern, finalMask);
    actor.print(Caption.of("worldedit.hollow.changed", TextComponent.of(affected)));
    return affected;
}
Also used : SolidBlockMask(com.sk89q.worldedit.function.mask.SolidBlockMask) ExistingBlockMask(com.sk89q.worldedit.function.mask.ExistingBlockMask) Mask(com.sk89q.worldedit.function.mask.Mask) SolidBlockMask(com.sk89q.worldedit.function.mask.SolidBlockMask) MaskTraverser(com.fastasyncworldedit.core.util.MaskTraverser) Logging(com.sk89q.worldedit.command.util.Logging) Preload(com.sk89q.worldedit.command.util.annotation.Preload) Command(org.enginehub.piston.annotation.Command) Confirm(com.sk89q.worldedit.command.util.annotation.Confirm) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Aggregations

CommandPermissions (com.sk89q.worldedit.command.util.CommandPermissions)16 Preload (com.sk89q.worldedit.command.util.annotation.Preload)16 Command (org.enginehub.piston.annotation.Command)16 Logging (com.sk89q.worldedit.command.util.Logging)15 Confirm (com.sk89q.worldedit.command.util.annotation.Confirm)15 MaskTraverser (com.fastasyncworldedit.core.util.MaskTraverser)9 BlockVector3 (com.sk89q.worldedit.math.BlockVector3)7 Mask (com.sk89q.worldedit.function.mask.Mask)6 ExistingBlockMask (com.sk89q.worldedit.function.mask.ExistingBlockMask)5 FaweLimit (com.fastasyncworldedit.core.limit.FaweLimit)3 SolidBlockMask (com.sk89q.worldedit.function.mask.SolidBlockMask)3 Region (com.sk89q.worldedit.regions.Region)3 MultiClipboardHolder (com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder)2 URIClipboardHolder (com.fastasyncworldedit.core.extent.clipboard.URIClipboardHolder)2 BlockArrayClipboard (com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard)2 MaskIntersection (com.sk89q.worldedit.function.mask.MaskIntersection)2 RegionMask (com.sk89q.worldedit.function.mask.RegionMask)2 ForwardExtentCopy (com.sk89q.worldedit.function.operation.ForwardExtentCopy)2 ClipboardMask (com.sk89q.worldedit.internal.annotation.ClipboardMask)2 ExpressionException (com.sk89q.worldedit.internal.expression.ExpressionException)2