mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-16 03:34:03 +00:00
Optional
This commit is contained in:
@@ -448,7 +448,7 @@ public class BrushCommands {
|
||||
"Set [copies] to a value > 0 if you want to have your selection pasted a limited amount of times equally spaced on the curve"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.sweep")
|
||||
public BrushSettings sweepBrush(Player player, LocalSession session, EditSession editSession, @Optional("-1") int copies, CommandContext context) throws WorldEditException {
|
||||
public BrushSettings sweepBrush(Player player, LocalSession session, EditSession editSession, @Arg(name = "copies", desc = "int", def = "-1") int copies, CommandContext context) throws WorldEditException {
|
||||
player.print(BBC.BRUSH_SPLINE.s());
|
||||
Brush brush = new SweepBrush(copies);
|
||||
CommandLocals locals = context.getLocals();
|
||||
@@ -537,7 +537,7 @@ public class BrushCommands {
|
||||
@CommandPermissions("worldedit.brush.surfacespline") // 0, 0, 0, 10, 0,
|
||||
public BrushSettings surfaceSpline(Player player, EditSession editSession, LocalSession session, Pattern fill,
|
||||
@Arg(desc = "The radius to sample for blending", def = "0")
|
||||
double radius, @Optional("0") double tension, @Optional("0") double bias, @Optional("0") double continuity, @Optional("10") double quality, CommandContext context) throws WorldEditException {
|
||||
double radius, @Arg(name = "tension", desc = "double", def = "0") double tension, @Arg(name = "bias", desc = "double", def = "0") double bias, @Arg(name = "continuity", desc = "double", def = "0") double continuity, @Arg(name = "quality", desc = "double", def = "10") double quality, CommandContext context) throws WorldEditException {
|
||||
player.print(BBC.BRUSH_SPLINE.f(radius));
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
Brush brush = new SurfaceSpline(tension, bias, continuity, quality);
|
||||
@@ -577,7 +577,7 @@ public class BrushCommands {
|
||||
desc = "Creates a distorted sphere"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.rock")
|
||||
public BrushSettings blobBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("10") Vector3 radius, @Optional("100") double sphericity, @Optional("30") double frequency, @Optional("50") double amplitude, CommandContext context) throws WorldEditException {
|
||||
public BrushSettings blobBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Arg(name = "radius", desc = "Vector3", def = "10") Vector3 radius, @Arg(name = "sphericity", desc = "double", def = "100") double sphericity, @Arg(name = "frequency", desc = "double", def = "30") double frequency, @Arg(name = "amplitude", desc = "double", def = "50") double amplitude, CommandContext context) throws WorldEditException {
|
||||
double max = MathMan.max(radius.getX(), radius.getY(), radius.getZ());
|
||||
worldEdit.checkMaxBrushRadius(max);
|
||||
Brush brush = new BlobBrush(radius.divide(max), frequency / 100, amplitude / 100, sphericity / 100);
|
||||
@@ -728,7 +728,7 @@ public class BrushCommands {
|
||||
"The -r flag will apply random rotation"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.stencil")
|
||||
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, FileNotFoundException, ParameterException {
|
||||
public BrushSettings stencilBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch('w') boolean onlyWhite, @Switch('r') boolean randomRotate, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
InputStream stream = getHeightmapStream(image);
|
||||
HeightBrush brush;
|
||||
@@ -779,7 +779,7 @@ public class BrushCommands {
|
||||
"The -f blends the image with the existing terrain"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.stencil")
|
||||
public BrushSettings imageBrush(Player player, EditSession editSession, LocalSession session, @Optional("5") Expression radius, FawePrimitiveBinding.ImageUri imageUri, @Optional("1") @Range(min=Double.MIN_NORMAL) final double yscale, @Switch('a') boolean alpha, @Switch('f') boolean fadeOut, CommandContext context) throws WorldEditException, IOException, ParameterException {
|
||||
public BrushSettings imageBrush(Player player, EditSession editSession, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, FawePrimitiveBinding.ImageUri imageUri, @Optional("1") @Range(min=Double.MIN_NORMAL) final double yscale, @Switch('a') boolean alpha, @Switch('f') boolean fadeOut, CommandContext context) throws WorldEditException, IOException, ParameterException {
|
||||
BufferedImage image = imageUri.load();
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
if (yscale != 1) {
|
||||
@@ -830,7 +830,7 @@ public class BrushCommands {
|
||||
"The -r flag will apply random rotation"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.surface")
|
||||
public BrushSettings surfaceBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") Expression radius, CommandContext context) throws WorldEditException {
|
||||
public BrushSettings surfaceBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
Brush brush = new SurfaceSphereBrush();
|
||||
CommandLocals locals = context.getLocals();
|
||||
@@ -871,7 +871,7 @@ public class BrushCommands {
|
||||
"Video: https://youtu.be/RPZIaTbqoZw?t=34s"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.scatter")
|
||||
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 {
|
||||
public BrushSettings scatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "points", desc = "double", def = "5") double points, @Arg(name = "distance", desc = "double", def = "1") double distance, @Switch('o') boolean overlay, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
Brush brush;
|
||||
if (overlay) {
|
||||
@@ -917,7 +917,7 @@ public class BrushCommands {
|
||||
"The -r flag will apply random rotation"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.populateschematic")
|
||||
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 {
|
||||
public BrushSettings scatterSchemBrush(Player player, EditSession editSession, LocalSession session, Mask mask, String clipboard, @Arg(name = "radius", desc = "Expression", def = "30") Expression radius, @Arg(name = "density", desc = "double", def = "50") double density, @Switch('r') boolean rotate, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
|
||||
|
||||
@@ -1038,7 +1038,7 @@ public class BrushCommands {
|
||||
"Note: The seeds define how many splotches there are, recursion defines how large, solid defines whether the pattern is applied per seed, else per block."
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.splatter")
|
||||
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 {
|
||||
public BrushSettings splatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "points", desc = "double", def = "1") double points, @Arg(name = "recursion", desc = "double", def = "5") double recursion, @Arg(name = "solid", desc = "boolean", def = "true") boolean solid, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
Brush brush = new SplatterBrush((int) points, (int) recursion, solid);
|
||||
CommandLocals locals = context.getLocals();
|
||||
@@ -1415,7 +1415,7 @@ public class BrushCommands {
|
||||
"Snow Pic: https://i.imgur.com/Hrzn0I4.png"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.height")
|
||||
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, FileNotFoundException, ParameterException {
|
||||
public BrushSettings heightBrush(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
return terrainBrush(player, session, radius, image, rotation, yscale, false, randomRotate, layers, !dontSmooth, ScalableHeightMap.Shape.CONE, context);
|
||||
}
|
||||
|
||||
@@ -1429,7 +1429,7 @@ public class BrushCommands {
|
||||
" - The `-s` flag disables smoothing"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.height")
|
||||
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, FileNotFoundException, ParameterException {
|
||||
public BrushSettings cliffBrush(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
return terrainBrush(player, session, radius, image, rotation, yscale, true, randomRotate, layers, !dontSmooth, ScalableHeightMap.Shape.CYLINDER, context);
|
||||
}
|
||||
|
||||
@@ -1443,7 +1443,7 @@ public class BrushCommands {
|
||||
desc = "This brush raises or lowers land towards the clicked point"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.height")
|
||||
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, FileNotFoundException, ParameterException {
|
||||
public BrushSettings flattenBrush(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
return terrainBrush(player, session, radius, image, rotation, yscale, true, randomRotate, layers, !dontSmooth, ScalableHeightMap.Shape.CONE, context);
|
||||
}
|
||||
|
||||
@@ -1519,7 +1519,7 @@ public class BrushCommands {
|
||||
"Video: https://www.youtube.com/watch?v=RPZIaTbqoZw"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.copy")
|
||||
public BrushSettings copy(Player player, LocalSession session, @Optional("5") Expression radius, @Switch('r') boolean randomRotate, @Switch('a') boolean autoRotate, CommandContext context) throws WorldEditException {
|
||||
public BrushSettings copy(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Switch('r') boolean randomRotate, @Switch('a') boolean autoRotate, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
player.print(BBC.BRUSH_COPY.f(radius));
|
||||
|
||||
|
@@ -135,7 +135,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
" -p <page> prints the requested page\n"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.list")
|
||||
public void list(Actor actor, CommandContext args, @Switch('p') @Optional("1") int page) throws WorldEditException {
|
||||
public void list(Actor actor, CommandContext args, @Switch('p') @Arg(name = "page", desc = "int", def = "1") int page) throws WorldEditException {
|
||||
String baseCmd = Commands.getAlias(BrushCommands.class, "brush") + " " + Commands.getAlias(BrushOptionsCommands.class, "loadbrush");
|
||||
File dir = MainUtil.getFile(Fawe.imp().getDirectory(), "brushes");
|
||||
UtilityCommands.list(dir, actor, args, page, null, true, baseCmd);
|
||||
@@ -251,7 +251,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
desc = "Toggle between different target modes"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.target")
|
||||
public void target(Player player, LocalSession session, @Optional("0") int mode) throws WorldEditException {
|
||||
public void target(Player player, LocalSession session, @Arg(name = "mode", desc = "int", def = "0") int mode) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
BBC.BRUSH_NONE.send(player);
|
||||
|
@@ -280,7 +280,7 @@ public class ClipboardCommands {
|
||||
)
|
||||
@Deprecated
|
||||
@CommandPermissions({"worldedit.clipboard.download"})
|
||||
public void download(final Player player, final LocalSession session, @Optional("schem") final String formatName) throws WorldEditException {
|
||||
public void download(final Player player, final LocalSession session, @Arg(name = "format", desc = "String", def = "schem") final String formatName) throws WorldEditException {
|
||||
final ClipboardFormat format = ClipboardFormats.findByAlias(formatName);
|
||||
if (format == null) {
|
||||
BBC.CLIPBOARD_INVALID_FORMAT.send(player, formatName);
|
||||
|
@@ -130,8 +130,8 @@ public class GenerationCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.generation.image")
|
||||
@Logging(PLACEMENT)
|
||||
public void image(Player player, LocalSession session, EditSession editSession, String arg, @Optional("true") boolean randomize,
|
||||
@Arg(desc = "TODO", def = "100") int threshold, @Optional BlockVector2 dimensions) throws WorldEditException, IOException {
|
||||
public void image(Player player, LocalSession session, EditSession editSession, String arg, @Arg(name = "randomize", desc = "boolean", def = "true") boolean randomize,
|
||||
@Arg(desc = "TODO", def = "100") int threshold, @Arg(name = "dimensions", desc = "BlockVector2", def = "") BlockVector2 dimensions) throws WorldEditException, IOException {
|
||||
TextureUtil tu = Fawe.get().getCachedTextureUtil(randomize, 0, threshold);
|
||||
URL url = new URL(arg);
|
||||
if (!url.getHost().equalsIgnoreCase("i.imgur.com") && !url.getHost().equalsIgnoreCase("empcraft.com")) {
|
||||
@@ -190,7 +190,7 @@ public class GenerationCommands {
|
||||
BlockVector2 radius,
|
||||
@Arg(desc = "The height of the cylinder", def = "1")
|
||||
int height,
|
||||
@Range(min = 1) @Optional("1") double thickness, CommandContext context) throws WorldEditException {
|
||||
@Range(min = 1) @Arg(name = "thickness", desc = "double", def = "1") double thickness, CommandContext context) throws WorldEditException {
|
||||
double max = MathMan.max(radius.getBlockX(), radius.getBlockZ());
|
||||
worldEdit.checkMaxRadius(max);
|
||||
BlockVector3 pos = session.getPlacementPosition(player);
|
||||
|
@@ -33,6 +33,7 @@ import com.boydti.fawe.object.changeset.DiskStorageHistory;
|
||||
import com.boydti.fawe.regions.FaweMaskManager;
|
||||
import com.boydti.fawe.util.MainUtil;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@@ -78,7 +79,7 @@ public class HistoryCommands extends MethodCommands {
|
||||
" - Import from disk: /frb #import"
|
||||
)
|
||||
@CommandPermissions("worldedit.history.rollback")
|
||||
public void faweRollback(final Player player, LocalSession session, final String user, @Optional("0") @Range(min = 0) int radius, @Optional("0") String time, @Switch('r') boolean restore) throws WorldEditException {
|
||||
public void faweRollback(final Player player, LocalSession session, final String user, @Optional("0") @Range(min = 0) int radius, @Arg(name = "time", desc = "String", def = "0") String time, @Switch('r') boolean restore) throws WorldEditException {
|
||||
if (!Settings.IMP.HISTORY.USE_DATABASE) {
|
||||
BBC.SETTING_DISABLE.send(player, "history.use-database (Import with /frb #import )");
|
||||
return;
|
||||
@@ -204,7 +205,7 @@ public class HistoryCommands extends MethodCommands {
|
||||
" - Import from disk: /frb #import"
|
||||
)
|
||||
@CommandPermissions("worldedit.history.rollback")
|
||||
public void restore(final Player player, LocalSession session, final String user, @Optional("0") @Range(min = 0) int radius, @Optional("0") String time) throws WorldEditException {
|
||||
public void restore(final Player player, LocalSession session, final String user, @Optional("0") @Range(min = 0) int radius, @Arg(name = "time", desc = "String", def = "0") String time) throws WorldEditException {
|
||||
faweRollback(player, session, user, radius, time, true);
|
||||
}
|
||||
|
||||
|
@@ -257,7 +257,7 @@ public class MaskCommands extends MethodCommands {
|
||||
"Example: /[3][20]\n" +
|
||||
"Explanation: Allows any block where the adjacent block is between 3 and 20 blocks below"
|
||||
)
|
||||
public Mask angle(Extent extent, String min, String max, @Switch('o') boolean overlay, @Optional("1") int distance) throws ExpressionException {
|
||||
public Mask angle(Extent extent, String min, String max, @Switch('o') boolean overlay, @Arg(name = "distance", desc = "int", def = "1") int distance) throws ExpressionException {
|
||||
double y1, y2;
|
||||
boolean override;
|
||||
if (max.endsWith("d")) {
|
||||
@@ -282,7 +282,7 @@ public class MaskCommands extends MethodCommands {
|
||||
"Explanation: Restrict near where the angle changes between 0-45 degrees within 5 blocks\n" +
|
||||
"Note: Use negatives for decreasing slope"
|
||||
)
|
||||
public Mask roc(Extent extent, String min, String max, @Switch('o') boolean overlay, @Optional("4") int distance) throws ExpressionException {
|
||||
public Mask roc(Extent extent, String min, String max, @Switch('o') boolean overlay, @Arg(name = "distance", desc = "int", def = "4") int distance) throws ExpressionException {
|
||||
double y1, y2;
|
||||
boolean override;
|
||||
if (max.endsWith("d")) {
|
||||
@@ -307,7 +307,7 @@ public class MaskCommands extends MethodCommands {
|
||||
"Explanation: Restrict to near 45 degrees of local maxima\n" +
|
||||
"Note: Use negatives for local minima"
|
||||
)
|
||||
public Mask extrema(Extent extent, String min, String max, @Switch('o') boolean overlay, @Optional("4") int distance) throws ExpressionException {
|
||||
public Mask extrema(Extent extent, String min, String max, @Switch('o') boolean overlay, @Arg(name = "distance", desc = "int", def = "4") int distance) throws ExpressionException {
|
||||
double y1, y2;
|
||||
boolean override;
|
||||
if (max.endsWith("d")) {
|
||||
@@ -345,7 +345,7 @@ public class MaskCommands extends MethodCommands {
|
||||
aliases = {"#~", "#adjacent"},
|
||||
desc = "Adjacent to a specific number of other blocks"
|
||||
)
|
||||
public Mask adjacent(Mask mask, @Optional("-1") double min, @Optional("-1") double max) throws ExpressionException {
|
||||
public Mask adjacent(Mask mask, @Arg(name = "min", desc = "double", def = "-1") double min, @Arg(name = "max", desc = "double", def = "-1") double max) throws ExpressionException {
|
||||
if (min == -1 && max == -1) {
|
||||
min = 1;
|
||||
max = 8;
|
||||
|
@@ -103,7 +103,7 @@ public class OptionsCommands {
|
||||
max = -1
|
||||
)
|
||||
@CommandPermissions("worldedit.global-texture")
|
||||
public void gtexture(FawePlayer player, LocalSession session, EditSession editSession, @Optional CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
public void gtexture(FawePlayer player, LocalSession session, EditSession editSession, @Arg(name = "context", desc = "CommandContext", def = "") CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
if (context == null || context.argsLength() == 0) {
|
||||
session.setTextureUtil(null);
|
||||
BBC.TEXTURE_DISABLED.send(player);
|
||||
@@ -162,7 +162,7 @@ public class OptionsCommands {
|
||||
max = -1
|
||||
)
|
||||
@CommandPermissions({"worldedit.global-mask", "worldedit.mask.global"})
|
||||
public void gmask(Player player, LocalSession session, EditSession editSession, @Optional CommandContext context) throws WorldEditException {
|
||||
public void gmask(Player player, LocalSession session, EditSession editSession, @Arg(name = "context", desc = "CommandContext", def = "") CommandContext context) throws WorldEditException {
|
||||
if (context == null || context.argsLength() == 0) {
|
||||
session.setMask((Mask) null);
|
||||
BBC.MASK_DISABLED.send(player);
|
||||
@@ -186,7 +186,7 @@ public class OptionsCommands {
|
||||
max = -1
|
||||
)
|
||||
@CommandPermissions({"worldedit.global-mask", "worldedit.mask.global"})
|
||||
public void gsmask(Player player, LocalSession session, EditSession editSession, @Optional CommandContext context) throws WorldEditException {
|
||||
public void gsmask(Player player, LocalSession session, EditSession editSession, @Arg(name = "context", desc = "CommandContext", def = "") CommandContext context) throws WorldEditException {
|
||||
if (context == null || context.argsLength() == 0) {
|
||||
session.setSourceMask((Mask) null);
|
||||
BBC.SOURCE_MASK_DISABLED.send(player);
|
||||
@@ -209,7 +209,7 @@ public class OptionsCommands {
|
||||
max = -1
|
||||
)
|
||||
@CommandPermissions({"worldedit.global-transform", "worldedit.transform.global"})
|
||||
public void gtransform(Player player, EditSession editSession, LocalSession session, @Optional CommandContext context) throws WorldEditException {
|
||||
public void gtransform(Player player, EditSession editSession, LocalSession session, @Arg(name = "context", desc = "CommandContext", def = "") CommandContext context) throws WorldEditException {
|
||||
if (context == null || context.argsLength() == 0) {
|
||||
session.setTransform(null);
|
||||
BBC.TRANSFORM_DISABLED.send(player);
|
||||
|
@@ -56,7 +56,7 @@ public class PatternCommands extends MethodCommands {
|
||||
desc = "Use the block that is already there",
|
||||
usage = "[properties]"
|
||||
)
|
||||
public Pattern existing(Extent extent, @Optional String properties) { // TODO FIXME , @Optional String properties
|
||||
public Pattern existing(Extent extent, @Arg(name = "properties", desc = "String", def = "") String properties) { // TODO FIXME , @Arg(name = "properties", desc = "String", def = "") String properties
|
||||
if (properties == null) return new ExistingPattern(extent);
|
||||
return new PropertyPattern(extent).addRegex(".*[" + properties + "]");
|
||||
}
|
||||
@@ -97,7 +97,7 @@ public class PatternCommands extends MethodCommands {
|
||||
name = "#anglecolor",
|
||||
desc = "A darker block based on the existing terrain angle"
|
||||
)
|
||||
public Pattern anglecolor(Extent extent, LocalSession session, @Optional("true") boolean randomize, @Optional("100") double maxComplexity, @Optional("1") int distance) {
|
||||
public Pattern anglecolor(Extent extent, LocalSession session, @Arg(name = "randomize", desc = "boolean", def = "true") boolean randomize, @Arg(name = "maxcomplexity", desc = "double", def = "100") double maxComplexity, @Arg(name = "distance", desc = "int", def = "1") int distance) {
|
||||
return new AngleColorPattern(extent, session, distance);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class PatternCommands extends MethodCommands {
|
||||
name = "#angledata",
|
||||
desc = "Block data based on the existing terrain angle"
|
||||
)
|
||||
public Pattern angledata(Extent extent, @Optional("1") int distance) {
|
||||
public Pattern angledata(Extent extent, @Arg(name = "distance", desc = "int", def = "1") int distance) {
|
||||
return new DataAnglePattern(extent, distance);
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public class PatternCommands extends MethodCommands {
|
||||
name = "#desaturate",
|
||||
desc = "Desaturated color of the existing block"
|
||||
)
|
||||
public Pattern desaturate(Extent extent, LocalSession session, @Optional("100") double percent) {
|
||||
public Pattern desaturate(Extent extent, LocalSession session, @Arg(name = "percent", desc = "double", def = "100") double percent) {
|
||||
return new DesaturatePattern(extent, percent / 100d, session);
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public class PatternCommands extends MethodCommands {
|
||||
name = "#fullcopy",
|
||||
desc = "Places your full clipboard at each block"
|
||||
)
|
||||
public Pattern fullcopy(Player player, Extent extent, LocalSession session, @Optional("#copy") String location, @Optional("false") boolean rotate, @Optional("false") boolean flip) throws EmptyClipboardException, InputParseException, IOException {
|
||||
public Pattern fullcopy(Player player, Extent extent, LocalSession session, @Arg(name = "location", desc = "String", def = "#copy") String location, @Arg(name = "rotate", desc = "boolean", def = "false") boolean rotate, @Arg(name = "flip", desc = "boolean", def = "false") boolean flip) throws EmptyClipboardException, InputParseException, IOException {
|
||||
List<ClipboardHolder> clipboards;
|
||||
switch (location.toLowerCase()) {
|
||||
case "#copy":
|
||||
|
@@ -280,7 +280,7 @@ public class RegionCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.region.replace")
|
||||
@Logging(REGION)
|
||||
public void replace(FawePlayer player, EditSession editSession, @Selection Region region, @Optional Mask from, Pattern to, CommandContext context) throws WorldEditException {
|
||||
public void replace(FawePlayer player, EditSession editSession, @Selection Region region, @Arg(name = "from", desc = "Mask", def = "") Mask from, Pattern to, CommandContext context) throws WorldEditException {
|
||||
player.checkConfirmationRegion(() -> {
|
||||
int affected = editSession.replaceBlocks(region, from == null ? new ExistingBlockMask(editSession) : from, to);
|
||||
BBC.VISITOR_BLOCK.send(player, affected);
|
||||
@@ -412,7 +412,7 @@ public class RegionCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.region.smooth")
|
||||
@Logging(REGION)
|
||||
public void smooth(FawePlayer player, EditSession editSession, @Selection Region region, @Optional("1") int iterations, @Optional Mask mask, @Switch('s') boolean snow, CommandContext context) throws WorldEditException {
|
||||
public void smooth(FawePlayer player, EditSession editSession, @Selection Region region, @Arg(name = "iterations", desc = "int", def = "1") int iterations, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('s') boolean snow, CommandContext context) throws WorldEditException {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1));
|
||||
@@ -524,7 +524,7 @@ public class RegionCommands {
|
||||
@Logging(ORIENTATION_REGION)
|
||||
public void fall(FawePlayer player, EditSession editSession, LocalSession session,
|
||||
@Selection Region region,
|
||||
@Optional("air") BlockStateHolder replace,
|
||||
@Arg(name = "replace", desc = "BlockStateHolder", def = "air") BlockStateHolder replace,
|
||||
@Switch('m') boolean notFullHeight,
|
||||
CommandContext context) throws WorldEditException {
|
||||
player.checkConfirmationRegion(() -> {
|
||||
|
@@ -39,7 +39,7 @@ public class TransformCommands extends MethodCommands {
|
||||
aliases = {"#l"},
|
||||
desc = "Sequentially pick from a list of transform"
|
||||
)
|
||||
public ResettableExtent linear(Actor actor, LocalSession session, @Optional("#null") ResettableExtent other) {
|
||||
public ResettableExtent linear(Actor actor, LocalSession session, @Arg(name = "other", desc = "ResettableExtent", def = "#null") ResettableExtent other) {
|
||||
if (other instanceof RandomTransform) {
|
||||
Set<ResettableExtent> extents = ((RandomTransform) other).getExtents();
|
||||
return new LinearTransform(extents.toArray(new ResettableExtent[extents.size()]));
|
||||
@@ -52,7 +52,7 @@ public class TransformCommands extends MethodCommands {
|
||||
aliases = {"#l3d"},
|
||||
desc = "Use the x,y,z coordinate to pick a transform from the list"
|
||||
)
|
||||
public ResettableExtent linear3d(Actor actor, LocalSession session, @Optional("#null") ResettableExtent other) {
|
||||
public ResettableExtent linear3d(Actor actor, LocalSession session, @Arg(name = "other", desc = "ResettableExtent", def = "#null") ResettableExtent other) {
|
||||
if (other instanceof RandomTransform) {
|
||||
Set<ResettableExtent> extents = ((RandomTransform) other).getExtents();
|
||||
return new Linear3DTransform(extents.toArray(new ResettableExtent[extents.size()]));
|
||||
@@ -64,7 +64,7 @@ public class TransformCommands extends MethodCommands {
|
||||
name = "#pattern",
|
||||
desc = "Always use a specific pattern"
|
||||
)
|
||||
public ResettableExtent pattern(Actor actor, LocalSession session, Pattern pattern, @Optional("#null") ResettableExtent other) {
|
||||
public ResettableExtent pattern(Actor actor, LocalSession session, Pattern pattern, @Arg(name = "other", desc = "ResettableExtent", def = "#null") ResettableExtent other) {
|
||||
return new PatternTransform(other, pattern);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class TransformCommands extends MethodCommands {
|
||||
name = "#offset",
|
||||
desc = "Offset transform"
|
||||
)
|
||||
public ResettableExtent offset(Actor actor, LocalSession session, double x, double y, double z, @Optional("#null") ResettableExtent other) {
|
||||
public ResettableExtent offset(Actor actor, LocalSession session, double x, double y, double z, @Arg(name = "other", desc = "ResettableExtent", def = "#null") ResettableExtent other) {
|
||||
return new OffsetExtent(other, (int) x, (int) y, (int) z);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class TransformCommands extends MethodCommands {
|
||||
aliases = {"#randomoffset"},
|
||||
desc = "Random offset transform"
|
||||
)
|
||||
public ResettableExtent randomoffset(Actor actor, LocalSession session, double x, double y, double z, @Optional("#null") ResettableExtent other) {
|
||||
public ResettableExtent randomoffset(Actor actor, LocalSession session, double x, double y, double z, @Arg(name = "other", desc = "ResettableExtent", def = "#null") ResettableExtent other) {
|
||||
return new RandomOffsetTransform(other, (int) x, (int) y, (int) z);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class TransformCommands extends MethodCommands {
|
||||
name = "#scale",
|
||||
desc = "All changes will be scaled"
|
||||
)
|
||||
public ResettableExtent scale(Actor actor, LocalSession session, double x, double y, double z, @Optional("#null") ResettableExtent other) {
|
||||
public ResettableExtent scale(Actor actor, LocalSession session, double x, double y, double z, @Arg(name = "other", desc = "ResettableExtent", def = "#null") ResettableExtent other) {
|
||||
return new ScaleTransform(other, x, y, z);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class TransformCommands extends MethodCommands {
|
||||
name = "#rotate",
|
||||
desc = "All changes will be rotate around the initial position"
|
||||
)
|
||||
public ResettableExtent rotate(Player player, LocalSession session, double x, double y, double z, @Optional("#null") ResettableExtent other) {
|
||||
public ResettableExtent rotate(Player player, LocalSession session, double x, double y, double z, @Arg(name = "other", desc = "ResettableExtent", def = "#null") ResettableExtent other) {
|
||||
ExtentTraverser traverser = new ExtentTraverser(other).find(TransformExtent.class);
|
||||
BlockTransformExtent affine = (TransformExtent) (traverser != null ? traverser.get() : null);
|
||||
if (affine == null) {
|
||||
|
@@ -114,7 +114,7 @@ public class UtilityCommands {
|
||||
desc = "Generate the heightmap interface: https://github.com/boy0001/HeightMap"
|
||||
)
|
||||
@CommandPermissions("fawe.admin")
|
||||
public void heightmapInterface(Player player, @Optional("100") int min, @Optional("200") int max) throws IOException {
|
||||
public void heightmapInterface(Player player, @Arg(name = "min", desc = "int", def = "100") int min, @Arg(name = "max", desc = "int", def = "200") int max) throws IOException {
|
||||
player.print("Please wait while we generate the minified heightmaps.");
|
||||
File srcFolder = MainUtil.getFile(Fawe.imp().getDirectory(), Settings.IMP.PATHS.HEIGHTMAP);
|
||||
|
||||
|
Reference in New Issue
Block a user