|
|
|
@ -50,6 +50,9 @@ import com.sk89q.worldedit.function.mask.BlockMask;
|
|
|
|
|
import com.sk89q.worldedit.function.mask.ExistingBlockMask;
|
|
|
|
|
import com.sk89q.worldedit.function.mask.Mask;
|
|
|
|
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
|
|
|
|
import com.sk89q.worldedit.internal.expression.Expression;
|
|
|
|
|
import com.sk89q.worldedit.internal.expression.runtime.Constant;
|
|
|
|
|
import com.sk89q.worldedit.internal.expression.runtime.RValue;
|
|
|
|
|
import com.sk89q.worldedit.session.ClipboardHolder;
|
|
|
|
|
import com.sk89q.worldedit.util.command.InvalidUsageException;
|
|
|
|
|
import com.sk89q.worldedit.util.command.binding.Range;
|
|
|
|
@ -76,6 +79,15 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
super(worldEdit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void checkMaxBrushRadius(Expression radius) throws MaxBrushRadiusException {
|
|
|
|
|
if (WorldEdit.getInstance().getConfiguration().maxBrushRadius > 0) {
|
|
|
|
|
RValue r = radius.getRoot();
|
|
|
|
|
if (r instanceof Constant && ((Constant) r).getValue() > WorldEdit.getInstance().getConfiguration().maxBrushRadius) {
|
|
|
|
|
throw new MaxBrushRadiusException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Command(
|
|
|
|
|
aliases = {"blendball", "bb", "blend"},
|
|
|
|
|
usage = "[radius=5]",
|
|
|
|
@ -86,8 +98,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.blendball")
|
|
|
|
|
public BrushSettings blendBallBrush(Player player, LocalSession session, @Optional("5") double radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings blendBallBrush(Player player, LocalSession session, @Optional("5") Expression radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context, new BlendBall()).setSize(radius);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -100,8 +112,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.erode")
|
|
|
|
|
public BrushSettings erodeBrush(Player player, LocalSession session, @Optional("5") double radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings erodeBrush(Player player, LocalSession session, @Optional("5") Expression radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context, new ErodeBrush()).setSize(radius);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -114,8 +126,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.pull")
|
|
|
|
|
public BrushSettings pullBrush(Player player, LocalSession session, @Optional("5") double radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings pullBrush(Player player, LocalSession session, @Optional("5") Expression radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context, new RaiseBrush()).setSize(radius);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -129,8 +141,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 2
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.sphere")
|
|
|
|
|
public BrushSettings circleBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") double radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings circleBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") Expression radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context, new CircleBrush(player)).setSize(radius).setFill(fill);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -145,8 +157,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 3
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.recursive")
|
|
|
|
|
public BrushSettings recursiveBrush(Player player, LocalSession session, EditSession editSession, Pattern fill, @Optional("5") double radius, @Switch('d') boolean depthFirst, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings recursiveBrush(Player player, LocalSession session, EditSession editSession, Pattern fill, @Optional("5") Expression radius, @Switch('d') boolean depthFirst, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new RecurseBrush(depthFirst))
|
|
|
|
|
.setSize(radius)
|
|
|
|
@ -168,8 +180,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 2
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.line")
|
|
|
|
|
public BrushSettings lineBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("0") double radius, @Switch('h') boolean shell, @Switch('s') boolean select, @Switch('f') boolean flat, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings lineBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("0") Expression radius, @Switch('h') boolean shell, @Switch('s') boolean select, @Switch('f') boolean flat, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new LineBrush(shell, select, flat))
|
|
|
|
|
.setSize(radius)
|
|
|
|
@ -189,8 +201,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 2
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.spline")
|
|
|
|
|
public BrushSettings splineBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("25") double radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings splineBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("25") Expression radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
player.print(BBC.getPrefix() + BBC.BRUSH_SPLINE.f(radius));
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new SplineBrush(player, session))
|
|
|
|
@ -227,8 +239,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 3
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.spline")
|
|
|
|
|
public BrushSettings catenaryBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("1.2") @Range(min=1) double lengthFactor, @Optional("0") double radius, @Switch('h') boolean shell, @Switch('s') boolean select, @Switch('d') boolean facingDirection, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings catenaryBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("1.2") @Range(min=1) double lengthFactor, @Optional("0") Expression radius, @Switch('h') boolean shell, @Switch('s') boolean select, @Switch('d') boolean facingDirection, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new CatenaryBrush(shell, select, facingDirection, lengthFactor))
|
|
|
|
|
.setSize(radius)
|
|
|
|
@ -245,9 +257,9 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 6
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.surfacespline") // 0, 0, 0, 10, 0,
|
|
|
|
|
public BrushSettings surfaceSpline(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("0") double radius, @Optional("0") double tension, @Optional("0") double bias, @Optional("0") double continuity, @Optional("10") double quality, CommandContext context) throws WorldEditException {
|
|
|
|
|
public BrushSettings surfaceSpline(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("0") Expression radius, @Optional("0") double tension, @Optional("0") double bias, @Optional("0") double continuity, @Optional("10") double quality, CommandContext context) throws WorldEditException {
|
|
|
|
|
player.print(BBC.getPrefix() + BBC.BRUSH_SPLINE.f(radius));
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new SurfaceSpline(tension, bias, continuity, quality))
|
|
|
|
|
.setSize(radius)
|
|
|
|
@ -265,7 +277,7 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
@CommandPermissions("worldedit.brush.rock")
|
|
|
|
|
public BrushSettings blobBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("10") Vector radius, @Optional("100") double sphericity, @Optional("30") double frequency, @Optional("50") double amplitude, CommandContext context) throws WorldEditException {
|
|
|
|
|
double max = MathMan.max(radius.getBlockX(), radius.getBlockY(), radius.getBlockZ());
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(max);
|
|
|
|
|
WorldEdit.getInstance().checkMaxBrushRadius(max);
|
|
|
|
|
Brush brush = new BlobBrush(radius.divide(max), frequency / 100, amplitude / 100, sphericity / 100);
|
|
|
|
|
return set(session, context,
|
|
|
|
|
brush)
|
|
|
|
@ -286,8 +298,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 2
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.sphere")
|
|
|
|
|
public BrushSettings sphereBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("2") @Range(min=0) double radius, @Switch('h') boolean hollow, @Switch('f') boolean falling, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings sphereBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("2") @Range(min=0) Expression radius, @Switch('h') boolean hollow, @Switch('f') boolean falling, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
|
|
|
|
|
Brush brush;
|
|
|
|
|
if (hollow) {
|
|
|
|
@ -327,8 +339,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = -1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.shatter")
|
|
|
|
|
public BrushSettings shatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("10") double radius, @Optional("10") int count, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings shatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("10") Expression radius, @Optional("10") int count, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new ShatterBrush(count))
|
|
|
|
|
.setSize(radius)
|
|
|
|
@ -348,8 +360,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = -1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.stencil")
|
|
|
|
|
public BrushSettings stencilBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") double radius, @Optional("") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Optional("1") final double yscale, @Switch('w') boolean onlyWhite, @Switch('r') boolean randomRotate, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings stencilBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") Expression radius, @Optional("") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Optional("1") final double yscale, @Switch('w') boolean onlyWhite, @Switch('r') boolean randomRotate, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
InputStream stream = getHeightmapStream(image);
|
|
|
|
|
HeightBrush brush;
|
|
|
|
|
try {
|
|
|
|
@ -379,8 +391,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = -1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.stencil")
|
|
|
|
|
public BrushSettings imageBrush(Player player, EditSession editSession, LocalSession session, @Optional("5") double radius, BufferedImage image, @Optional("1") @Range(min=Double.MIN_NORMAL) final double yscale, @Switch('a') boolean alpha, @Switch('f') boolean fadeOut, CommandContext context) throws WorldEditException, IOException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings imageBrush(Player player, EditSession editSession, LocalSession session, @Optional("5") Expression radius, BufferedImage image, @Optional("1") @Range(min=Double.MIN_NORMAL) final double yscale, @Switch('a') boolean alpha, @Switch('f') boolean fadeOut, CommandContext context) throws WorldEditException, IOException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
if (yscale != 1) {
|
|
|
|
|
ImageUtil.scaleAlpha(image, yscale);
|
|
|
|
|
alpha = true;
|
|
|
|
@ -407,8 +419,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = -1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.surface")
|
|
|
|
|
public BrushSettings surfaceBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") double radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings surfaceBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") Expression radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context, new SurfaceSphereBrush()).setFill(fill).setSize(radius);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -425,8 +437,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 4
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.scatter")
|
|
|
|
|
public BrushSettings scatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") double radius, @Optional("5") double points, @Optional("1") double distance, @Switch('o') boolean overlay, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings scatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") Expression radius, @Optional("5") double points, @Optional("1") double distance, @Switch('o') boolean overlay, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
Brush brush;
|
|
|
|
|
if (overlay) {
|
|
|
|
|
brush = new ScatterOverlayBrush((int) points, (int) distance);
|
|
|
|
@ -451,8 +463,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 4
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.populateschematic")
|
|
|
|
|
public BrushSettings scatterSchemBrush(Player player, EditSession editSession, LocalSession session, Mask mask, String clipboard, @Optional("30") double radius, @Optional("50") double density, @Switch('r') boolean rotate, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings scatterSchemBrush(Player player, EditSession editSession, LocalSession session, Mask mask, String clipboard, @Optional("30") Expression radius, @Optional("50") double density, @Switch('r') boolean rotate, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
@ -486,8 +498,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 999
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.layer")
|
|
|
|
|
public BrushSettings surfaceLayer(Player player, EditSession editSession, LocalSession session, double radius, CommandContext args, CommandContext context) throws WorldEditException, InvalidUsageException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings surfaceLayer(Player player, EditSession editSession, LocalSession session, Expression radius, CommandContext args, CommandContext context) throws WorldEditException, InvalidUsageException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
ParserContext parserContext = new ParserContext();
|
|
|
|
|
parserContext.setActor(player);
|
|
|
|
|
parserContext.setWorld(player.getWorld());
|
|
|
|
@ -526,8 +538,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 5
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.splatter")
|
|
|
|
|
public BrushSettings splatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") double radius, @Optional("1") double points, @Optional("5") double recursion, @Optional("true") boolean solid, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings splatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") Expression radius, @Optional("1") double points, @Optional("5") double recursion, @Optional("true") boolean solid, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new SplatterBrush((int) points, (int) recursion, solid))
|
|
|
|
|
.setSize(radius)
|
|
|
|
@ -547,8 +559,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = -1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.scattercommand")
|
|
|
|
|
public BrushSettings scatterCommandBrush(Player player, EditSession editSession, LocalSession session, double radius, double points, double distance, CommandContext args, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings scatterCommandBrush(Player player, EditSession editSession, LocalSession session, Expression radius, double points, double distance, CommandContext args, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new ScatterCommand((int) points, (int) distance, args.getJoinedStrings(3)))
|
|
|
|
|
.setSize(radius);
|
|
|
|
@ -567,9 +579,9 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.cylinder")
|
|
|
|
|
public BrushSettings cylinderBrush(Player player, EditSession editSession, LocalSession session, Pattern fill,
|
|
|
|
|
@Optional("2") double radius, @Optional("1") int height, @Switch('h') boolean hollow, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(height);
|
|
|
|
|
@Optional("2") Expression radius, @Optional("1") int height, @Switch('h') boolean hollow, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
WorldEdit.getInstance().checkMaxBrushRadius(height);
|
|
|
|
|
|
|
|
|
|
BrushSettings settings;
|
|
|
|
|
if (hollow) {
|
|
|
|
@ -600,9 +612,9 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
|
|
|
|
|
Vector size = clipboard.getDimensions();
|
|
|
|
|
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(size.getBlockX());
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(size.getBlockY());
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(size.getBlockZ());
|
|
|
|
|
WorldEdit.getInstance().checkMaxBrushRadius(size.getBlockX());
|
|
|
|
|
WorldEdit.getInstance().checkMaxBrushRadius(size.getBlockY());
|
|
|
|
|
WorldEdit.getInstance().checkMaxBrushRadius(size.getBlockZ());
|
|
|
|
|
return set(session, context, new ClipboardBrush(holder, ignoreAir, usingOrigin));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -619,10 +631,10 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.smooth")
|
|
|
|
|
public BrushSettings smoothBrush(Player player, LocalSession session, EditSession editSession,
|
|
|
|
|
@Optional("2") double radius, @Optional("4") int iterations, @Switch('n')
|
|
|
|
|
@Optional("2") Expression radius, @Optional("4") int iterations, @Switch('n')
|
|
|
|
|
boolean naturalBlocksOnly, CommandContext context) throws WorldEditException {
|
|
|
|
|
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
|
|
|
|
|
FawePlayer fp = FawePlayer.wrap(player);
|
|
|
|
|
FaweLimit limit = Settings.IMP.getLimit(fp);
|
|
|
|
@ -641,8 +653,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.ex")
|
|
|
|
|
public BrushSettings extinguishBrush(Player player, LocalSession session, EditSession editSession, @Optional("5") double radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings extinguishBrush(Player player, LocalSession session, EditSession editSession, @Optional("5") Expression radius, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
|
|
|
|
|
Pattern fill = (new BaseBlock(0));
|
|
|
|
|
return set(session, context,
|
|
|
|
@ -665,8 +677,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.gravity")
|
|
|
|
|
public BrushSettings gravityBrush(Player player, LocalSession session, @Optional("5") double radius, @Switch('h') boolean fromMaxY, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings gravityBrush(Player player, LocalSession session, @Optional("5") Expression radius, @Switch('h') boolean fromMaxY, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new GravityBrush(fromMaxY))
|
|
|
|
@ -689,7 +701,7 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 4
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.height")
|
|
|
|
|
public BrushSettings heightBrush(Player player, LocalSession session, @Optional("5") double radius, @Optional("") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Optional("1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException {
|
|
|
|
|
public BrushSettings heightBrush(Player player, LocalSession session, @Optional("5") Expression radius, @Optional("") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Optional("1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException {
|
|
|
|
|
return terrainBrush(player, session, radius, image, rotation, yscale, false, randomRotate, layers, !dontSmooth, ScalableHeightMap.Shape.CONE, context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -707,7 +719,7 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 4
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.height")
|
|
|
|
|
public BrushSettings cliffBrush(Player player, LocalSession session, @Optional("5") double radius, @Optional("") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Optional("1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException {
|
|
|
|
|
public BrushSettings cliffBrush(Player player, LocalSession session, @Optional("5") Expression radius, @Optional("") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Optional("1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException {
|
|
|
|
|
return terrainBrush(player, session, radius, image, rotation, yscale, true, randomRotate, layers, !dontSmooth, ScalableHeightMap.Shape.CYLINDER, context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -724,12 +736,12 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 4
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.height")
|
|
|
|
|
public BrushSettings flattenBrush(Player player, LocalSession session, @Optional("5") double radius, @Optional("") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Optional("1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException {
|
|
|
|
|
public BrushSettings flattenBrush(Player player, LocalSession session, @Optional("5") Expression radius, @Optional("") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Optional("1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException {
|
|
|
|
|
return terrainBrush(player, session, radius, image, rotation, yscale, true, randomRotate, layers, !dontSmooth, ScalableHeightMap.Shape.CONE, context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private BrushSettings terrainBrush(Player player, LocalSession session, double radius, String image, int rotation, double yscale, boolean flat, boolean randomRotate, boolean layers, boolean smooth, ScalableHeightMap.Shape shape, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
private BrushSettings terrainBrush(Player player, LocalSession session, Expression radius, String image, int rotation, double yscale, boolean flat, boolean randomRotate, boolean layers, boolean smooth, ScalableHeightMap.Shape shape, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
InputStream stream = getHeightmapStream(image);
|
|
|
|
|
HeightBrush brush;
|
|
|
|
|
if (flat) {
|
|
|
|
@ -799,8 +811,8 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 1
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.copy")
|
|
|
|
|
public BrushSettings copy(Player player, LocalSession session, @Optional("5") double radius, @Switch('r') boolean randomRotate, @Switch('a') boolean autoRotate, CommandContext context) throws WorldEditException {
|
|
|
|
|
getWorldEdit().checkMaxBrushRadius(radius);
|
|
|
|
|
public BrushSettings copy(Player player, LocalSession session, @Optional("5") Expression radius, @Switch('r') boolean randomRotate, @Switch('a') boolean autoRotate, CommandContext context) throws WorldEditException {
|
|
|
|
|
checkMaxBrushRadius(radius);
|
|
|
|
|
player.print(BBC.getPrefix() + BBC.BRUSH_COPY.f(radius));
|
|
|
|
|
|
|
|
|
|
return set(session, context,
|
|
|
|
@ -821,10 +833,10 @@ public class BrushCommands extends BrushProcessor {
|
|
|
|
|
max = 99
|
|
|
|
|
)
|
|
|
|
|
@CommandPermissions("worldedit.brush.command")
|
|
|
|
|
public BrushSettings command(Player player, LocalSession session, double radius, CommandContext args, CommandContext context) throws WorldEditException {
|
|
|
|
|
public BrushSettings command(Player player, LocalSession session, Expression radius, CommandContext args, CommandContext context) throws WorldEditException {
|
|
|
|
|
String cmd = args.getJoinedStrings(1);
|
|
|
|
|
return set(session, context,
|
|
|
|
|
new CommandBrush(cmd, radius))
|
|
|
|
|
new CommandBrush(cmd))
|
|
|
|
|
.setSize(radius);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|