Added //generate -c, which offsets the input coordinates from the selection center.

This commit is contained in:
TomyLobo 2012-05-17 12:16:38 +02:00
parent 3c00535d2e
commit f910fe4e66

View File

@ -331,9 +331,10 @@ public class GenerationCommands {
" -h to generate a hollow shape\n" + " -h to generate a hollow shape\n" +
" -r to use raw minecraft coordinates\n" + " -r to use raw minecraft coordinates\n" +
" -o is like -r, except offset from placement.\n" + " -o is like -r, except offset from placement.\n" +
" -c is like -r, except offset selection center.\n" +
"If neither -r nor -o is given, the selection is mapped to -1..1\n" + "If neither -r nor -o is given, the selection is mapped to -1..1\n" +
"See also tinyurl.com/wesyntax.", "See also tinyurl.com/wesyntax.",
flags = "hro", flags = "hroc",
min = 1, min = 1,
max = -1 max = -1
) )
@ -358,6 +359,12 @@ public class GenerationCommands {
} else if (args.hasFlag('o')) { } else if (args.hasFlag('o')) {
zero = session.getPlacementPosition(player); zero = session.getPlacementPosition(player);
unit = new Vector(1, 1, 1); unit = new Vector(1, 1, 1);
} else if (args.hasFlag('c')) {
final Vector min = region.getMinimumPoint();
final Vector max = region.getMaximumPoint();
zero = max.add(min).multiply(0.5);
unit = new Vector(1, 1, 1);
} else { } else {
final Vector min = region.getMinimumPoint(); final Vector min = region.getMinimumPoint();
final Vector max = region.getMaximumPoint(); final Vector max = region.getMaximumPoint();