Add more variable args for expressions, quoting

This commit is contained in:
Kenzie Togami
2019-04-28 22:03:54 -07:00
parent d4fce65abc
commit 82c4846436
5 changed files with 103 additions and 14 deletions

View File

@ -273,8 +273,8 @@ public class GenerationCommands {
@Selection Region region,
@Arg(desc = "The pattern of blocks to set")
Pattern pattern,
@Arg(desc = "Expression to test block placement locations and set block type")
String expression,
@Arg(desc = "Expression to test block placement locations and set block type", variable = true)
List<String> expression,
@Switch(name = 'h', desc = "Generate a hollow shape")
boolean hollow,
@Switch(name = 'r', desc = "Use the game's coordinate origin")
@ -312,7 +312,7 @@ public class GenerationCommands {
}
try {
final int affected = editSession.makeShape(region, zero, unit, pattern, expression, hollow, session.getTimeout());
final int affected = editSession.makeShape(region, zero, unit, pattern, String.join(" ", expression), hollow, session.getTimeout());
player.findFreePosition();
player.print(affected + " block(s) have been created.");
return affected;
@ -334,8 +334,8 @@ public class GenerationCommands {
@Selection Region region,
@Arg(desc = "The biome type to set")
BiomeType target,
@Arg(desc = "Expression to test block placement locations and set biome type")
String expression,
@Arg(desc = "Expression to test block placement locations and set biome type", variable = true)
List<String> expression,
@Switch(name = 'h', desc = "Generate a hollow shape")
boolean hollow,
@Switch(name = 'r', desc = "Use the game's coordinate origin")
@ -372,7 +372,7 @@ public class GenerationCommands {
}
try {
final int affected = editSession.makeBiomeShape(region, zero, unit, target, expression, hollow, session.getTimeout());
final int affected = editSession.makeBiomeShape(region, zero, unit, target, String.join(" ", expression), hollow, session.getTimeout());
player.findFreePosition();
player.print("" + affected + " columns affected.");
return affected;