Revert "Upstream, generics, formatting"

This reverts commit cd88e513a8.
This commit is contained in:
NotMyFault
2019-06-12 15:45:41 +02:00
parent 6f9fa018b2
commit ec001b8d3b
126 changed files with 3093 additions and 2490 deletions

View File

@ -220,14 +220,14 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/line" },
aliases = {"/line"},
usage = "<pattern> [thickness]",
desc = "Draws a line segment between cuboid selection corners",
help =
"Draws a line segment between cuboid selection corners.\n" +
"Can only be used with cuboid selections.\n" +
"Flags:\n" +
" -h generates only a shell",
"Draws a line segment between cuboid selection corners.\n" +
"Can only be used with cuboid selections.\n" +
"Flags:\n" +
" -h generates only a shell",
flags = "h",
min = 1,
max = 2
@ -241,7 +241,7 @@ public class RegionCommands extends MethodCommands {
@Switch('h') boolean shell) throws WorldEditException {
if (!(region instanceof CuboidRegion)) {
player.printError("//line only works with cuboid selections");
player.printError(BBC.getPrefix() + "//line only works with cuboid selections");
return;
}
@ -254,14 +254,14 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/curve", "/spline" },
aliases = {"/curve", "/spline"},
usage = "<pattern> [thickness]",
desc = "Draws a spline through selected points",
help =
"Draws a spline through selected points.\n" +
"Can only be used with convex polyhedral selections.\n" +
"Flags:\n" +
" -h generates only a shell",
"Draws a spline through selected points.\n" +
"Can only be used with convex polyhedral selections.\n" +
"Flags:\n" +
" -h generates only a shell",
flags = "h",
min = 1,
max = 2
@ -275,7 +275,7 @@ public class RegionCommands extends MethodCommands {
@Switch('h') boolean shell,
CommandContext context) throws WorldEditException {
if (!(region instanceof ConvexPolyhedralRegion)) {
player.toWorldEditPlayer().printError("//curve only works with convex polyhedral selections");
player.sendMessage(BBC.getPrefix() + "//curve only works with convex polyhedral selections");
return;
}
worldEdit.checkMaxRadius(thickness);
@ -293,10 +293,10 @@ public class RegionCommands extends MethodCommands {
@Command(
aliases = { "/replace", "/re", "/rep" },
usage = "[from-mask] <to-pattern>",
desc = "Replace all blocks in the selection with another",
flags = "f",
min = 1,
max = 2
desc = "Replace all blocks in the selection with another",
flags = "f",
min = 1,
max = 2
)
@CommandPermissions("worldedit.region.replace")
@Logging(REGION)
@ -336,11 +336,11 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/overlay" },
usage = "<pattern>",
desc = "Set a block on top of blocks in the region",
min = 1,
max = 1
aliases = {"/overlay"},
usage = "<pattern>",
desc = "Set a block on top of blocks in the region",
min = 1,
max = 1
)
@CommandPermissions("worldedit.region.overlay")
@Logging(REGION)
@ -386,11 +386,11 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/center", "/middle" },
usage = "<pattern>",
desc = "Set the center block(s)",
min = 1,
max = 1
aliases = {"/center", "/middle"},
usage = "<pattern>",
desc = "Set the center block(s)",
min = 1,
max = 1
)
@Logging(REGION)
@CommandPermissions("worldedit.region.center")
@ -400,11 +400,11 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/naturalize" },
usage = "",
desc = "3 layers of dirt on top then rock below",
min = 0,
max = 0
aliases = {"/naturalize"},
usage = "",
desc = "3 layers of dirt on top then rock below",
min = 0,
max = 0
)
@CommandPermissions("worldedit.region.naturalize")
@Logging(REGION)
@ -416,11 +416,11 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/walls" },
usage = "<pattern>",
desc = "Build the four sides of the selection",
min = 1,
max = 1
aliases = {"/walls"},
usage = "<pattern>",
desc = "Build the four sides of the selection",
min = 1,
max = 1
)
@CommandPermissions("worldedit.region.walls")
@Logging(REGION)
@ -432,11 +432,11 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/faces", "/outline" },
usage = "<pattern>",
desc = "Build the walls, ceiling, and floor of a selection",
min = 1,
max = 1
aliases = {"/faces", "/outline"},
usage = "<pattern>",
desc = "Build the walls, ceiling, and floor of a selection",
min = 1,
max = 1
)
@CommandPermissions("worldedit.region.faces")
@Logging(REGION)
@ -458,7 +458,7 @@ public class RegionCommands extends MethodCommands {
min = 0,
max = 2
)
@CommandPermissions("worldedit.region.smooth")
@CommandPermissions("worldedit.region.smoothsnow")
@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 {
BlockVector3 min = region.getMinimumPoint();
@ -514,23 +514,23 @@ public class RegionCommands extends MethodCommands {
@Command(
aliases = { "/move" },
usage = "[count] [direction] [leave-id]",
flags = "sabe",
desc = "Move the contents of the selection",
help =
"Moves the contents of the selection.\n" +
"The -s flag shifts the selection to the target location.\n" +
" -b also copies biomes\n" +
" -e ignores entities\n" +
"The -a flag skips air blocks.\n" +
"Optionally fills the old location with <leave-id>.",
min = 0,
max = 3
aliases = {"/move"},
usage = "[count] [direction] [leave-id]",
flags = "sbea",
desc = "Move the contents of the selection",
help =
"Moves the contents of the selection.\n" +
"The -s flag shifts the selection to the target location.\n" +
" -b also copies biomes\n" +
" -e ignores entities\n" +
" -a ignores air\n" +
"Optionally fills the old location with <leave-id>.",
min = 0,
max = 3
)
@CommandPermissions("worldedit.region.move")
@Logging(ORIENTATION_REGION)
public void move(FawePlayer player, EditSession editSession, LocalSession session,
public void move(FawePlayer player, LocalSession session, EditSession editSession,
@Selection Region region,
@Optional("1") @Range(min = 1) int count,
@Optional(Direction.AIM) @Direction(includeDiagonals = true) BlockVector3 direction,
@ -550,7 +550,7 @@ public class RegionCommands extends MethodCommands {
session.getRegionSelector(player.getWorld()).learnChanges();
session.getRegionSelector(player.getWorld()).explainRegionAdjust(player.getPlayer(), session);
} catch (RegionOperationException e) {
player.toWorldEditPlayer().printError(e.getMessage());
player.sendMessage(BBC.getPrefix() + e.getMessage());
}
}
@ -583,21 +583,21 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/stack" },
usage = "[count] [direction]",
flags = "sam",
desc = "Repeat the contents of the selection",
help =
"Repeats the contents of the selection.\n" +
"Flags:\n" +
" -s shifts the selection to the last stacked copy\n" +
" -a skips air blocks",
min = 0,
max = 2
aliases = {"/stack"},
usage = "[count] [direction]",
flags = "sam",
desc = "Repeat the contents of the selection",
help =
"Repeats the contents of the selection.\n" +
"Flags:\n" +
" -s shifts the selection to the last stacked copy\n" +
" -a skips air blocks",
min = 0,
max = 2
)
@CommandPermissions("worldedit.region.stack")
@Logging(ORIENTATION_REGION)
public void stack(FawePlayer player, EditSession editSession, LocalSession session,
public void stack(FawePlayer player, LocalSession session, EditSession editSession,
@Selection Region region,
@Optional("1") @Range(min = 1) int count,
@Optional(Direction.AIM) @Direction(includeDiagonals = true) BlockVector3 direction,
@ -620,7 +620,7 @@ public class RegionCommands extends MethodCommands {
session.getRegionSelector(player.getWorld()).learnChanges();
session.getRegionSelector(player.getWorld()).explainRegionAdjust(player.getPlayer(), session);
} catch (RegionOperationException e) {
player.sendMessage(e.getMessage());
player.sendMessage(BBC.getPrefix() + e.getMessage());
}
}
@ -629,14 +629,14 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/deform" },
aliases = {"/deform"},
usage = "<expression>",
desc = "Deforms a selected region with an expression",
help =
"Deforms a selected region with an expression\n" +
"The expression is executed for each block and is expected\n" +
"to modify the variables x, y and z to point to a new block\n" +
"to fetch. See also tinyurl.com/wesyntax.",
"Deforms a selected region with an expression\n" +
"The expression is executed for each block and is expected\n" +
"to modify the variables x, y and z to point to a new block\n" +
"to fetch. See also tinyurl.com/wesyntax.",
flags = "ro",
min = 1,
max = -1
@ -647,10 +647,10 @@ public class RegionCommands extends MethodCommands {
@Selection Region region,
@Text String expression,
@Switch('r') boolean useRawCoords,
@Switch('o') boolean offset, CommandContext context) throws WorldEditException {
@Switch('o') boolean offset,
CommandContext context) throws WorldEditException {
final Vector3 zero;
Vector3 unit;
if (useRawCoords) {
zero = Vector3.ZERO;
unit = Vector3.ONE;
@ -676,7 +676,7 @@ public class RegionCommands extends MethodCommands {
player.findFreePosition();
BBC.VISITOR_BLOCK.send(fp, affected);
} catch (ExpressionException e) {
fp.sendMessage(e.getMessage());
fp.sendMessage(BBC.getPrefix() + e.getMessage());
}
}, getArguments(context), region, context);
}
@ -727,15 +727,15 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/hollow" },
usage = "[<thickness>[ <pattern>]]",
desc = "Hollows out the object contained in this selection",
help =
"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.",
min = 0,
max = 2
aliases = {"/hollow"},
usage = "[<thickness>[ <pattern>]]",
desc = "Hollows out the object contained in this selection",
help =
"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.",
min = 0,
max = 2
)
@CommandPermissions("worldedit.region.hollow")
@Logging(REGION)
@ -751,7 +751,7 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/forest" },
aliases = {"/forest"},
usage = "[type] [density]",
desc = "Make a forest within the region",
min = 0,
@ -766,7 +766,7 @@ public class RegionCommands extends MethodCommands {
}
@Command(
aliases = { "/flora" },
aliases = {"/flora"},
usage = "[density]",
desc = "Make flora within the region",
min = 0,
@ -776,14 +776,15 @@ public class RegionCommands extends MethodCommands {
@Logging(REGION)
public void flora(FawePlayer player, EditSession editSession, @Selection Region region, @Optional("10") @Range(min = 0, max = 100) double density, CommandContext context) throws WorldEditException {
player.checkConfirmationRegion(() -> {
FloraGenerator generator = new FloraGenerator(editSession);
GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator);
LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground);
visitor.setMask(new NoiseFilter2D(new RandomNoise(), density / 100));
Operations.completeLegacy(visitor);
FloraGenerator generator = new FloraGenerator(editSession);
GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator);
LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground);
visitor.setMask(new NoiseFilter2D(new RandomNoise(), density / 100));
Operations.completeLegacy(visitor);
BBC.COMMAND_FLORA.send(player, ground.getAffected());
}, getArguments(context), region, context);
}
}