Removed -q flag from //[h]sphere and the code to back it.

The speed difference between the "flexible" and the "quick" variant is so minor that it doesn't justify the aditional code complexity.
This commit is contained in:
TomyLobo
2011-10-28 15:10:14 +02:00
parent d9b86025d3
commit 318e81886c
2 changed files with 0 additions and 116 deletions

View File

@ -85,7 +85,6 @@ public class GenerationCommands {
aliases = { "/hsphere" },
usage = "<block> <radius>[,<radius>,<radius>] [raised?]",
desc = "Generate a hollow sphere.",
flags = "q",
min = 2,
max = 3
)
@ -95,29 +94,6 @@ public class GenerationCommands {
LocalSession session, LocalPlayer player, EditSession editSession)
throws WorldEditException {
if (args.hasFlag('q')) {
Pattern block = we.getBlockPattern(player, args.getString(0));
String[] radiuses = args.getString(1).split(",");
if (radiuses.length > 1) {
throw new InsufficientArgumentsException("Cannot specify q flag and multiple radiuses.");
}
double radius = Double.parseDouble(radiuses[0]);
boolean raised = args.argsLength() > 2
? (args.getString(2).equalsIgnoreCase("true")
|| args.getString(2).equalsIgnoreCase("yes"))
: false;
Vector pos = session.getPlacementPosition(player);
if (raised) {
pos = pos.add(0, radius, 0);
}
int affected = editSession.makeSphere(pos, block, radius, false);
player.findFreePosition();
player.print(affected + " block(s) have been created.");
return;
}
final Pattern block = we.getBlockPattern(player, args.getString(0));
String[] radiuses = args.getString(1).split(",");
final double radiusX, radiusY, radiusZ;
@ -157,7 +133,6 @@ public class GenerationCommands {
aliases = { "/sphere" },
usage = "<block> <radius>[,<radius>,<radius>] [raised?]",
desc = "Generate a filled sphere.",
flags = "q",
min = 2,
max = 3
)
@ -167,29 +142,6 @@ public class GenerationCommands {
LocalSession session, LocalPlayer player, EditSession editSession)
throws WorldEditException {
if (args.hasFlag('q')) {
Pattern block = we.getBlockPattern(player, args.getString(0));
String[] radiuses = args.getString(1).split(",");
if (radiuses.length > 1) {
throw new InsufficientArgumentsException("Cannot specify q flag and multiple radiuses.");
}
double radius = Double.parseDouble(radiuses[0]);
boolean raised = args.argsLength() > 2
? (args.getString(2).equalsIgnoreCase("true")
|| args.getString(2).equalsIgnoreCase("yes"))
: false;
Vector pos = session.getPlacementPosition(player);
if (raised) {
pos = pos.add(0, radius, 0);
}
int affected = editSession.makeSphere(pos, block, radius, true);
player.findFreePosition();
player.print(affected + " block(s) have been created.");
return;
}
Pattern block = we.getBlockPattern(player, args.getString(0));
String[] radiuses = args.getString(1).split(",");
final double radiusX, radiusY, radiusZ;