Search in sources :

Example 1 with SphereBrush

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

the class BrushCommands method sphereBrush.

@Command(name = "sphere", aliases = { "s" }, desc = "Choose the sphere brush")
@CommandPermissions("worldedit.brush.sphere")
public void sphereBrush(Player player, InjectedValueAccess context, @Arg(desc = "The pattern of blocks to set") Pattern pattern, @Arg(desc = "The radius of the sphere", def = "2") Expression radius, @Switch(name = 'h', desc = "Create hollow spheres instead") boolean hollow, @Switch(name = 'f', desc = "Create falling spheres instead") boolean falling) throws WorldEditException {
    worldEdit.checkMaxBrushRadius(radius);
    Brush brush;
    if (hollow) {
        brush = new HollowSphereBrush();
    } else {
        // FAWE start - Suggest different brush material if sand or gravel is used
        if (pattern instanceof BlockStateHolder) {
            BlockType type = ((BlockStateHolder) pattern).getBlockType();
            switch(type.getId()) {
                case "minecraft:sand":
                case "minecraft:gravel":
                    player.print(Caption.of("fawe.worldedit.brush.brush.try.other"));
                    falling = true;
                    break;
                default:
                    break;
            }
        }
        if (falling) {
            brush = new FallingSphere();
        } else {
            brush = new SphereBrush();
        }
    }
    // FAWE end
    set(context, brush, "worldedit.brush.sphere").setSize(radius).setFill(pattern);
}
Also used : HollowSphereBrush(com.sk89q.worldedit.command.tool.brush.HollowSphereBrush) BlockType(com.sk89q.worldedit.world.block.BlockType) BlockStateHolder(com.sk89q.worldedit.world.block.BlockStateHolder) FallingSphere(com.fastasyncworldedit.core.command.tool.brush.FallingSphere) HollowSphereBrush(com.sk89q.worldedit.command.tool.brush.HollowSphereBrush) HeightBrush(com.fastasyncworldedit.core.command.tool.brush.HeightBrush) SphereBrush(com.sk89q.worldedit.command.tool.brush.SphereBrush) ScatterBrush(com.fastasyncworldedit.core.command.tool.brush.ScatterBrush) CopyPastaBrush(com.fastasyncworldedit.core.command.tool.brush.CopyPastaBrush) RaiseBrush(com.fastasyncworldedit.core.command.tool.brush.RaiseBrush) SnowSmoothBrush(com.sk89q.worldedit.command.tool.brush.SnowSmoothBrush) ClipboardBrush(com.sk89q.worldedit.command.tool.brush.ClipboardBrush) GravityBrush(com.sk89q.worldedit.command.tool.brush.GravityBrush) FlattenBrush(com.fastasyncworldedit.core.command.tool.brush.FlattenBrush) BlobBrush(com.fastasyncworldedit.core.command.tool.brush.BlobBrush) SweepBrush(com.fastasyncworldedit.core.command.tool.sweep.SweepBrush) CircleBrush(com.fastasyncworldedit.core.command.tool.brush.CircleBrush) SplatterBrush(com.fastasyncworldedit.core.command.tool.brush.SplatterBrush) CatenaryBrush(com.fastasyncworldedit.core.command.tool.brush.CatenaryBrush) RecurseBrush(com.fastasyncworldedit.core.command.tool.brush.RecurseBrush) CylinderBrush(com.sk89q.worldedit.command.tool.brush.CylinderBrush) ScatterOverlayBrush(com.fastasyncworldedit.core.command.tool.brush.ScatterOverlayBrush) StencilBrush(com.fastasyncworldedit.core.command.tool.brush.StencilBrush) LineBrush(com.fastasyncworldedit.core.command.tool.brush.LineBrush) Brush(com.sk89q.worldedit.command.tool.brush.Brush) ButcherBrush(com.sk89q.worldedit.command.tool.brush.ButcherBrush) ErodeBrush(com.fastasyncworldedit.core.command.tool.brush.ErodeBrush) SurfaceSphereBrush(com.fastasyncworldedit.core.command.tool.brush.SurfaceSphereBrush) SplineBrush(com.fastasyncworldedit.core.command.tool.brush.SplineBrush) HollowCylinderBrush(com.sk89q.worldedit.command.tool.brush.HollowCylinderBrush) SmoothBrush(com.sk89q.worldedit.command.tool.brush.SmoothBrush) LayerBrush(com.fastasyncworldedit.core.command.tool.brush.LayerBrush) CommandBrush(com.fastasyncworldedit.core.command.tool.brush.CommandBrush) ImageBrush(com.fastasyncworldedit.core.command.tool.brush.ImageBrush) ShatterBrush(com.fastasyncworldedit.core.command.tool.brush.ShatterBrush) OperationFactoryBrush(com.sk89q.worldedit.command.tool.brush.OperationFactoryBrush) HollowSphereBrush(com.sk89q.worldedit.command.tool.brush.HollowSphereBrush) SphereBrush(com.sk89q.worldedit.command.tool.brush.SphereBrush) SurfaceSphereBrush(com.fastasyncworldedit.core.command.tool.brush.SurfaceSphereBrush) ScatterCommand(com.fastasyncworldedit.core.command.tool.brush.ScatterCommand) Command(org.enginehub.piston.annotation.Command) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Example 2 with SphereBrush

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

the class BrushCommands method extinguishBrush.

@Command(name = "extinguish", aliases = { "ex" }, desc = "Shortcut fire extinguisher brush")
@CommandPermissions("worldedit.brush.ex")
public void extinguishBrush(InjectedValueAccess context, EditSession editSession, @Arg(desc = "The radius to extinguish", def = "5") Expression radius) throws WorldEditException {
    worldEdit.checkMaxBrushRadius(radius);
    set(context, new SphereBrush(), "worldedit.brush.ex").setSize(radius).setFill(BlockTypes.AIR.getDefaultState()).setMask(new SingleBlockTypeMask(editSession, BlockTypes.FIRE));
}
Also used : SingleBlockTypeMask(com.fastasyncworldedit.core.function.mask.SingleBlockTypeMask) HollowSphereBrush(com.sk89q.worldedit.command.tool.brush.HollowSphereBrush) SphereBrush(com.sk89q.worldedit.command.tool.brush.SphereBrush) SurfaceSphereBrush(com.fastasyncworldedit.core.command.tool.brush.SurfaceSphereBrush) 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)2 SurfaceSphereBrush (com.fastasyncworldedit.core.command.tool.brush.SurfaceSphereBrush)2 HollowSphereBrush (com.sk89q.worldedit.command.tool.brush.HollowSphereBrush)2 SphereBrush (com.sk89q.worldedit.command.tool.brush.SphereBrush)2 CommandPermissions (com.sk89q.worldedit.command.util.CommandPermissions)2 Command (org.enginehub.piston.annotation.Command)2 BlobBrush (com.fastasyncworldedit.core.command.tool.brush.BlobBrush)1 CatenaryBrush (com.fastasyncworldedit.core.command.tool.brush.CatenaryBrush)1 CircleBrush (com.fastasyncworldedit.core.command.tool.brush.CircleBrush)1 CommandBrush (com.fastasyncworldedit.core.command.tool.brush.CommandBrush)1 CopyPastaBrush (com.fastasyncworldedit.core.command.tool.brush.CopyPastaBrush)1 ErodeBrush (com.fastasyncworldedit.core.command.tool.brush.ErodeBrush)1 FallingSphere (com.fastasyncworldedit.core.command.tool.brush.FallingSphere)1 FlattenBrush (com.fastasyncworldedit.core.command.tool.brush.FlattenBrush)1 HeightBrush (com.fastasyncworldedit.core.command.tool.brush.HeightBrush)1 ImageBrush (com.fastasyncworldedit.core.command.tool.brush.ImageBrush)1 LayerBrush (com.fastasyncworldedit.core.command.tool.brush.LayerBrush)1 LineBrush (com.fastasyncworldedit.core.command.tool.brush.LineBrush)1 RaiseBrush (com.fastasyncworldedit.core.command.tool.brush.RaiseBrush)1 RecurseBrush (com.fastasyncworldedit.core.command.tool.brush.RecurseBrush)1